aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/cmd/dtrace
diff options
context:
space:
mode:
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/dtrace')
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/dtrace.1670
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/dtrace.c1928
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/README32
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof/baddof.c207
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/cmd/badioctl/badioctl.c145
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/cmd/chkargs/chkargs.c149
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/Getopt.java453
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/JDTrace.java1042
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst79
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/jdtrace.c60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/manifest/jdtrace.jar-manifest3
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl235
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl706
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_FUNC.bad.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_MDIM.bad.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_NULL.bad.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_REDEF.redef.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.avgtoofew.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.maxnoarg.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.mintoofew.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.quantizetoofew.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.sumtoofew.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_AGGARG.bad.d77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_PROTO.bad.d77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_IDENT.bad.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_UNDEF.badaggfunc.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badexpr.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badkey3.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.noeffect.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey1.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey2.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey4.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqbad1.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqshort.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASEVAL.bad.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMTYPE.lqbad1.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMVAL.bad.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.d33
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.order.d33
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.d33
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.order.d33
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHSTEP.d33
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MISMATCH.lqbadarg.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPLARGE.lqtoofew.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPSMALL.bad.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPTYPE.lqbadinc.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPVAL.bad.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_AGGARG.bad.d65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_PROTO.bad.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_SCALAR.bad.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_ARG.lquantizetoofew.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgnoarg.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgtoomany.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.counttoomany.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizenoarg.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizetoomany.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxnoarg.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxtoomany.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.minnoarg.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.mintoomany.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizenoarg.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizetoomany.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumnoarg.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumtoomany.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_AGGARG.bad.d35
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badmany.d34
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badnone.d33
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_SCALAR.bad.d34
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.allquant.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.allquant.d.out131
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clear.d75
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clear.d.out22
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d.out16
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d.out22
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d.out94
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d.out22
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count2.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count2.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count3.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d.out7
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d.out7
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.forms.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.forms.d.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.goodkey.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.keysort.d108
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.keysort.d.out160
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d.out61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d.out16
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d.out23
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d.out9
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d96
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d.out910
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max.d58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max.d.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out37
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d.out15
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d150
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d.out64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negorder.d85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negorder.d.out376
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negquant.d115
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negquant.d.out55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d.out11
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d.out46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.normalize.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.normalize.d.out7
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.order.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.order.d.out33
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantize.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantize.d.out61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d.out1208
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantround.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantround.d.out9
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d.out146
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signature.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d120
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d.out44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d115
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d.out61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d35
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d111
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sum.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sum.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc.d.out11
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d.out7
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d.out46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d.out4
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_1.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_2.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.modby0.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.addmin.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.divmin.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muladd.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muldiv.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out8
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out10
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d36
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out10
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_ARR_BADREF.bad.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRBIG.toobig.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRNULL.bad.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRSUB.bad.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_PROTO_TYPE.badtuple.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_IDENT_UNDEF.badureg.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic1.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic2.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic3.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic4.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic5.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic6.d58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.uregsarray.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.this.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_ARG.badsig.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toofew.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toomany.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_SYNTAX.errassign.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.tupoflow.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.cpyarray.d65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.diffprofile.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.initialize.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.invalidref.d75
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.misc.d69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.this.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.valassign.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.begin.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.tick.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.begin.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.begin.d.out5
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.multibegin.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.multibegin.d.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_ADDROF_BITFIELD.BitfieldAddress.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.NegBitField.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.ZeroBitField.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.ExceedBaseType.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.GreaterThan64.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFTYPE.badtype.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_OFFSETOF_BITFIELD.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_SIZEOF_BITFIELD.SizeofBitfield.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/tst.BitFieldPromotion.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/tst.SizeofBitField.d109
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.end.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize1.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize2.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize3.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.zerobuf.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.alignring.d81
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.cputime.ksh90
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.dynvarsize.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d118
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d.out9
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize3.d73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring1.d75
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring2.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring2.d.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d.out5
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.smallring.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.switch1.d69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.switch1.d.out11
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.cpuusage.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.nice.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.priority.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.prsize.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.rssize.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg0.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg0clause.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8clause.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.caller.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.caller1.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.epid.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.epid1.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.errno.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.errno1.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.execname.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.hpriority.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.id.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.id1.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.ipl.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.ipl1.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo1.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.pid.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.pid1.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.tid.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.tid1.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.timestamp.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.vtimestamp.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.baddif.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggfun.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggtup.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.arrtup.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.body.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.both.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.pred.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.nopred.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.pred.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.predfirst.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.predlast.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.malformedoverflow.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.nonexistentevent.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart1.ksh78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart2.ksh70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cputrackfailtostart.ksh77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cputrackterminates.ksh70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.toomanyenablings.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.allcpus.ksh107
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.genericevent.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.platformevent.ksh81
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_LOCASSC.NonLocalAssoc.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_LONGINT.LongStruct.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PARMCLASS.BadStorageClass.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_NAME.VoidName.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_TYPE.Dyn.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VARARGS.VarLenArgs.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VOID.NonSoleVoid.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_SIGNINT.UnsignedStruct.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_VOIDATTR.ShortVoidDecl.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.arrays.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.basics.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.funcs.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.pointers.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.varargsfuncs.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/badptr.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/countdown.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/counter.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/errorpath.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/hello.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/kstat.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/ksyms.d63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/renormalize.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rtime.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rw.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rwinfo.d74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rwtime.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/specopen.d79
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/truss.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/trussrw.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/userfunc.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_AGGREGATION.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DBLERROR.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DYNAMIC.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.end.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPEC.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPECUNAVAIL.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/err.D_PDESC_ZERO.InvalidDescription1.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.APIVersion.d37
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.AddSearchPath.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ELFGeneration.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.IncludedFilePath.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithFunctions99
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithIDs77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithModules91
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithNames128
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithProviders82
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ShowCompilerCode.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceFunctions115
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceIDs70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceModule114
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceNames129
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceProvider83
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.VerboseStabilityReport.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh82
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeGiga.d.ksh45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeKilo.d.ksh45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeMega.d.ksh45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeTera.d.ksh45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel32.d.ksh73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel64.d.ksh74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithoutW.d.ksh55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus1.d.ksh56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus2.d.ksh55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExtraneousProbeIds.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName1.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName2.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId1.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId2.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId3.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule1.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule2.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule3.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule4.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProbeIdentifier.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider1.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider2.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider3.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider4.d.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc1.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc2.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc3.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc4.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc5.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc6.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc8.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc9.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID1.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID2.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID3.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID4.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID5.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID6.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID7.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule1.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule2.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule3.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule4.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule5.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule6.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule7.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule8.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName1.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName2.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName3.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName4.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName5.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName6.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName7.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName8.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName9.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider1.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider2.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider3.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider4.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider5.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.MultipleInvalidProbeId.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh.out0
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.UnDefineNameWithCPP.d.ksh71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbeIdentfier.d.ksh53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbesWithoutZ.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/err.D_IDENT_UNDEF.timespent.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.end.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.endwithoutbegin.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.multibeginend.d77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.multiend.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_BADADDR.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_DIVZERO.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_UNKNOWN.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.error.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.errorend.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/err.D_PROTO_LEN.noarg.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/err.exitarg1.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/tst.basic1.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/err.D_PDESC_ZERO.notreturn.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.basic.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_FUNC_UNDEF.progenyofbad1.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_OP_VFPTR.badop.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.chillbadarg.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.copyoutbadarg.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.mobadarg.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.raisebadarg.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.allocanoarg.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.badbreakpoint.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoofew.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoomany.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrbadarg.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrtoofew.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoofew.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoomany.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.panicbadarg.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.progenyofbad2.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.stopbadarg.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_STRINGOF_TYPE.badstringof.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_VAR_UNDEF.badvar.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badalloca.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badalloca2.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy1.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy2.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy3.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy4.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy5.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy6.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badchill.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.chillbadarg.ksh69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyout.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyoutbadaddr.ksh71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyoutstrbadaddr.ksh70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntoa6badaddr.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntoabadaddr.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadaddr.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadarg.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh102
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d87
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out163
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.bcopy.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.chill.ksh77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d.out22
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.copyin.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.copyinto.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ddi_pathname.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.default.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.freopen.ksh111
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh.out11
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.hton.d99
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d226
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d.out1126
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d.out5
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d95
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d.out8
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d138
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d.out13
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d.out8
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d80
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out302
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owned.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.progenyof.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.rand.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strchr.d71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strchr.d.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d.out5
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strstr.d89
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strstr.d.out10
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok.d146
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok.d.out5
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok_null.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d231
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out254
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d.out8
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.tolower.d66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.toupper.d66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/err.D_ADDROF_LVAL.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/err.D_EMPTY.empty.d34
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/tst.clauses.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/tst.stmts.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/tst.includefirst.ksh76
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef1.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef2.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_IDENT_UNDEF.recur.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef1.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef2.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineDataAssign.d68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineExpression.d80
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d.out7
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineTypedef.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineWritableAssign.d66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c100
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d.out36
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl104
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl97
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh.out6
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh125
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh.out7
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh93
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out6
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh81
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh.out3
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh128
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh.out7
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh88
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh.out5
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh82
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out6
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh88
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh182
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh.out18
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh172
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh.out15
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/manifest/test.jar-manifest2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestAbort.java158
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestBean.java706
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestClose.java90
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestDrop.java169
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestEnable.java151
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java114
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java252
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestMaxConsumers.java97
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestMultiAggPrinta.java144
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestProbeData.java110
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestProbeDescription.java55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestStateMachine.java627
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestStopLock.java67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out722
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.GetAggregate.ksh36
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh.out17
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh.out78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c93
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh.out50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh.out8
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh.out70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.printa.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.printa.d.out47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NL.char.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NULL.char.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_INT_DIGIT.InvalidDigit.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_INT_OFLOW.BigInt.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_STR_NL.string.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace1.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace2.d37
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack1.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack2.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack3.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren1.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren2.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren3.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out177
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out25
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out148
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out25
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.normal.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out26
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.range.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.range.d.out29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.steps.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out2033
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out34
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh79
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.tcp.ksh155
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.udp.ksh74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/err.D_PRAGMA_OPTSET.d34
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.badopt.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.boolopt.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.boolopt.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dynopt.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dynopt.d.out31
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.enablerace.ksh89
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.haslam.d63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh135
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out15
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.roch.d93
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh79
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGKEY.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGPROTO.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.many.d311
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.many.d.out265
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.same.d37
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.same.d.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d.out201
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d.out1021
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d37
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d.out55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d.out72
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call.c120
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call.d70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.c441
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.d91
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.badtype.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.notsou.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.OffsetofNULL.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.badmemb.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofAlias.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofArith.d73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofUnion.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.struct.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.struct.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.union.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.union.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/operators/tst.ternary.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/operators/tst.ternary.d.out4
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badproc1.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_BADPID.badproc2.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.d36
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.addprobes.ksh61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.d75
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.d.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.d86
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.killonerror.ksh41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.main.ksh59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.manypids.ksh70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh.out7
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.probemod.ksh54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh93
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh131
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh102
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh154
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.d73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.d73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.d83
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.d83
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.ArrayVar.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.DynamicVar.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.agg.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_NONPTR.noptr.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_VOID.VoidPointerDeref.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_ARRFUN.ArrayAssignment.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_INCOMPAT.VoidPointerArith.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_LVAL.AddressChange.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.NonPointerAccess.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.badpointer.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.BadPointerAccess.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.badpointer.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress1.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d84
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer1.d174
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer2.d71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer3.d72
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.GlobalVar.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.IntegerArithmetic1.d72
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic1.d58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic2.d72
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic3.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerAssignment.d71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer1.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer2.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.VoidCast.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.basic1.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.basic2.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGERR.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_DEPEND.main.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_INVAL.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_MALFORM.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_UNUSED.UnusedPragma.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.circlibdep.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.invalidlibdep.ksh57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdep.ksh66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepfullyconnected.ksh100
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh76
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh106
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh102
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.basics.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.complex.d126
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out83
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh197
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_IDENT_UNDEF.afterprobe.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_SYNTAX.withoutpound.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.defincomp.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefelsenotendif.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefincomp.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefnotendif.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.incompelse.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.mulelse.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.predicatedeclare.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.withinprobe.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d34
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d34
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.array.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.array.d.out23
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.bitfield.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.bitfield.d.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d28
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d33
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d.out4
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.primitive.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.primitive.d.out11
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.struct.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.struct.d.out12
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out8
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badagg.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badfmt.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badval.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_PROTO.bad.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d36
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.stack.d36
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d36
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d.out19
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.def.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.def.d.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d.out5
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.fmt.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.fmt.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh83
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.many.d76
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.manyval.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.manyval.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.stack.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.tuple.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.tuple.d.out8
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_AGG_CONV.aggfmt.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.toomany.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.widths.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_FMT.badfmt.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_PROTO.novalue.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.aggarg.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.recursive.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.noprec.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.nowidth.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badprec.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badwidth.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PROTO_LEN.toofew.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv1.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv2.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv3.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d.out26
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.flags.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.flags.d.out7
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.hello.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.hello.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d87
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.precs.d58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.precs.d.out14
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.print-f.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.print-f.d.out4
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printcont.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printcont.d.out16
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printeE.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printeE.d.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printgG.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printgG.d.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.uints.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.uints.d.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths.d.out14
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths1.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.wp.d66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.wp.d.out22
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh82
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.op_access.ksh70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.unpriv_funcs.ksh79
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probeqtn.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probestar.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.tickstar.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.assign.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declare.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declarein.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.lbraces.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.probespec.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.rbraces.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.recdec.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.basic1.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.check.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.declare.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.declareafter.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.emptyprobe.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragma.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmaaftertab.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmainside.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmaoutside.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.create.ksh67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exec.ksh73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh84
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh86
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh92
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitexit.ksh67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh75
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh84
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh89
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZERO.profile.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonens.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonensec.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneus.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneusec.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.basic.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.basic.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh.out6
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_INVAL.wrongdec4.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.nonprofile.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec1.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec2.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec3.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.basics.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.basics.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginexit.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginprof.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginprof.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probattrs.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probattrs.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probefunc.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probefunc.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probemod.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probemod.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probename.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probename.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probprov.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probprov.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profend.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profend.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profexit.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profexit.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.trace.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.trace.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.twoprof.d58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.twoprof.d.out1
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.aggrate.d68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.aggrate.d.out101
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.statusrate.d72
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.switchrate.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.switchrate.d.out101
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.basename.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.caller.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.cleanpath.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin2.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ddi_pathname.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.dirname.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.errno.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.execname.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.gid.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.hton.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.index.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.msgdsize.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.msgsize.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.null.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.pid.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ppid.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.progenyof.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.random.d73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.rw.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.shortstr.d77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stack.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stackdepth.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stddev.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strchr.d66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strjoin.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strstr.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strtok.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.substr.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ucaller.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.uid.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.unalign.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.uregs.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ustack.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ustackdepth.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.vahole.d69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.zonename.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_ARR_LOCAL.thisarray.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.selfthis.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.thisself.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_IDRED.errval.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dec.err.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_SYNTAX.declare.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d57
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.localvar.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.misc.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.self.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray2.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfthis.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.this.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.thisself.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.enqueue.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.oncpu.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.stackdepth.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_MACRO_UNDEF.invalidargs.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_OP_LVAL.rdonly.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_OP_WRITE.usepidmacro.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.concat.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.desc.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.inval.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.pid.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh80
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arg0.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh90
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.assign.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.basic.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh97
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh86
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh86
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.pgid.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.pid.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh86
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh86
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.quite.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh86
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh86
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.trace.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh86
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_BADREF.SizeofAssoc.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SYNTAX.SizeofBadType.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofArray.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofDataTypes.d122
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofExpression.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofNULL.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d42
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/bug.1001148.SpecSizeVariations.d87
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d84
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d90
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_COMM.AggAftCommit.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithAvg.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithCount.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithLquant.d72
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMax.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMin.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithSum.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.CommitAftCommit.d82
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.DisjointCommit.d102
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_DREC.CommitAftDataRec.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.DataRecAftCommit.d73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.ExitAfterCommit.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_EXIT_SPEC.ExitAftSpec.d70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_MALFORM.NspecExpr.d77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.HugeNspecValue.d76
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.InvalidSpecSize.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PROTO_LEN.SpecNoId.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_COMM.SpecAftCommit.d72
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_DREC.SpecAftDataRec.d70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_SPEC.SpecAftSpec.d66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeBufSize.d88
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeNspec.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeSpecSize.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations1.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations2.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.CommitAfterDiscard.d86
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.CommitWithZero.d66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DataRecAftDiscard.d77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftCommit.d85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDataRec.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDiscard.d85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardWithZero.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.ExitAftDiscard.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations1.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations2.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculateWithRandom.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationCommit.d75
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationDiscard.d74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationID.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationWithZero.d65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.TwoSpecBuffers.d77
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.negcommit.d37
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.negspec.d37
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.zerosize.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stability/err.D_ATTR_MIN.MinAttributes.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_STACK_PROTO.bad.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_STACK_SIZE.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_FRAMES.bad.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_PROTO.bad.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_STRSIZE.bad.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/tst.default.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stackdepth/tst.default.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c37
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c37
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/strlen/tst.strlen1.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_ADDROF_VAR.StructPointer.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon.d74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon1.d68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.circular.d66
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order.d69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order2.d108
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.recursive.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.simple.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_VOIDOBJ.baddec.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_PROTO_ARG.DupStructAssoc.d80
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructAssoc.d71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructDataTypes.d133
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructInside.d124
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.openret.ksh75
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post.c45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post.d88
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.c49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.d87
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZERO.tick.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonens.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonensec.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneus.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneusec.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickarg0.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d28
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.misc.d68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.qstring.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.qstring.d.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.string.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_ARG.badsize.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toofew.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d30
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.negsize.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.zerosize.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out1313
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.rootvp.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_DECL_TYPERED.BadTransDecl.d64
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_OP_INCOMPLETE.NonExistentInput1.d54
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl1.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl3.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl4.d65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_TYPE_MEMBER.NonExistentInput2.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_INCOMPAT.BadInputType1.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_MEMB.NonExistentOutput2.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_NONE.BadTransDecl6.d72
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_REDECL.RepeatTransDecl.d67
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransDecl8.d58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransInt.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.NonExistentOutput1.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.CircularTransDecl.d100
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.EmptyTransDecl.d79
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.ForwardTag.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.InputAliasTrans.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.InputIntTrans.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.OutputAliasTrans.d63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.PartialDereferencing.d85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.PartialOutputTransDefn.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.ProcModelTrans.d53
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.RepeatDeclaration.d71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.SimultaneousTranslators.d71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.StructureAssignment.d85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out14
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out14
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransNonPointer.d84
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransOutputPointer.d80
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransPointer.d63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TranslateSelf.d76
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.UnionInputTrans.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.UnionOutputTrans.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_DECL_IDRED.DupTypeDef.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.BadExistingTypedef.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.TypedefInClause.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/tst.ChainTypedef.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/tst.TypedefDataAssign.d118
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CAST_INVAL.badcast.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CG_DYN.ResultDynType.d47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CHR_OFLOW.charconst.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_BADCLASS.bad.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_CHARATTR.badtype3.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype4.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype5.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENCONST.badeval.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enoflow.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enuflow.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_SCOPE.scopeop.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_USELESS.baddec.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_ACT.badcond.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_ARITH.badoperand.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INCOMPAT.badassign.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badbitop.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badshift.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badcond.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badincop.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badlogop.d43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_PROTO_LEN.badcond1.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badenum.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badid.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badstruct.d38
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype1.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype2.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupenum.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupstruct.d39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.assignops.d82
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.badshiftops.d49
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.basics.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.basics.d.out16
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.bitops.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.charconstants.d68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.complex.d74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.condexpr.d61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.constants.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.conv.d109
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.enum.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.intincop.d70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.intops.d70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.inttypes.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.ptrincop.d72
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.ptrops.d71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.relenum.d73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.relstring.d70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.shiftops.d62
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.stringconstants.d51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.struct.d84
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.typedef.d85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.unaryop.d50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_ADDROF_VAR.UnionPointer.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon.d69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon1.d68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.circular.d65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.order.d69
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.recursive.d59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.simple.d58
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_PROTO_ARG.DupUnionAssoc.d80
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionAssoc.d71
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionDataTypes.d132
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionInside.d85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile13
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/argmap.d31
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/args.d31
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/forker.d31
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/main.c11
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.d3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.andpid.ksh46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.d65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c39
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.d60
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh84
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh107
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh159
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh160
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh170
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh106
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh96
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh113
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh118
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh.out10
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh105
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh.out4
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c47
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.ksh55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh96
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh100
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh82
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh84
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh99
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh.out5
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh90
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh128
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh124
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh82
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh115
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh98
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh98
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh.out5
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh108
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh.out5
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh96
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh.out2
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.d45
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.depth.ksh110
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c61
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh139
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.gid.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.nullassign.d94
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ppid.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh65
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh.out3
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.uid.d41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.walltimestamp.d55
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/version/tst.1.0.d48
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/arrays/tst.uregsarray.d63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyinstr.d52
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyout.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d56
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s41
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.s73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.d73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.s68
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.d76
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.s114
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh50
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.s51
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/annotated_helper.d32
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/helper_helper.d32
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.c43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d35
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d.out4
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.c82
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.d.out4
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.basic.ksh77
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.hvmenable.ksh64
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.memenable.ksh65
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh121
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedenable.ksh74
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/arrays/tst.uregsarray.d85
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.d40
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.exe29
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.d70
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.d.out23
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.s81
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.d78
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.s63
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.d73
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.s59
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh132
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/annotated_helper.d32
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/helper_helper.d32
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.c43
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d35
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d.out4
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.d46
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.s44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.c81
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d44
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d.out4
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.trapstat.ksh87
1590 files changed, 97775 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
new file mode 100644
index 000000000000..e20ed9fe6ba8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
@@ -0,0 +1,670 @@
+'\" te
+.\" CDDL HEADER START
+.\"
+.\" The contents of this file are subject to the terms of the
+.\" Common Development and Distribution License (the "License").
+.\" You may not use this file except in compliance with the License.
+.\"
+.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+.\" or http://www.opensolaris.org/os/licensing.
+.\" See the License for the specific language governing permissions
+.\" and limitations under the License.
+.\"
+.\" When distributing Covered Code, include this CDDL HEADER in each
+.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+.\" If applicable, add the following below this CDDL HEADER, with the
+.\" fields enclosed by brackets "[]" replaced with your own identifying
+.\" information: Portions Copyright [yyyy] [name of copyright owner]
+.\"
+.\" CDDL HEADER END
+.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.TH dtrace 1M "5 Sep 2006" "SunOS 5.11" "System Administration Commands"
+.SH NAME
+dtrace \- DTrace dynamic tracing compiler and tracing utility
+.SH SYNOPSIS
+.LP
+.nf
+\fBdtrace\fR [\fB-32\fR | \fB-64\fR] [\fB-aACeFGHhlqSvVwZ\fR] [\fB-b\fR \fIbufsz\fR] [\fB-c\fR \fIcmd\fR]
+ [\fB-D\fR \fIname\fR [\fI=value\fR]] [\fB-I\fR \fIpath\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fIoutput\fR]
+ [\fB-s\fR \fIscript\fR] [\fB-U\fR \fIname\fR] [\fB-x\fR \fIarg\fR [\fI=val\fR]]
+ [\fB-X\fR a | c | s | t] [\fB-p\fR \fIpid\fR]
+ [\fB-P\fR \fIprovider\fR [[\fIpredicate\fR] \fIaction\fR]]
+ [\fB-m\fR [\fIprovider:\fR] \fImodule\fR [[\fIpredicate\fR] \fIaction\fR]]
+ [\fB-f\fR [[\fIprovider:\fR] \fImodule:\fR] \fIfunction\fR [[\fIpredicate\fR] \fIaction\fR]]
+ [\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]]
+ [\fB-i\fR \fIprobe-id\fR [[\fIpredicate\fR] \fIaction\fR]]
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+DTrace is a comprehensive dynamic tracing framework for the Solaris Operating System. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs.
+.sp
+.LP
+The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe, debug, and tune system behavior. Refer to this book for a detailed description of DTrace features, including the bundled DTrace observability
+tools, instrumentation providers, and the D programming language.
+.sp
+.LP
+The \fBdtrace\fR command provides a generic interface to the essential services provided by the DTrace facility, including:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Options that list the set of probes and providers currently published by DTrace
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Options that enable probes directly using any of the probe description specifiers (provider, module, function, name)
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Options that run the D compiler and compile one or more D program files or programs written directly on the command line
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Options that generate anonymous tracing programs
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Options that generate program stability reports
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Options that modify DTrace tracing and buffering behavior and enable additional D compiler features
+.RE
+.sp
+.LP
+You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the \fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks.
+.SH OPTIONS
+.sp
+.LP
+The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and \fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid intepretation of meta-characters by the shell.
+.sp
+.LP
+The following options are supported:
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-32\fR | \fB-64\fR\fR
+.ad
+.sp .6
+.RS 4n
+The D compiler produces programs using the native data model of the operating system kernel. You can use the \fBisainfo\fR \fB-b\fR command to determine the current operating system data model. If the \fB-32\fR option is specified, \fBdtrace\fR forces
+the D compiler to compile a D program using the 32-bit data model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler to compile a D program using the 64-bit data model. These options are typically not required as \fBdtrace\fR selects the
+native data model as the default. The data model affects the sizes of integer types and other language properties. D programs compiled for either data model can be executed on both 32-bit and 64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file format
+(ELF32 or ELF64) produced by the \fB-G\fR option.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-a\fR\fR
+.ad
+.sp .6
+.RS 4n
+Claim anonymous tracing state and display the traced data. You can combine the \fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit immediately after consuming the anonymous tracing state rather than continuing to wait for new
+data. See the \fISolaris Dynamic Tracing Guide\fR for more information about anonymous tracing.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-A\fR\fR
+.ad
+.sp .6
+.RS 4n
+Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option constructs a set of \fBdtrace\fR(7D) configuration file directives to enable the specified probes for anonymous tracing and then exits. By default, \fBdtrace\fR attempts to store the directives to the file \fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the \fB-o\fR option to specify an alternate output file.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-b\fR \fIbufsz\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts
+to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-c\fR \fIcmd\fR\fR
+.ad
+.sp .6
+.RS 4n
+Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it
+terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information
+on macro variables.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-C\fR\fR
+.ad
+.sp .6
+.RS 4n
+Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, and \fB-H\fR options. You can select the degree of C standard conformance if you use the \fB-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB-X\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-D\fR \fIname\fR \fB[=\fR\fIvalue\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). If you specify the equals sign (\fB=\fR)
+and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB-D\fR option to each \fBcpp\fR invocation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-e\fR\fR
+.ad
+.sp .6
+.RS 4n
+Exit after compiling any requests and consuming anonymous tracing state (\fB-a\fR option) but prior to enabling any probes. You can combine this option with the \fB-a\fR option to print anonymous tracing data and exit. You can also combine this option with D
+compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-f\fR\fB[[\fR\fIprovider\fR\fB:]\fR\fImodule\fR\fB:]\fR\fIfunction\fR\fB[[\fR\fIpredicate\fR\fB]\fR\fIaction\fR\fB]]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Specify function name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR.
+Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched.
+The \fB-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-f\fR option on the command line at a time.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-F\fR\fR
+.ad
+.sp .6
+.RS 4n
+Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call
+entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-G\fR\fR
+.ad
+.sp .6
+.RS 4n
+Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB-o\fR option is present, the ELF file is saved using the pathname specified
+as the argument for this operand. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR.
+Otherwise the ELF file is saved using the name \fBd.out\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-H\fR\fR
+.ad
+.sp .6
+.RS 4n
+Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-H\fR option
+to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-h\fR\fR
+.ad
+.sp .6
+.RS 4n
+Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB-G\fR option. If the \fB-o\fR option
+is present, the header file is saved using the pathname specified as the argument for that option. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved
+using the name \fIfilename\fR\fB\&.h\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-i\fR \fIprobe-id\fR\fB[[\fR\fIpredicate\fR] \fIaction\fR\fB]\fR\fR
+.ad
+.sp .6
+.RS 4n
+Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR \fB-l\fR. The \fB-i\fR argument can be suffixed with an optional
+D probe clause. You can specify more than one \fB-i\fR option at a time.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-I\fR \fIpath\fR\fR
+.ad
+.sp .6
+.RS 4n
+Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled
+using the \fB-C\fR option). This option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-L\fR \fIpath\fR\fR
+.ad
+.sp .6
+.RS 4n
+Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library
+search path.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-l\fR\fR
+.ad
+.sp .6
+.RS 4n
+List probes instead of enabling them. If the \fB-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR,
+and \fB-s\fR options. If none of these options are specified, this option lists all probes.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-m\fR [[\fIprovider:\fR] \fImodule:\fR [[\fIpredicate\fR] \fIaction\fR]]\fR
+.ad
+.sp .6
+.RS 4n
+Specify module name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match
+any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed with an optional D
+probe clause. More than one \fB-m\fR option can be specified on the command line at a time.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-n\fR [[[\fIprovider:\fR] \fImodule:\fR] \fIfunction:\fR] \fIname\fR [[\fIpredicate\fR] \fIaction\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Specify probe name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR,
+or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are
+matched. The \fB-n\fR argument can be suffixed with an optional D probe clause. More than one \fB-n\fR option can be specified on the command line at a time.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-o\fR \fIoutput\fR\fR
+.ad
+.sp .6
+.RS 4n
+Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, and \fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is present and \fB-o\fR is not present, the default output file is \fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the \fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR.
+Otherwise the default output file is \fBd.out\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR \fIpid\fR\fR
+.ad
+.sp .6
+.RS 4n
+Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status
+for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for
+more information on macro variables.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-P\fR \fIprovider\fR \fB[[\fR\fIpredicate\fR\fB]\fR \fIaction\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Specify provider name to trace or list (\fB-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB-P\fR argument can be suffixed with an optional D
+probe clause. You can specify more than one \fB-P\fR option on the command line at a time.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-q\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program
+statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-s\fR\fR
+.ad
+.sp .6
+.RS 4n
+Compile the specified D program source file. If the \fB-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation
+is not enabled. If none of \fB-e\fR, \fB-l\fR, \fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D program is enabled and tracing begins.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-S\fR\fR
+.ad
+.sp .6
+.RS 4n
+Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-U\fR \fIname\fR\fR
+.ad
+.sp .6
+.RS 4n
+Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-v\fR\fR
+.ad
+.sp .6
+.RS 4n
+Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fISolaris Dynamic Tracing Guide\fR.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-V\fR\fR
+.ad
+.sp .6
+.RS 4n
+Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for
+more information about DTrace versioning features.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-w\fR\fR
+.ad
+.sp .6
+.RS 4n
+Permit destructive actions in D programs specified using the \fB-s\fR, \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR option is not specified, \fBdtrace\fR does not
+permit the compilation or enabling of a D program that contains destructive actions.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-x\fR \fIarg\fR [\fI=val\fR]\fR
+.ad
+.sp .6
+.RS 4n
+Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and
+value with an equals sign (\fB=\fR).
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-X\fR \fBa | c | s | t\fR\fR
+.ad
+.sp .6
+.RS 4n
+Specify the degree of conformance to the ISO C standard that should be selected when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option).
+The \fB-X\fR option argument affects the value and presence of the \fB__STDC__\fR macro depending upon the value of the argument letter.
+.sp
+The \fB-X\fR option supports the following arguments:
+.sp
+.ne 2
+.mk
+.na
+\fB\fBa\fR\fR
+.ad
+.RS 5n
+.rt
+Default. ISO C plus K&R compatibility extensions, with semantic changes required by ISO C. This is the default mode if \fB-X\fR is not specified. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction
+with the \fB-Xa\fR option.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBc\fR\fR
+.ad
+.RS 5n
+.rt
+Conformance. Strictly conformant ISO C, without K&R C compatibility extensions. The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked in conjunction with the \fB-Xc\fR option.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBs\fR\fR
+.ad
+.RS 5n
+.rt
+K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked in conjunction with the \fB-Xs\fR option.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fBt\fR\fR
+.ad
+.RS 5n
+.rt
+Transition. ISO C plus K&R C compatibility extensions, without semantic changes required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option.
+.RE
+
+As the \fB-X\fR option only affects how the D compiler invokes the C preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the perspective of D and both are provided only to ease re-use of settings from a C build environment.
+.sp
+Regardless of the \fB-X\fR mode, the following additional C preprocessor definitions are always specified and valid in all modes:
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB__sun\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB__unix\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB__SVR4\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB__sparc\fR (on SPARC systems only)
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB__sparcv9\fR (on SPARC systems only when 64-bit programs are compiled)
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB__i386\fR (on x86 systems only when 32-bit programs are compiled)
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB__amd64\fR (on x86 systems only when 64-bit programs are compiled)
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB__\fI`uname -s`\fR_\fI`uname -r`\fR\fR (for example, \fB__SunOS_5_10\fR)
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB__SUNW_D=1\fR
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fB__SUNW_D_VERSION=0x\fIMMmmmuuu\fR\fR
+.sp
+Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the minor release value in hexadecimal, and \fIuuu\fR is the
+micro release value in hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information about DTrace versioning.
+.RE
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-Z\fR\fR
+.ad
+.sp .6
+.RS 4n
+Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB-s\fR option) or on the command line (\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain descriptions that do not match any known probes.
+.RE
+
+.SH OPERANDS
+.sp
+.LP
+You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB-s\fR option
+or on the command line. The use of macro variables is described further in the \fISolaris Dynamic Tracing Guide\fR.
+.SH EXIT STATUS
+.sp
+.LP
+The following exit values are returned:
+.sp
+.ne 2
+.mk
+.na
+\fB0\fR
+.ad
+.RS 5n
+.rt
+Successful completion.
+.sp
+For D program requests, an exit status of \fB0\fR indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified tracing requests
+encountered errors or drops.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB1\fR\fR
+.ad
+.RS 5n
+.rt
+An error occurred.
+.sp
+For D program requests, an exit status of \fB1\fR indicates that program compilation failed or that the specified request could not be satisfied.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fB\fB2\fR\fR
+.ad
+.RS 5n
+.rt
+Invalid command line options or arguments were specified.
+.RE
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+tab() box;
+cw(2.75i) |cw(2.75i)
+lw(2.75i) |lw(2.75i)
+.
+ATTRIBUTE TYPEATTRIBUTE VALUE
+_
+AvailabilitySUNWdtrc
+_
+Interface StabilitySee below.
+.TE
+
+.sp
+.LP
+The command-line syntax is Committed. The human-readable output is Uncommitted.
+.SH SEE ALSO
+.sp
+.LP
+\fBcpp\fR(1), \fBisainfo\fR(1), \fBlibdtrace\fR(3LIB), \fBdriver.conf\fR(4), \fBattributes\fR(5), \fBdtrace\fR(7D)
+.sp
+.LP
+\fISolaris Dynamic Tracing Guide\fR
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
new file mode 100644
index 000000000000..a745ceb71732
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
@@ -0,0 +1,1928 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+
+#include <dtrace.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <strings.h>
+#include <unistd.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <signal.h>
+#if defined(sun)
+#include <alloca.h>
+#endif
+#include <libgen.h>
+#if defined(sun)
+#include <libproc.h>
+#endif
+
+typedef struct dtrace_cmd {
+ void (*dc_func)(struct dtrace_cmd *); /* function to compile arg */
+ dtrace_probespec_t dc_spec; /* probe specifier context */
+ char *dc_arg; /* argument from main argv */
+ const char *dc_name; /* name for error messages */
+ const char *dc_desc; /* desc for error messages */
+ dtrace_prog_t *dc_prog; /* program compiled from arg */
+ char dc_ofile[PATH_MAX]; /* derived output file name */
+} dtrace_cmd_t;
+
+#define DMODE_VERS 0 /* display version information and exit (-V) */
+#define DMODE_EXEC 1 /* compile program for enabling (-a/e/E) */
+#define DMODE_ANON 2 /* compile program for anonymous tracing (-A) */
+#define DMODE_LINK 3 /* compile program for linking with ELF (-G) */
+#define DMODE_LIST 4 /* compile program and list probes (-l) */
+#define DMODE_HEADER 5 /* compile program for headergen (-h) */
+
+#define E_SUCCESS 0
+#define E_ERROR 1
+#define E_USAGE 2
+
+static const char DTRACE_OPTSTR[] =
+ "3:6:aAb:Bc:CD:ef:FGhHi:I:lL:m:n:o:p:P:qs:SU:vVwx:X:Z";
+
+static char **g_argv;
+static int g_argc;
+static char **g_objv;
+static int g_objc;
+static dtrace_cmd_t *g_cmdv;
+static int g_cmdc;
+static struct ps_prochandle **g_psv;
+static int g_psc;
+static int g_pslive;
+static char *g_pname;
+static int g_quiet;
+static int g_flowindent;
+static int g_intr;
+static int g_impatient;
+static int g_newline;
+static int g_total;
+static int g_cflags;
+static int g_oflags;
+static int g_verbose;
+static int g_exec = 1;
+static int g_mode = DMODE_EXEC;
+static int g_status = E_SUCCESS;
+static int g_grabanon = 0;
+static const char *g_ofile = NULL;
+static FILE *g_ofp;
+static dtrace_hdl_t *g_dtp;
+#if defined(sun)
+static char *g_etcfile = "/etc/system";
+static const char *g_etcbegin = "* vvvv Added by DTrace";
+static const char *g_etcend = "* ^^^^ Added by DTrace";
+
+static const char *g_etc[] = {
+"*",
+"* The following forceload directives were added by dtrace(1M) to allow for",
+"* tracing during boot. If these directives are removed, the system will",
+"* continue to function, but tracing will not occur during boot as desired.",
+"* To remove these directives (and this block comment) automatically, run",
+"* \"dtrace -A\" without additional arguments. See the \"Anonymous Tracing\"",
+"* chapter of the Solaris Dynamic Tracing Guide for details.",
+"*",
+NULL };
+#endif
+
+static int
+usage(FILE *fp)
+{
+ static const char predact[] = "[[ predicate ] action ]";
+
+ (void) fprintf(fp, "Usage: %s [-32|-64] [-aACeFGhHlqSvVwZ] "
+ "[-b bufsz] [-c cmd] [-D name[=def]]\n\t[-I path] [-L path] "
+ "[-o output] [-p pid] [-s script] [-U name]\n\t"
+ "[-x opt[=val]] [-X a|c|s|t]\n\n"
+ "\t[-P provider %s]\n"
+ "\t[-m [ provider: ] module %s]\n"
+ "\t[-f [[ provider: ] module: ] func %s]\n"
+ "\t[-n [[[ provider: ] module: ] func: ] name %s]\n"
+ "\t[-i probe-id %s] [ args ... ]\n\n", g_pname,
+ predact, predact, predact, predact, predact);
+
+ (void) fprintf(fp, "\tpredicate -> '/' D-expression '/'\n");
+ (void) fprintf(fp, "\t action -> '{' D-statements '}'\n");
+
+ (void) fprintf(fp, "\n"
+ "\t-32 generate 32-bit D programs and ELF files\n"
+ "\t-64 generate 64-bit D programs and ELF files\n\n"
+ "\t-a claim anonymous tracing state\n"
+ "\t-A generate driver.conf(4) directives for anonymous tracing\n"
+ "\t-b set trace buffer size\n"
+ "\t-c run specified command and exit upon its completion\n"
+ "\t-C run cpp(1) preprocessor on script files\n"
+ "\t-D define symbol when invoking preprocessor\n"
+ "\t-e exit after compiling request but prior to enabling probes\n"
+ "\t-f enable or list probes matching the specified function name\n"
+ "\t-F coalesce trace output by function\n"
+ "\t-G generate an ELF file containing embedded dtrace program\n"
+ "\t-h generate a header file with definitions for static probes\n"
+ "\t-H print included files when invoking preprocessor\n"
+ "\t-i enable or list probes matching the specified probe id\n"
+ "\t-I add include directory to preprocessor search path\n"
+ "\t-l list probes matching specified criteria\n"
+ "\t-L add library directory to library search path\n"
+ "\t-m enable or list probes matching the specified module name\n"
+ "\t-n enable or list probes matching the specified probe name\n"
+ "\t-o set output file\n"
+ "\t-p grab specified process-ID and cache its symbol tables\n"
+ "\t-P enable or list probes matching the specified provider name\n"
+ "\t-q set quiet mode (only output explicitly traced data)\n"
+ "\t-s enable or list probes according to the specified D script\n"
+ "\t-S print D compiler intermediate code\n"
+ "\t-U undefine symbol when invoking preprocessor\n"
+ "\t-v set verbose mode (report stability attributes, arguments)\n"
+ "\t-V report DTrace API version\n"
+ "\t-w permit destructive actions\n"
+ "\t-x enable or modify compiler and tracing options\n"
+ "\t-X specify ISO C conformance settings for preprocessor\n"
+ "\t-Z permit probe descriptions that match zero probes\n");
+
+ return (E_USAGE);
+}
+
+static void
+verror(const char *fmt, va_list ap)
+{
+ int error = errno;
+
+ (void) fprintf(stderr, "%s: ", g_pname);
+ (void) vfprintf(stderr, fmt, ap);
+
+ if (fmt[strlen(fmt) - 1] != '\n')
+ (void) fprintf(stderr, ": %s\n", strerror(error));
+}
+
+/*PRINTFLIKE1*/
+static void
+fatal(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ verror(fmt, ap);
+ va_end(ap);
+
+ /*
+ * Close the DTrace handle to ensure that any controlled processes are
+ * correctly restored and continued.
+ */
+ if (g_dtp)
+ dtrace_close(g_dtp);
+
+ exit(E_ERROR);
+}
+
+/*PRINTFLIKE1*/
+static void
+dfatal(const char *fmt, ...)
+{
+#if !defined(sun) && defined(NEED_ERRLOC)
+ char *p_errfile = NULL;
+ int errline = 0;
+#endif
+ va_list ap;
+
+ va_start(ap, fmt);
+
+ (void) fprintf(stderr, "%s: ", g_pname);
+ if (fmt != NULL)
+ (void) vfprintf(stderr, fmt, ap);
+
+ va_end(ap);
+
+ if (fmt != NULL && fmt[strlen(fmt) - 1] != '\n') {
+ (void) fprintf(stderr, ": %s\n",
+ dtrace_errmsg(g_dtp, dtrace_errno(g_dtp)));
+ } else if (fmt == NULL) {
+ (void) fprintf(stderr, "%s\n",
+ dtrace_errmsg(g_dtp, dtrace_errno(g_dtp)));
+ }
+#if !defined(sun) && defined(NEED_ERRLOC)
+ dt_get_errloc(g_dtp, &p_errfile, &errline);
+ if (p_errfile != NULL)
+ printf("File '%s', line %d\n", p_errfile, errline);
+#endif
+
+ /*
+ * Close the DTrace handle to ensure that any controlled processes are
+ * correctly restored and continued.
+ */
+ dtrace_close(g_dtp);
+
+ exit(E_ERROR);
+}
+
+/*PRINTFLIKE1*/
+static void
+error(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ verror(fmt, ap);
+ va_end(ap);
+}
+
+/*PRINTFLIKE1*/
+static void
+notice(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (g_quiet)
+ return; /* -q or quiet pragma suppresses notice()s */
+
+ va_start(ap, fmt);
+ verror(fmt, ap);
+ va_end(ap);
+}
+
+/*PRINTFLIKE1*/
+static void
+oprintf(const char *fmt, ...)
+{
+ va_list ap;
+ int n;
+
+ if (g_ofp == NULL)
+ return;
+
+ va_start(ap, fmt);
+ n = vfprintf(g_ofp, fmt, ap);
+ va_end(ap);
+
+ if (n < 0) {
+ if (errno != EINTR) {
+ fatal("failed to write to %s",
+ g_ofile ? g_ofile : "<stdout>");
+ }
+ clearerr(g_ofp);
+ }
+}
+
+static char **
+make_argv(char *s)
+{
+ const char *ws = "\f\n\r\t\v ";
+ char **argv = malloc(sizeof (char *) * (strlen(s) / 2 + 1));
+ int argc = 0;
+ char *p = s;
+
+ if (argv == NULL)
+ return (NULL);
+
+ for (p = strtok(s, ws); p != NULL; p = strtok(NULL, ws))
+ argv[argc++] = p;
+
+ if (argc == 0)
+ argv[argc++] = s;
+
+ argv[argc] = NULL;
+ return (argv);
+}
+
+static void
+dof_prune(const char *fname)
+{
+ struct stat sbuf;
+ size_t sz, i, j, mark, len;
+ char *buf;
+ int msg = 0, fd;
+
+ if ((fd = open(fname, O_RDONLY)) == -1) {
+ /*
+ * This is okay only if the file doesn't exist at all.
+ */
+ if (errno != ENOENT)
+ fatal("failed to open %s", fname);
+ return;
+ }
+
+ if (fstat(fd, &sbuf) == -1)
+ fatal("failed to fstat %s", fname);
+
+ if ((buf = malloc((sz = sbuf.st_size) + 1)) == NULL)
+ fatal("failed to allocate memory for %s", fname);
+
+ if (read(fd, buf, sz) != sz)
+ fatal("failed to read %s", fname);
+
+ buf[sz] = '\0';
+ (void) close(fd);
+
+ if ((fd = open(fname, O_WRONLY | O_TRUNC)) == -1)
+ fatal("failed to open %s for writing", fname);
+
+ len = strlen("dof-data-");
+
+ for (mark = 0, i = 0; i < sz; i++) {
+ if (strncmp(&buf[i], "dof-data-", len) != 0)
+ continue;
+
+ /*
+ * This is only a match if it's in the 0th column.
+ */
+ if (i != 0 && buf[i - 1] != '\n')
+ continue;
+
+ if (msg++ == 0) {
+ error("cleaned up old anonymous "
+ "enabling in %s\n", fname);
+ }
+
+ /*
+ * We have a match. First write out our data up until now.
+ */
+ if (i != mark) {
+ if (write(fd, &buf[mark], i - mark) != i - mark)
+ fatal("failed to write to %s", fname);
+ }
+
+ /*
+ * Now scan forward until we scan past a newline.
+ */
+ for (j = i; j < sz && buf[j] != '\n'; j++)
+ continue;
+
+ /*
+ * Reset our mark.
+ */
+ if ((mark = j + 1) >= sz)
+ break;
+
+ i = j;
+ }
+
+ if (mark < sz) {
+ if (write(fd, &buf[mark], sz - mark) != sz - mark)
+ fatal("failed to write to %s", fname);
+ }
+
+ (void) close(fd);
+ free(buf);
+}
+
+#if defined(sun)
+static void
+etcsystem_prune(void)
+{
+ struct stat sbuf;
+ size_t sz;
+ char *buf, *start, *end;
+ int fd;
+ char *fname = g_etcfile, *tmpname;
+
+ if ((fd = open(fname, O_RDONLY)) == -1)
+ fatal("failed to open %s", fname);
+
+ if (fstat(fd, &sbuf) == -1)
+ fatal("failed to fstat %s", fname);
+
+ if ((buf = malloc((sz = sbuf.st_size) + 1)) == NULL)
+ fatal("failed to allocate memory for %s", fname);
+
+ if (read(fd, buf, sz) != sz)
+ fatal("failed to read %s", fname);
+
+ buf[sz] = '\0';
+ (void) close(fd);
+
+ if ((start = strstr(buf, g_etcbegin)) == NULL)
+ goto out;
+
+ if (strlen(buf) != sz) {
+ fatal("embedded nul byte in %s; manual repair of %s "
+ "required\n", fname, fname);
+ }
+
+ if (strstr(start + 1, g_etcbegin) != NULL) {
+ fatal("multiple start sentinels in %s; manual repair of %s "
+ "required\n", fname, fname);
+ }
+
+ if ((end = strstr(buf, g_etcend)) == NULL) {
+ fatal("missing end sentinel in %s; manual repair of %s "
+ "required\n", fname, fname);
+ }
+
+ if (start > end) {
+ fatal("end sentinel preceeds start sentinel in %s; manual "
+ "repair of %s required\n", fname, fname);
+ }
+
+ end += strlen(g_etcend) + 1;
+ bcopy(end, start, strlen(end) + 1);
+
+ tmpname = alloca(sz = strlen(fname) + 80);
+ (void) snprintf(tmpname, sz, "%s.dtrace.%d", fname, getpid());
+
+ if ((fd = open(tmpname,
+ O_WRONLY | O_CREAT | O_EXCL, sbuf.st_mode)) == -1)
+ fatal("failed to create %s", tmpname);
+
+ if (write(fd, buf, strlen(buf)) < strlen(buf)) {
+ (void) unlink(tmpname);
+ fatal("failed to write to %s", tmpname);
+ }
+
+ (void) close(fd);
+
+ if (chown(tmpname, sbuf.st_uid, sbuf.st_gid) != 0) {
+ (void) unlink(tmpname);
+ fatal("failed to chown(2) %s to uid %d, gid %d", tmpname,
+ (int)sbuf.st_uid, (int)sbuf.st_gid);
+ }
+
+ if (rename(tmpname, fname) == -1)
+ fatal("rename of %s to %s failed", tmpname, fname);
+
+ error("cleaned up forceload directives in %s\n", fname);
+out:
+ free(buf);
+}
+
+static void
+etcsystem_add(void)
+{
+ const char *mods[20];
+ int nmods, line;
+
+ if ((g_ofp = fopen(g_ofile = g_etcfile, "a")) == NULL)
+ fatal("failed to open output file '%s'", g_ofile);
+
+ oprintf("%s\n", g_etcbegin);
+
+ for (line = 0; g_etc[line] != NULL; line++)
+ oprintf("%s\n", g_etc[line]);
+
+ nmods = dtrace_provider_modules(g_dtp, mods,
+ sizeof (mods) / sizeof (char *) - 1);
+
+ if (nmods >= sizeof (mods) / sizeof (char *))
+ fatal("unexpectedly large number of modules!");
+
+ mods[nmods++] = "dtrace";
+
+ for (line = 0; line < nmods; line++)
+ oprintf("forceload: drv/%s\n", mods[line]);
+
+ oprintf("%s\n", g_etcend);
+
+ if (fclose(g_ofp) == EOF)
+ fatal("failed to close output file '%s'", g_ofile);
+
+ error("added forceload directives to %s\n", g_ofile);
+}
+#endif
+
+static void
+print_probe_info(const dtrace_probeinfo_t *p)
+{
+ char buf[BUFSIZ];
+ int i;
+
+ oprintf("\n\tProbe Description Attributes\n");
+
+ oprintf("\t\tIdentifier Names: %s\n",
+ dtrace_stability_name(p->dtp_attr.dtat_name));
+ oprintf("\t\tData Semantics: %s\n",
+ dtrace_stability_name(p->dtp_attr.dtat_data));
+ oprintf("\t\tDependency Class: %s\n",
+ dtrace_class_name(p->dtp_attr.dtat_class));
+
+ oprintf("\n\tArgument Attributes\n");
+
+ oprintf("\t\tIdentifier Names: %s\n",
+ dtrace_stability_name(p->dtp_arga.dtat_name));
+ oprintf("\t\tData Semantics: %s\n",
+ dtrace_stability_name(p->dtp_arga.dtat_data));
+ oprintf("\t\tDependency Class: %s\n",
+ dtrace_class_name(p->dtp_arga.dtat_class));
+
+ oprintf("\n\tArgument Types\n");
+
+ for (i = 0; i < p->dtp_argc; i++) {
+ if (ctf_type_name(p->dtp_argv[i].dtt_ctfp,
+ p->dtp_argv[i].dtt_type, buf, sizeof (buf)) == NULL)
+ (void) strlcpy(buf, "(unknown)", sizeof (buf));
+ oprintf("\t\targs[%d]: %s\n", i, buf);
+ }
+
+ if (p->dtp_argc == 0)
+ oprintf("\t\tNone\n");
+
+ oprintf("\n");
+}
+
+/*ARGSUSED*/
+static int
+info_stmt(dtrace_hdl_t *dtp, dtrace_prog_t *pgp,
+ dtrace_stmtdesc_t *stp, dtrace_ecbdesc_t **last)
+{
+ dtrace_ecbdesc_t *edp = stp->dtsd_ecbdesc;
+ dtrace_probedesc_t *pdp = &edp->dted_probe;
+ dtrace_probeinfo_t p;
+
+ if (edp == *last)
+ return (0);
+
+ oprintf("\n%s:%s:%s:%s\n",
+ pdp->dtpd_provider, pdp->dtpd_mod, pdp->dtpd_func, pdp->dtpd_name);
+
+ if (dtrace_probe_info(dtp, pdp, &p) == 0)
+ print_probe_info(&p);
+
+ *last = edp;
+ return (0);
+}
+
+/*
+ * Execute the specified program by enabling the corresponding instrumentation.
+ * If -e has been specified, we get the program info but do not enable it. If
+ * -v has been specified, we print a stability report for the program.
+ */
+static void
+exec_prog(const dtrace_cmd_t *dcp)
+{
+ dtrace_ecbdesc_t *last = NULL;
+ dtrace_proginfo_t dpi;
+
+ if (!g_exec) {
+ dtrace_program_info(g_dtp, dcp->dc_prog, &dpi);
+ } else if (dtrace_program_exec(g_dtp, dcp->dc_prog, &dpi) == -1) {
+ dfatal("failed to enable '%s'", dcp->dc_name);
+ } else {
+ notice("%s '%s' matched %u probe%s\n",
+ dcp->dc_desc, dcp->dc_name,
+ dpi.dpi_matches, dpi.dpi_matches == 1 ? "" : "s");
+ }
+
+ if (g_verbose) {
+ oprintf("\nStability attributes for %s %s:\n",
+ dcp->dc_desc, dcp->dc_name);
+
+ oprintf("\n\tMinimum Probe Description Attributes\n");
+ oprintf("\t\tIdentifier Names: %s\n",
+ dtrace_stability_name(dpi.dpi_descattr.dtat_name));
+ oprintf("\t\tData Semantics: %s\n",
+ dtrace_stability_name(dpi.dpi_descattr.dtat_data));
+ oprintf("\t\tDependency Class: %s\n",
+ dtrace_class_name(dpi.dpi_descattr.dtat_class));
+
+ oprintf("\n\tMinimum Statement Attributes\n");
+
+ oprintf("\t\tIdentifier Names: %s\n",
+ dtrace_stability_name(dpi.dpi_stmtattr.dtat_name));
+ oprintf("\t\tData Semantics: %s\n",
+ dtrace_stability_name(dpi.dpi_stmtattr.dtat_data));
+ oprintf("\t\tDependency Class: %s\n",
+ dtrace_class_name(dpi.dpi_stmtattr.dtat_class));
+
+ if (!g_exec) {
+ (void) dtrace_stmt_iter(g_dtp, dcp->dc_prog,
+ (dtrace_stmt_f *)info_stmt, &last);
+ } else
+ oprintf("\n");
+ }
+
+ g_total += dpi.dpi_matches;
+}
+
+/*
+ * Print out the specified DOF buffer as a set of ASCII bytes appropriate for
+ * storing in a driver.conf(4) file associated with the dtrace driver.
+ */
+static void
+anon_prog(const dtrace_cmd_t *dcp, dof_hdr_t *dof, int n)
+{
+ const uchar_t *p, *q;
+
+ if (dof == NULL)
+ dfatal("failed to create DOF image for '%s'", dcp->dc_name);
+
+ p = (uchar_t *)dof;
+ q = p + dof->dofh_loadsz;
+
+#if defined(sun)
+ oprintf("dof-data-%d=0x%x", n, *p++);
+
+ while (p < q)
+ oprintf(",0x%x", *p++);
+
+ oprintf(";\n");
+#else
+ /*
+ * On FreeBSD, the DOF data is handled as a kernel environment (kenv)
+ * string. We use two hex characters per DOF byte.
+ */
+ oprintf("dof-data-%d=%02x", n, *p++);
+
+ while (p < q)
+ oprintf("%02x", *p++);
+
+ oprintf("\n");
+#endif
+
+ dtrace_dof_destroy(g_dtp, dof);
+}
+
+/*
+ * Link the specified D program in DOF form into an ELF file for use in either
+ * helpers, userland provider definitions, or both. If -o was specified, that
+ * path is used as the output file name. If -o wasn't specified and the input
+ * program is from a script whose name is %.d, use basename(%.o) as the output
+ * file name. Otherwise we use "d.out" as the default output file name.
+ */
+static void
+link_prog(dtrace_cmd_t *dcp)
+{
+ char *p;
+
+ if (g_cmdc == 1 && g_ofile != NULL) {
+ (void) strlcpy(dcp->dc_ofile, g_ofile, sizeof (dcp->dc_ofile));
+ } else if ((p = strrchr(dcp->dc_arg, '.')) != NULL &&
+ strcmp(p, ".d") == 0) {
+ p[0] = '\0'; /* strip .d suffix */
+ (void) snprintf(dcp->dc_ofile, sizeof (dcp->dc_ofile),
+ "%s.o", basename(dcp->dc_arg));
+ } else if (g_cmdc > 1) {
+ (void) snprintf(dcp->dc_ofile, sizeof (dcp->dc_ofile),
+ "d.out.%td", dcp - g_cmdv);
+ } else {
+ (void) snprintf(dcp->dc_ofile, sizeof (dcp->dc_ofile),
+ "d.out");
+ }
+
+ if (dtrace_program_link(g_dtp, dcp->dc_prog, DTRACE_D_PROBES,
+ dcp->dc_ofile, g_objc, g_objv) != 0)
+ dfatal("failed to link %s %s", dcp->dc_desc, dcp->dc_name);
+}
+
+/*ARGSUSED*/
+static int
+list_probe(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp, void *arg)
+{
+ dtrace_probeinfo_t p;
+
+ oprintf("%5d %10s %17s %33s %s\n", pdp->dtpd_id,
+ pdp->dtpd_provider, pdp->dtpd_mod, pdp->dtpd_func, pdp->dtpd_name);
+
+ if (g_verbose && dtrace_probe_info(dtp, pdp, &p) == 0)
+ print_probe_info(&p);
+
+ return (0);
+}
+
+/*ARGSUSED*/
+static int
+list_stmt(dtrace_hdl_t *dtp, dtrace_prog_t *pgp,
+ dtrace_stmtdesc_t *stp, dtrace_ecbdesc_t **last)
+{
+ dtrace_ecbdesc_t *edp = stp->dtsd_ecbdesc;
+
+ if (edp == *last)
+ return (0);
+
+ if (dtrace_probe_iter(g_dtp, &edp->dted_probe, list_probe, NULL) != 0) {
+ error("failed to match %s:%s:%s:%s: %s\n",
+ edp->dted_probe.dtpd_provider, edp->dted_probe.dtpd_mod,
+ edp->dted_probe.dtpd_func, edp->dted_probe.dtpd_name,
+ dtrace_errmsg(dtp, dtrace_errno(dtp)));
+ }
+
+ *last = edp;
+ return (0);
+}
+
+/*
+ * List the probes corresponding to the specified program by iterating over
+ * each statement and then matching probes to the statement probe descriptions.
+ */
+static void
+list_prog(const dtrace_cmd_t *dcp)
+{
+ dtrace_ecbdesc_t *last = NULL;
+
+ (void) dtrace_stmt_iter(g_dtp, dcp->dc_prog,
+ (dtrace_stmt_f *)list_stmt, &last);
+}
+
+static void
+compile_file(dtrace_cmd_t *dcp)
+{
+ char *arg0;
+ FILE *fp;
+
+ if ((fp = fopen(dcp->dc_arg, "r")) == NULL)
+ fatal("failed to open %s", dcp->dc_arg);
+
+ arg0 = g_argv[0];
+ g_argv[0] = dcp->dc_arg;
+
+ if ((dcp->dc_prog = dtrace_program_fcompile(g_dtp, fp,
+ g_cflags, g_argc, g_argv)) == NULL)
+ dfatal("failed to compile script %s", dcp->dc_arg);
+
+ g_argv[0] = arg0;
+ (void) fclose(fp);
+
+ dcp->dc_desc = "script";
+ dcp->dc_name = dcp->dc_arg;
+}
+
+static void
+compile_str(dtrace_cmd_t *dcp)
+{
+ char *p;
+
+ if ((dcp->dc_prog = dtrace_program_strcompile(g_dtp, dcp->dc_arg,
+ dcp->dc_spec, g_cflags | DTRACE_C_PSPEC, g_argc, g_argv)) == NULL)
+ dfatal("invalid probe specifier %s", dcp->dc_arg);
+
+ if ((p = strpbrk(dcp->dc_arg, "{/;")) != NULL)
+ *p = '\0'; /* crop name for reporting */
+
+ dcp->dc_desc = "description";
+ dcp->dc_name = dcp->dc_arg;
+}
+
+/*ARGSUSED*/
+static void
+prochandler(struct ps_prochandle *P, const char *msg, void *arg)
+{
+#if defined(sun)
+ const psinfo_t *prp = Ppsinfo(P);
+ int pid = Pstatus(P)->pr_pid;
+ char name[SIG2STR_MAX];
+#else
+ int wstatus = proc_getwstat(P);
+ int pid = proc_getpid(P);
+#endif
+
+ if (msg != NULL) {
+ notice("pid %d: %s\n", pid, msg);
+ return;
+ }
+
+#if defined(sun)
+ switch (Pstate(P)) {
+#else
+ switch (proc_state(P)) {
+#endif
+ case PS_UNDEAD:
+#if defined(sun)
+ /*
+ * Ideally we would like to always report pr_wstat here, but it
+ * isn't possible given current /proc semantics. If we grabbed
+ * the process, Ppsinfo() will either fail or return a zeroed
+ * psinfo_t depending on how far the parent is in reaping it.
+ * When /proc provides a stable pr_wstat in the status file,
+ * this code can be improved by examining this new pr_wstat.
+ */
+ if (prp != NULL && WIFSIGNALED(prp->pr_wstat)) {
+ notice("pid %d terminated by %s\n", pid,
+ proc_signame(WTERMSIG(prp->pr_wstat),
+ name, sizeof (name)));
+#else
+ if (WIFSIGNALED(wstatus)) {
+ notice("pid %d terminated by %d\n", pid,
+ WTERMSIG(wstatus));
+#endif
+#if defined(sun)
+ } else if (prp != NULL && WEXITSTATUS(prp->pr_wstat) != 0) {
+ notice("pid %d exited with status %d\n",
+ pid, WEXITSTATUS(prp->pr_wstat));
+#else
+ } else if (WEXITSTATUS(wstatus) != 0) {
+ notice("pid %d exited with status %d\n",
+ pid, WEXITSTATUS(wstatus));
+#endif
+ } else {
+ notice("pid %d has exited\n", pid);
+ }
+ g_pslive--;
+ break;
+
+ case PS_LOST:
+ notice("pid %d exec'd a set-id or unobservable program\n", pid);
+ g_pslive--;
+ break;
+ }
+}
+
+/*ARGSUSED*/
+static int
+errhandler(const dtrace_errdata_t *data, void *arg)
+{
+ error(data->dteda_msg);
+ return (DTRACE_HANDLE_OK);
+}
+
+/*ARGSUSED*/
+static int
+drophandler(const dtrace_dropdata_t *data, void *arg)
+{
+ error(data->dtdda_msg);
+ return (DTRACE_HANDLE_OK);
+}
+
+/*ARGSUSED*/
+static int
+setopthandler(const dtrace_setoptdata_t *data, void *arg)
+{
+ if (strcmp(data->dtsda_option, "quiet") == 0)
+ g_quiet = data->dtsda_newval != DTRACEOPT_UNSET;
+
+ if (strcmp(data->dtsda_option, "flowindent") == 0)
+ g_flowindent = data->dtsda_newval != DTRACEOPT_UNSET;
+
+ return (DTRACE_HANDLE_OK);
+}
+
+#define BUFDUMPHDR(hdr) \
+ (void) printf("%s: %s%s\n", g_pname, hdr, strlen(hdr) > 0 ? ":" : "");
+
+#define BUFDUMPSTR(ptr, field) \
+ (void) printf("%s: %20s => ", g_pname, #field); \
+ if ((ptr)->field != NULL) { \
+ const char *c = (ptr)->field; \
+ (void) printf("\""); \
+ do { \
+ if (*c == '\n') { \
+ (void) printf("\\n"); \
+ continue; \
+ } \
+ \
+ (void) printf("%c", *c); \
+ } while (*c++ != '\0'); \
+ (void) printf("\"\n"); \
+ } else { \
+ (void) printf("<NULL>\n"); \
+ }
+
+#define BUFDUMPASSTR(ptr, field, str) \
+ (void) printf("%s: %20s => %s\n", g_pname, #field, str);
+
+#define BUFDUMP(ptr, field) \
+ (void) printf("%s: %20s => %lld\n", g_pname, #field, \
+ (long long)(ptr)->field);
+
+#define BUFDUMPPTR(ptr, field) \
+ (void) printf("%s: %20s => %s\n", g_pname, #field, \
+ (ptr)->field != NULL ? "<non-NULL>" : "<NULL>");
+
+/*ARGSUSED*/
+static int
+bufhandler(const dtrace_bufdata_t *bufdata, void *arg)
+{
+ const dtrace_aggdata_t *agg = bufdata->dtbda_aggdata;
+ const dtrace_recdesc_t *rec = bufdata->dtbda_recdesc;
+ const dtrace_probedesc_t *pd;
+ uint32_t flags = bufdata->dtbda_flags;
+ char buf[512], *c = buf, *end = c + sizeof (buf);
+ int i, printed;
+
+ struct {
+ const char *name;
+ uint32_t value;
+ } flagnames[] = {
+ { "AGGVAL", DTRACE_BUFDATA_AGGVAL },
+ { "AGGKEY", DTRACE_BUFDATA_AGGKEY },
+ { "AGGFORMAT", DTRACE_BUFDATA_AGGFORMAT },
+ { "AGGLAST", DTRACE_BUFDATA_AGGLAST },
+ { "???", UINT32_MAX },
+ { NULL }
+ };
+
+ if (bufdata->dtbda_probe != NULL) {
+ pd = bufdata->dtbda_probe->dtpda_pdesc;
+ } else if (agg != NULL) {
+ pd = agg->dtada_pdesc;
+ } else {
+ pd = NULL;
+ }
+
+ BUFDUMPHDR(">>> Called buffer handler");
+ BUFDUMPHDR("");
+
+ BUFDUMPHDR(" dtrace_bufdata");
+ BUFDUMPSTR(bufdata, dtbda_buffered);
+ BUFDUMPPTR(bufdata, dtbda_probe);
+ BUFDUMPPTR(bufdata, dtbda_aggdata);
+ BUFDUMPPTR(bufdata, dtbda_recdesc);
+
+ (void) snprintf(c, end - c, "0x%x ", bufdata->dtbda_flags);
+ c += strlen(c);
+
+ for (i = 0, printed = 0; flagnames[i].name != NULL; i++) {
+ if (!(flags & flagnames[i].value))
+ continue;
+
+ (void) snprintf(c, end - c,
+ "%s%s", printed++ ? " | " : "(", flagnames[i].name);
+ c += strlen(c);
+ flags &= ~flagnames[i].value;
+ }
+
+ if (printed)
+ (void) snprintf(c, end - c, ")");
+
+ BUFDUMPASSTR(bufdata, dtbda_flags, buf);
+ BUFDUMPHDR("");
+
+ if (pd != NULL) {
+ BUFDUMPHDR(" dtrace_probedesc");
+ BUFDUMPSTR(pd, dtpd_provider);
+ BUFDUMPSTR(pd, dtpd_mod);
+ BUFDUMPSTR(pd, dtpd_func);
+ BUFDUMPSTR(pd, dtpd_name);
+ BUFDUMPHDR("");
+ }
+
+ if (rec != NULL) {
+ BUFDUMPHDR(" dtrace_recdesc");
+ BUFDUMP(rec, dtrd_action);
+ BUFDUMP(rec, dtrd_size);
+
+ if (agg != NULL) {
+ uint8_t *data;
+ int lim = rec->dtrd_size;
+
+ (void) sprintf(buf, "%d (data: ", rec->dtrd_offset);
+ c = buf + strlen(buf);
+
+ if (lim > sizeof (uint64_t))
+ lim = sizeof (uint64_t);
+
+ data = (uint8_t *)agg->dtada_data + rec->dtrd_offset;
+
+ for (i = 0; i < lim; i++) {
+ (void) snprintf(c, end - c, "%s%02x",
+ i == 0 ? "" : " ", *data++);
+ c += strlen(c);
+ }
+
+ (void) snprintf(c, end - c,
+ "%s)", lim < rec->dtrd_size ? " ..." : "");
+ BUFDUMPASSTR(rec, dtrd_offset, buf);
+ } else {
+ BUFDUMP(rec, dtrd_offset);
+ }
+
+ BUFDUMPHDR("");
+ }
+
+ if (agg != NULL) {
+ dtrace_aggdesc_t *desc = agg->dtada_desc;
+
+ BUFDUMPHDR(" dtrace_aggdesc");
+ BUFDUMPSTR(desc, dtagd_name);
+ BUFDUMP(desc, dtagd_varid);
+ BUFDUMP(desc, dtagd_id);
+ BUFDUMP(desc, dtagd_nrecs);
+ BUFDUMPHDR("");
+ }
+
+ return (DTRACE_HANDLE_OK);
+}
+
+/*ARGSUSED*/
+static int
+chewrec(const dtrace_probedata_t *data, const dtrace_recdesc_t *rec, void *arg)
+{
+ dtrace_actkind_t act;
+ uintptr_t addr;
+
+ if (rec == NULL) {
+ /*
+ * We have processed the final record; output the newline if
+ * we're not in quiet mode.
+ */
+ if (!g_quiet)
+ oprintf("\n");
+
+ return (DTRACE_CONSUME_NEXT);
+ }
+
+ act = rec->dtrd_action;
+ addr = (uintptr_t)data->dtpda_data;
+
+ if (act == DTRACEACT_EXIT) {
+ g_status = *((uint32_t *)addr);
+ return (DTRACE_CONSUME_NEXT);
+ }
+
+ return (DTRACE_CONSUME_THIS);
+}
+
+/*ARGSUSED*/
+static int
+chew(const dtrace_probedata_t *data, void *arg)
+{
+ dtrace_probedesc_t *pd = data->dtpda_pdesc;
+ processorid_t cpu = data->dtpda_cpu;
+ static int heading;
+
+ if (g_impatient) {
+ g_newline = 0;
+ return (DTRACE_CONSUME_ABORT);
+ }
+
+ if (heading == 0) {
+ if (!g_flowindent) {
+ if (!g_quiet) {
+ oprintf("%3s %6s %32s\n",
+ "CPU", "ID", "FUNCTION:NAME");
+ }
+ } else {
+ oprintf("%3s %-41s\n", "CPU", "FUNCTION");
+ }
+ heading = 1;
+ }
+
+ if (!g_flowindent) {
+ if (!g_quiet) {
+ char name[DTRACE_FUNCNAMELEN + DTRACE_NAMELEN + 2];
+
+ (void) snprintf(name, sizeof (name), "%s:%s",
+ pd->dtpd_func, pd->dtpd_name);
+
+ oprintf("%3d %6d %32s ", cpu, pd->dtpd_id, name);
+ }
+ } else {
+ int indent = data->dtpda_indent;
+ char *name;
+ size_t len;
+
+ if (data->dtpda_flow == DTRACEFLOW_NONE) {
+ len = indent + DTRACE_FUNCNAMELEN + DTRACE_NAMELEN + 5;
+ name = alloca(len);
+ (void) snprintf(name, len, "%*s%s%s:%s", indent, "",
+ data->dtpda_prefix, pd->dtpd_func,
+ pd->dtpd_name);
+ } else {
+ len = indent + DTRACE_FUNCNAMELEN + 5;
+ name = alloca(len);
+ (void) snprintf(name, len, "%*s%s%s", indent, "",
+ data->dtpda_prefix, pd->dtpd_func);
+ }
+
+ oprintf("%3d %-41s ", cpu, name);
+ }
+
+ return (DTRACE_CONSUME_THIS);
+}
+
+static void
+go(void)
+{
+ int i;
+
+ struct {
+ char *name;
+ char *optname;
+ dtrace_optval_t val;
+ } bufs[] = {
+ { "buffer size", "bufsize" },
+ { "aggregation size", "aggsize" },
+ { "speculation size", "specsize" },
+ { "dynamic variable size", "dynvarsize" },
+ { NULL }
+ }, rates[] = {
+ { "cleaning rate", "cleanrate" },
+ { "status rate", "statusrate" },
+ { NULL }
+ };
+
+ for (i = 0; bufs[i].name != NULL; i++) {
+ if (dtrace_getopt(g_dtp, bufs[i].optname, &bufs[i].val) == -1)
+ fatal("couldn't get option %s", bufs[i].optname);
+ }
+
+ for (i = 0; rates[i].name != NULL; i++) {
+ if (dtrace_getopt(g_dtp, rates[i].optname, &rates[i].val) == -1)
+ fatal("couldn't get option %s", rates[i].optname);
+ }
+
+ if (dtrace_go(g_dtp) == -1)
+ dfatal("could not enable tracing");
+
+ for (i = 0; bufs[i].name != NULL; i++) {
+ dtrace_optval_t j = 0, mul = 10;
+ dtrace_optval_t nsize;
+
+ if (bufs[i].val == DTRACEOPT_UNSET)
+ continue;
+
+ (void) dtrace_getopt(g_dtp, bufs[i].optname, &nsize);
+
+ if (nsize == DTRACEOPT_UNSET || nsize == 0)
+ continue;
+
+ if (nsize >= bufs[i].val - sizeof (uint64_t))
+ continue;
+
+ for (; (INT64_C(1) << mul) <= nsize; j++, mul += 10)
+ continue;
+
+ if (!(nsize & ((INT64_C(1) << (mul - 10)) - 1))) {
+ error("%s lowered to %lld%c\n", bufs[i].name,
+ (long long)nsize >> (mul - 10), " kmgtpe"[j]);
+ } else {
+ error("%s lowered to %lld bytes\n", bufs[i].name,
+ (long long)nsize);
+ }
+ }
+
+ for (i = 0; rates[i].name != NULL; i++) {
+ dtrace_optval_t nval;
+ char *dir;
+
+ if (rates[i].val == DTRACEOPT_UNSET)
+ continue;
+
+ (void) dtrace_getopt(g_dtp, rates[i].optname, &nval);
+
+ if (nval == DTRACEOPT_UNSET || nval == 0)
+ continue;
+
+ if (rates[i].val == nval)
+ continue;
+
+ dir = nval > rates[i].val ? "reduced" : "increased";
+
+ if (nval <= NANOSEC && (NANOSEC % nval) == 0) {
+ error("%s %s to %lld hz\n", rates[i].name, dir,
+ (long long)NANOSEC / (long long)nval);
+ continue;
+ }
+
+ if ((nval % NANOSEC) == 0) {
+ error("%s %s to once every %lld seconds\n",
+ rates[i].name, dir,
+ (long long)nval / (long long)NANOSEC);
+ continue;
+ }
+
+ error("%s %s to once every %lld nanoseconds\n",
+ rates[i].name, dir, (long long)nval);
+ }
+}
+
+/*ARGSUSED*/
+static void
+intr(int signo)
+{
+ if (!g_intr)
+ g_newline = 1;
+
+ if (g_intr++)
+ g_impatient = 1;
+}
+
+int
+main(int argc, char *argv[])
+{
+ dtrace_bufdesc_t buf;
+ struct sigaction act, oact;
+ dtrace_status_t status[2];
+ dtrace_optval_t opt;
+ dtrace_cmd_t *dcp;
+
+ g_ofp = stdout;
+ int done = 0, mode = 0;
+ int err, i, c;
+ char *p, **v;
+ struct ps_prochandle *P;
+ pid_t pid;
+
+ g_pname = basename(argv[0]);
+
+ if (argc == 1)
+ return (usage(stderr));
+
+ if ((g_argv = malloc(sizeof (char *) * argc)) == NULL ||
+ (g_cmdv = malloc(sizeof (dtrace_cmd_t) * argc)) == NULL ||
+ (g_psv = malloc(sizeof (struct ps_prochandle *) * argc)) == NULL)
+ fatal("failed to allocate memory for arguments");
+
+ g_argv[g_argc++] = argv[0]; /* propagate argv[0] to D as $0/$$0 */
+ argv[0] = g_pname; /* rewrite argv[0] for getopt errors */
+
+ bzero(status, sizeof (status));
+ bzero(&buf, sizeof (buf));
+
+ /*
+ * Make an initial pass through argv[] processing any arguments that
+ * affect our behavior mode (g_mode) and flags used for dtrace_open().
+ * We also accumulate arguments that are not affiliated with getopt
+ * options into g_argv[], and abort if any invalid options are found.
+ */
+ for (optind = 1; optind < argc; optind++) {
+ while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != -1) {
+ switch (c) {
+ case '3':
+ if (strcmp(optarg, "2") != 0) {
+ (void) fprintf(stderr,
+ "%s: illegal option -- 3%s\n",
+ argv[0], optarg);
+ return (usage(stderr));
+ }
+ g_oflags &= ~DTRACE_O_LP64;
+ g_oflags |= DTRACE_O_ILP32;
+ break;
+
+ case '6':
+ if (strcmp(optarg, "4") != 0) {
+ (void) fprintf(stderr,
+ "%s: illegal option -- 6%s\n",
+ argv[0], optarg);
+ return (usage(stderr));
+ }
+ g_oflags &= ~DTRACE_O_ILP32;
+ g_oflags |= DTRACE_O_LP64;
+ break;
+
+ case 'a':
+ g_grabanon++; /* also checked in pass 2 below */
+ break;
+
+ case 'A':
+ g_mode = DMODE_ANON;
+ g_exec = 0;
+ mode++;
+ break;
+
+ case 'e':
+ g_exec = 0;
+ done = 1;
+ break;
+
+ case 'h':
+ g_mode = DMODE_HEADER;
+ g_oflags |= DTRACE_O_NODEV;
+ g_cflags |= DTRACE_C_ZDEFS; /* -h implies -Z */
+ g_exec = 0;
+ mode++;
+ break;
+
+ case 'G':
+ g_mode = DMODE_LINK;
+ g_oflags |= DTRACE_O_NODEV;
+ g_cflags |= DTRACE_C_ZDEFS; /* -G implies -Z */
+ g_exec = 0;
+ mode++;
+ break;
+
+ case 'l':
+ g_mode = DMODE_LIST;
+ g_cflags |= DTRACE_C_ZDEFS; /* -l implies -Z */
+ mode++;
+ break;
+
+ case 'V':
+ g_mode = DMODE_VERS;
+ mode++;
+ break;
+
+ default:
+ if (strchr(DTRACE_OPTSTR, c) == NULL)
+ return (usage(stderr));
+ }
+ }
+
+ if (optind < argc)
+ g_argv[g_argc++] = argv[optind];
+ }
+
+ if (mode > 1) {
+ (void) fprintf(stderr, "%s: only one of the [-AGhlV] options "
+ "can be specified at a time\n", g_pname);
+ return (E_USAGE);
+ }
+
+ if (g_mode == DMODE_VERS)
+ return (printf("%s: %s\n", g_pname, _dtrace_version) <= 0);
+
+ /*
+ * If we're in linker mode and the data model hasn't been specified,
+ * we try to guess the appropriate setting by examining the object
+ * files. We ignore certain errors since we'll catch them later when
+ * we actually process the object files.
+ */
+ if (g_mode == DMODE_LINK &&
+ (g_oflags & (DTRACE_O_ILP32 | DTRACE_O_LP64)) == 0 &&
+ elf_version(EV_CURRENT) != EV_NONE) {
+ int fd;
+ Elf *elf;
+ GElf_Ehdr ehdr;
+
+ for (i = 1; i < g_argc; i++) {
+ if ((fd = open64(g_argv[i], O_RDONLY)) == -1)
+ break;
+
+ if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) {
+ (void) close(fd);
+ break;
+ }
+
+ if (elf_kind(elf) != ELF_K_ELF ||
+ gelf_getehdr(elf, &ehdr) == NULL) {
+ (void) close(fd);
+ (void) elf_end(elf);
+ break;
+ }
+
+ (void) close(fd);
+ (void) elf_end(elf);
+
+ if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) {
+ if (g_oflags & DTRACE_O_ILP32) {
+ fatal("can't mix 32-bit and 64-bit "
+ "object files\n");
+ }
+ g_oflags |= DTRACE_O_LP64;
+ } else if (ehdr.e_ident[EI_CLASS] == ELFCLASS32) {
+ if (g_oflags & DTRACE_O_LP64) {
+ fatal("can't mix 32-bit and 64-bit "
+ "object files\n");
+ }
+ g_oflags |= DTRACE_O_ILP32;
+ } else {
+ break;
+ }
+ }
+ }
+
+ /*
+ * Open libdtrace. If we are not actually going to be enabling any
+ * instrumentation attempt to reopen libdtrace using DTRACE_O_NODEV.
+ */
+ while ((g_dtp = dtrace_open(DTRACE_VERSION, g_oflags, &err)) == NULL) {
+ if (!(g_oflags & DTRACE_O_NODEV) && !g_exec && !g_grabanon) {
+ g_oflags |= DTRACE_O_NODEV;
+ continue;
+ }
+
+ fatal("failed to initialize dtrace: %s\n",
+ dtrace_errmsg(NULL, err));
+ }
+
+#if defined(__i386__)
+ /* XXX The 32-bit seems to need more buffer space by default -sson */
+ (void) dtrace_setopt(g_dtp, "bufsize", "12m");
+ (void) dtrace_setopt(g_dtp, "aggsize", "12m");
+#else
+ (void) dtrace_setopt(g_dtp, "bufsize", "4m");
+ (void) dtrace_setopt(g_dtp, "aggsize", "4m");
+#endif
+ (void) dtrace_setopt(g_dtp, "temporal", "yes");
+
+ /*
+ * If -G is specified, enable -xlink=dynamic and -xunodefs to permit
+ * references to undefined symbols to remain as unresolved relocations.
+ * If -A is specified, enable -xlink=primary to permit static linking
+ * only to kernel symbols that are defined in a primary kernel module.
+ */
+ if (g_mode == DMODE_LINK) {
+ (void) dtrace_setopt(g_dtp, "linkmode", "dynamic");
+ (void) dtrace_setopt(g_dtp, "unodefs", NULL);
+
+ /*
+ * Use the remaining arguments as the list of object files
+ * when in linker mode.
+ */
+ g_objc = g_argc - 1;
+ g_objv = g_argv + 1;
+
+ /*
+ * We still use g_argv[0], the name of the executable.
+ */
+ g_argc = 1;
+ } else if (g_mode == DMODE_ANON)
+ (void) dtrace_setopt(g_dtp, "linkmode", "primary");
+
+ /*
+ * Now that we have libdtrace open, make a second pass through argv[]
+ * to perform any dtrace_setopt() calls and change any compiler flags.
+ * We also accumulate any program specifications into our g_cmdv[] at
+ * this time; these will compiled as part of the fourth processing pass.
+ */
+ for (optind = 1; optind < argc; optind++) {
+ while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != -1) {
+ switch (c) {
+ case 'a':
+ if (dtrace_setopt(g_dtp, "grabanon", 0) != 0)
+ dfatal("failed to set -a");
+ break;
+
+ case 'b':
+ if (dtrace_setopt(g_dtp,
+ "bufsize", optarg) != 0)
+ dfatal("failed to set -b %s", optarg);
+ break;
+
+ case 'B':
+ g_ofp = NULL;
+ break;
+
+ case 'C':
+ g_cflags |= DTRACE_C_CPP;
+ break;
+
+ case 'D':
+ if (dtrace_setopt(g_dtp, "define", optarg) != 0)
+ dfatal("failed to set -D %s", optarg);
+ break;
+
+ case 'f':
+ dcp = &g_cmdv[g_cmdc++];
+ dcp->dc_func = compile_str;
+ dcp->dc_spec = DTRACE_PROBESPEC_FUNC;
+ dcp->dc_arg = optarg;
+ break;
+
+ case 'F':
+ if (dtrace_setopt(g_dtp, "flowindent", 0) != 0)
+ dfatal("failed to set -F");
+ break;
+
+ case 'H':
+ if (dtrace_setopt(g_dtp, "cpphdrs", 0) != 0)
+ dfatal("failed to set -H");
+ break;
+
+ case 'i':
+ dcp = &g_cmdv[g_cmdc++];
+ dcp->dc_func = compile_str;
+ dcp->dc_spec = DTRACE_PROBESPEC_NAME;
+ dcp->dc_arg = optarg;
+ break;
+
+ case 'I':
+ if (dtrace_setopt(g_dtp, "incdir", optarg) != 0)
+ dfatal("failed to set -I %s", optarg);
+ break;
+
+ case 'L':
+ if (dtrace_setopt(g_dtp, "libdir", optarg) != 0)
+ dfatal("failed to set -L %s", optarg);
+ break;
+
+ case 'm':
+ dcp = &g_cmdv[g_cmdc++];
+ dcp->dc_func = compile_str;
+ dcp->dc_spec = DTRACE_PROBESPEC_MOD;
+ dcp->dc_arg = optarg;
+ break;
+
+ case 'n':
+ dcp = &g_cmdv[g_cmdc++];
+ dcp->dc_func = compile_str;
+ dcp->dc_spec = DTRACE_PROBESPEC_NAME;
+ dcp->dc_arg = optarg;
+ break;
+
+ case 'P':
+ dcp = &g_cmdv[g_cmdc++];
+ dcp->dc_func = compile_str;
+ dcp->dc_spec = DTRACE_PROBESPEC_PROVIDER;
+ dcp->dc_arg = optarg;
+ break;
+
+ case 'q':
+ if (dtrace_setopt(g_dtp, "quiet", 0) != 0)
+ dfatal("failed to set -q");
+ break;
+
+ case 'o':
+ g_ofile = optarg;
+ break;
+
+ case 's':
+ dcp = &g_cmdv[g_cmdc++];
+ dcp->dc_func = compile_file;
+ dcp->dc_spec = DTRACE_PROBESPEC_NONE;
+ dcp->dc_arg = optarg;
+ break;
+
+ case 'S':
+ g_cflags |= DTRACE_C_DIFV;
+ break;
+
+ case 'U':
+ if (dtrace_setopt(g_dtp, "undef", optarg) != 0)
+ dfatal("failed to set -U %s", optarg);
+ break;
+
+ case 'v':
+ g_verbose++;
+ break;
+
+ case 'w':
+ if (dtrace_setopt(g_dtp, "destructive", 0) != 0)
+ dfatal("failed to set -w");
+ break;
+
+ case 'x':
+ if ((p = strchr(optarg, '=')) != NULL)
+ *p++ = '\0';
+
+ if (dtrace_setopt(g_dtp, optarg, p) != 0)
+ dfatal("failed to set -x %s", optarg);
+ break;
+
+ case 'X':
+ if (dtrace_setopt(g_dtp, "stdc", optarg) != 0)
+ dfatal("failed to set -X %s", optarg);
+ break;
+
+ case 'Z':
+ g_cflags |= DTRACE_C_ZDEFS;
+ break;
+
+ default:
+ if (strchr(DTRACE_OPTSTR, c) == NULL)
+ return (usage(stderr));
+ }
+ }
+ }
+
+ if (g_ofp == NULL && g_mode != DMODE_EXEC) {
+ (void) fprintf(stderr, "%s: -B not valid in combination"
+ " with [-AGl] options\n", g_pname);
+ return (E_USAGE);
+ }
+
+ if (g_ofp == NULL && g_ofile != NULL) {
+ (void) fprintf(stderr, "%s: -B not valid in combination"
+ " with -o option\n", g_pname);
+ return (E_USAGE);
+ }
+
+ /*
+ * In our third pass we handle any command-line options related to
+ * grabbing or creating victim processes. The behavior of these calls
+ * may been affected by any library options set by the second pass.
+ */
+ for (optind = 1; optind < argc; optind++) {
+ while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != -1) {
+ switch (c) {
+ case 'c':
+ if ((v = make_argv(optarg)) == NULL)
+ fatal("failed to allocate memory");
+
+ P = dtrace_proc_create(g_dtp, v[0], v, NULL, NULL);
+ if (P == NULL)
+ dfatal(NULL); /* dtrace_errmsg() only */
+
+ g_psv[g_psc++] = P;
+ free(v);
+ break;
+
+ case 'p':
+ errno = 0;
+ pid = strtol(optarg, &p, 10);
+
+ if (errno != 0 || p == optarg || p[0] != '\0')
+ fatal("invalid pid: %s\n", optarg);
+
+ P = dtrace_proc_grab(g_dtp, pid, 0);
+ if (P == NULL)
+ dfatal(NULL); /* dtrace_errmsg() only */
+
+ g_psv[g_psc++] = P;
+ break;
+ }
+ }
+ }
+
+ /*
+ * In our fourth pass we finish g_cmdv[] by calling dc_func to convert
+ * each string or file specification into a compiled program structure.
+ */
+ for (i = 0; i < g_cmdc; i++)
+ g_cmdv[i].dc_func(&g_cmdv[i]);
+
+ if (g_mode != DMODE_LIST) {
+ if (dtrace_handle_err(g_dtp, &errhandler, NULL) == -1)
+ dfatal("failed to establish error handler");
+
+ if (dtrace_handle_drop(g_dtp, &drophandler, NULL) == -1)
+ dfatal("failed to establish drop handler");
+
+ if (dtrace_handle_proc(g_dtp, &prochandler, NULL) == -1)
+ dfatal("failed to establish proc handler");
+
+ if (dtrace_handle_setopt(g_dtp, &setopthandler, NULL) == -1)
+ dfatal("failed to establish setopt handler");
+
+ if (g_ofp == NULL &&
+ dtrace_handle_buffered(g_dtp, &bufhandler, NULL) == -1)
+ dfatal("failed to establish buffered handler");
+ }
+
+ (void) dtrace_getopt(g_dtp, "flowindent", &opt);
+ g_flowindent = opt != DTRACEOPT_UNSET;
+
+ (void) dtrace_getopt(g_dtp, "grabanon", &opt);
+ g_grabanon = opt != DTRACEOPT_UNSET;
+
+ (void) dtrace_getopt(g_dtp, "quiet", &opt);
+ g_quiet = opt != DTRACEOPT_UNSET;
+
+ /*
+ * Now make a fifth and final pass over the options that have been
+ * turned into programs and saved in g_cmdv[], performing any mode-
+ * specific processing. If g_mode is DMODE_EXEC, we will break out
+ * of the switch() and continue on to the data processing loop. For
+ * other modes, we will exit dtrace once mode-specific work is done.
+ */
+ switch (g_mode) {
+ case DMODE_EXEC:
+ if (g_ofile != NULL && (g_ofp = fopen(g_ofile, "a")) == NULL)
+ fatal("failed to open output file '%s'", g_ofile);
+
+ for (i = 0; i < g_cmdc; i++)
+ exec_prog(&g_cmdv[i]);
+
+ if (done && !g_grabanon) {
+ dtrace_close(g_dtp);
+ return (g_status);
+ }
+ break;
+
+ case DMODE_ANON:
+ if (g_ofile == NULL)
+#if defined(sun)
+ g_ofile = "/kernel/drv/dtrace.conf";
+#else
+ /*
+ * On FreeBSD, anonymous DOF data is written to
+ * the DTrace DOF file that the boot loader will
+ * read if booting with the DTrace option.
+ */
+ g_ofile = "/boot/dtrace.dof";
+#endif
+
+ dof_prune(g_ofile); /* strip out any old DOF directives */
+#if defined(sun)
+ etcsystem_prune(); /* string out any forceload directives */
+#endif
+
+ if (g_cmdc == 0) {
+ dtrace_close(g_dtp);
+ return (g_status);
+ }
+
+ if ((g_ofp = fopen(g_ofile, "a")) == NULL)
+ fatal("failed to open output file '%s'", g_ofile);
+
+ for (i = 0; i < g_cmdc; i++) {
+ anon_prog(&g_cmdv[i],
+ dtrace_dof_create(g_dtp, g_cmdv[i].dc_prog, 0), i);
+ }
+
+ /*
+ * Dump out the DOF corresponding to the error handler and the
+ * current options as the final DOF property in the .conf file.
+ */
+ anon_prog(NULL, dtrace_geterr_dof(g_dtp), i++);
+ anon_prog(NULL, dtrace_getopt_dof(g_dtp), i++);
+
+ if (fclose(g_ofp) == EOF)
+ fatal("failed to close output file '%s'", g_ofile);
+
+ /*
+ * These messages would use notice() rather than error(), but
+ * we don't want them suppressed when -A is run on a D program
+ * that itself contains a #pragma D option quiet.
+ */
+ error("saved anonymous enabling in %s\n", g_ofile);
+#if defined(sun)
+ etcsystem_add();
+ error("run update_drv(1M) or reboot to enable changes\n");
+#endif
+
+ dtrace_close(g_dtp);
+ return (g_status);
+
+ case DMODE_LINK:
+ if (g_cmdc == 0) {
+ (void) fprintf(stderr, "%s: -G requires one or more "
+ "scripts or enabling options\n", g_pname);
+ dtrace_close(g_dtp);
+ return (E_USAGE);
+ }
+
+ for (i = 0; i < g_cmdc; i++)
+ link_prog(&g_cmdv[i]);
+
+ if (g_cmdc > 1 && g_ofile != NULL) {
+ char **objv = alloca(g_cmdc * sizeof (char *));
+
+ for (i = 0; i < g_cmdc; i++)
+ objv[i] = g_cmdv[i].dc_ofile;
+
+ if (dtrace_program_link(g_dtp, NULL, DTRACE_D_PROBES,
+ g_ofile, g_cmdc, objv) != 0)
+ dfatal(NULL); /* dtrace_errmsg() only */
+ }
+
+ dtrace_close(g_dtp);
+ return (g_status);
+
+ case DMODE_LIST:
+ if (g_ofile != NULL && (g_ofp = fopen(g_ofile, "a")) == NULL)
+ fatal("failed to open output file '%s'", g_ofile);
+
+ oprintf("%5s %10s %17s %33s %s\n",
+ "ID", "PROVIDER", "MODULE", "FUNCTION", "NAME");
+
+ for (i = 0; i < g_cmdc; i++)
+ list_prog(&g_cmdv[i]);
+
+ if (g_cmdc == 0)
+ (void) dtrace_probe_iter(g_dtp, NULL, list_probe, NULL);
+
+ dtrace_close(g_dtp);
+ return (g_status);
+
+ case DMODE_HEADER:
+ if (g_cmdc == 0) {
+ (void) fprintf(stderr, "%s: -h requires one or more "
+ "scripts or enabling options\n", g_pname);
+ dtrace_close(g_dtp);
+ return (E_USAGE);
+ }
+
+ if (g_ofile == NULL) {
+ char *p;
+
+ if (g_cmdc > 1) {
+ (void) fprintf(stderr, "%s: -h requires an "
+ "output file if multiple scripts are "
+ "specified\n", g_pname);
+ dtrace_close(g_dtp);
+ return (E_USAGE);
+ }
+
+ if ((p = strrchr(g_cmdv[0].dc_arg, '.')) == NULL ||
+ strcmp(p, ".d") != 0) {
+ (void) fprintf(stderr, "%s: -h requires an "
+ "output file if no scripts are "
+ "specified\n", g_pname);
+ dtrace_close(g_dtp);
+ return (E_USAGE);
+ }
+
+ p[0] = '\0'; /* strip .d suffix */
+ g_ofile = p = g_cmdv[0].dc_ofile;
+ (void) snprintf(p, sizeof (g_cmdv[0].dc_ofile),
+ "%s.h", basename(g_cmdv[0].dc_arg));
+ }
+
+ if ((g_ofp = fopen(g_ofile, "w")) == NULL)
+ fatal("failed to open header file '%s'", g_ofile);
+
+ oprintf("/*\n * Generated by dtrace(1M).\n */\n\n");
+
+ if (dtrace_program_header(g_dtp, g_ofp, g_ofile) != 0 ||
+ fclose(g_ofp) == EOF)
+ dfatal("failed to create header file %s", g_ofile);
+
+ dtrace_close(g_dtp);
+ return (g_status);
+ }
+
+ /*
+ * If -a and -Z were not specified and no probes have been matched, no
+ * probe criteria was specified on the command line and we abort.
+ */
+ if (g_total == 0 && !g_grabanon && !(g_cflags & DTRACE_C_ZDEFS))
+ dfatal("no probes %s\n", g_cmdc ? "matched" : "specified");
+
+ /*
+ * Start tracing. Once we dtrace_go(), reload any options that affect
+ * our globals in case consuming anonymous state has changed them.
+ */
+ go();
+
+ (void) dtrace_getopt(g_dtp, "flowindent", &opt);
+ g_flowindent = opt != DTRACEOPT_UNSET;
+
+ (void) dtrace_getopt(g_dtp, "grabanon", &opt);
+ g_grabanon = opt != DTRACEOPT_UNSET;
+
+ (void) dtrace_getopt(g_dtp, "quiet", &opt);
+ g_quiet = opt != DTRACEOPT_UNSET;
+
+ (void) dtrace_getopt(g_dtp, "destructive", &opt);
+ if (opt != DTRACEOPT_UNSET)
+ notice("allowing destructive actions\n");
+
+ (void) sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ act.sa_handler = intr;
+
+ if (sigaction(SIGINT, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
+ (void) sigaction(SIGINT, &act, NULL);
+
+ if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
+ (void) sigaction(SIGTERM, &act, NULL);
+
+#if !defined(sun)
+ if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
+ (void) sigaction(SIGUSR1, &act, NULL);
+#endif
+
+ /*
+ * Now that tracing is active and we are ready to consume trace data,
+ * continue any grabbed or created processes, setting them running
+ * using the /proc control mechanism inside of libdtrace.
+ */
+ for (i = 0; i < g_psc; i++)
+ dtrace_proc_continue(g_dtp, g_psv[i]);
+
+ g_pslive = g_psc; /* count for prochandler() */
+
+ do {
+ if (!g_intr && !done)
+ dtrace_sleep(g_dtp);
+
+ if (g_newline) {
+ /*
+ * Output a newline just to make the output look
+ * slightly cleaner. Note that we do this even in
+ * "quiet" mode...
+ */
+ oprintf("\n");
+ g_newline = 0;
+ }
+
+ if (done || g_intr || (g_psc != 0 && g_pslive == 0)) {
+ done = 1;
+ if (dtrace_stop(g_dtp) == -1)
+ dfatal("couldn't stop tracing");
+ }
+
+ switch (dtrace_work(g_dtp, g_ofp, chew, chewrec, NULL)) {
+ case DTRACE_WORKSTATUS_DONE:
+ done = 1;
+ break;
+ case DTRACE_WORKSTATUS_OKAY:
+ break;
+ default:
+ if (!g_impatient && dtrace_errno(g_dtp) != EINTR)
+ dfatal("processing aborted");
+ }
+
+ if (g_ofp != NULL && fflush(g_ofp) == EOF)
+ clearerr(g_ofp);
+ } while (!done);
+
+ oprintf("\n");
+
+ if (!g_impatient) {
+ if (dtrace_aggregate_print(g_dtp, g_ofp, NULL) == -1 &&
+ dtrace_errno(g_dtp) != EINTR)
+ dfatal("failed to print aggregations");
+ }
+
+ dtrace_close(g_dtp);
+ return (g_status);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/README b/cddl/contrib/opensolaris/cmd/dtrace/test/README
new file mode 100644
index 000000000000..51ab650fd7d3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/README
@@ -0,0 +1,32 @@
+
+CDDL HEADER START
+
+The contents of this file are subject to the terms of the
+Common Development and Distribution License (the "License").
+You may not use this file except in compliance with the License.
+
+You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+or http://www.opensolaris.org/os/licensing.
+See the License for the specific language governing permissions
+and limitations under the License.
+
+When distributing Covered Code, include this CDDL HEADER in each
+file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+If applicable, add the following below this CDDL HEADER, with the
+fields enclosed by brackets "[]" replaced with your own identifying
+information: Portions Copyright [yyyy] [name of copyright owner]
+
+CDDL HEADER END
+
+Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+Use is subject to license terms.
+
+ident "%Z%%M% %I% %E% SMI"
+
+DTrace Testing Suite
+
+The SUNWdtrt package delivers a set of test programs and D source
+files into the directory /opt/SUNWdtrt. For more information see
+the following web site:
+
+ http://www.opensolaris.org/os/community/dtrace/dtest
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof/baddof.c b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof/baddof.c
new file mode 100644
index 000000000000..1c14c6592c88
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof/baddof.c
@@ -0,0 +1,207 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <sys/varargs.h>
+#include <errno.h>
+#include <math.h>
+#include <dtrace.h>
+
+void
+fatal(char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+
+ fprintf(stderr, "%s: ", "baddof");
+ vfprintf(stderr, fmt, ap);
+
+ if (fmt[strlen(fmt) - 1] != '\n')
+ fprintf(stderr, ": %s\n", strerror(errno));
+
+ exit(1);
+}
+
+#define LEAP_DISTANCE 20
+
+void
+corrupt(int fd, unsigned char *buf, int len)
+{
+ static int ttl, valid;
+ int bit, i;
+ unsigned char saved;
+ int val[LEAP_DISTANCE], pos[LEAP_DISTANCE];
+ int new, rv;
+
+again:
+ printf("valid DOF #%d\n", valid++);
+
+ /*
+ * We are going iterate through, flipping one bit and attempting
+ * to enable.
+ */
+ for (bit = 0; bit < len * 8; bit++) {
+ saved = buf[bit / 8];
+ buf[bit / 8] ^= (1 << (bit % 8));
+
+ if ((bit % 100) == 0)
+ printf("%d\n", bit);
+
+ if ((rv = ioctl(fd, DTRACEIOC_ENABLE, buf)) == -1) {
+ /*
+ * That failed -- restore the bit and drive on.
+ */
+ buf[bit / 8] = saved;
+ continue;
+ }
+
+ /*
+ * That worked -- and it may have enabled probes. To keep
+ * enabled probes down to a reasonable level, we'll close
+ * and reopen pseudodevice if we have more than 10,000
+ * probes enabled.
+ */
+ ttl += rv;
+
+ if (ttl < 10000) {
+ buf[bit / 8] = saved;
+ continue;
+ }
+
+ printf("enabled %d probes; resetting device.\n", ttl);
+ close(fd);
+
+ new = open("/devices/pseudo/dtrace@0:dtrace", O_RDWR);
+
+ if (new == -1)
+ fatal("couldn't open DTrace pseudo device");
+
+ if (new != fd) {
+ dup2(new, fd);
+ close(new);
+ }
+
+ ttl = 0;
+ buf[bit / 8] = saved;
+ }
+
+ for (;;) {
+ /*
+ * Now we want to get as many bits away as possible. We flip
+ * bits randomly -- getting as far away as we can until we don't
+ * seem to be making any progress.
+ */
+ for (i = 0; i < LEAP_DISTANCE; i++) {
+ /*
+ * Pick a random bit and corrupt it.
+ */
+ bit = lrand48() % (len * 8);
+
+ val[i] = buf[bit / 8];
+ pos[i] = bit / 8;
+ buf[bit / 8] ^= (1 << (bit % 8));
+ }
+
+ /*
+ * Let's see if that managed to get us valid DOF...
+ */
+ if ((rv = ioctl(fd, DTRACEIOC_ENABLE, buf)) > 0) {
+ /*
+ * Success! This will be our new base for valid DOF.
+ */
+ ttl += rv;
+ goto again;
+ }
+
+ /*
+ * No luck -- we'll restore those bits and try flipping a
+ * different set. Note that this must be done in reverse
+ * order...
+ */
+ for (i = LEAP_DISTANCE - 1; i >= 0; i--)
+ buf[pos[i]] = val[i];
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ char *filename = argv[1];
+ dtrace_hdl_t *dtp;
+ dtrace_prog_t *pgp;
+ int err, fd, len;
+ FILE *fp;
+ unsigned char *dof, *copy;
+
+ if (argc < 2)
+ fatal("expected D script as argument\n");
+
+ if ((fp = fopen(filename, "r")) == NULL)
+ fatal("couldn't open %s", filename);
+
+ /*
+ * First, we need to compile our provided D into DOF.
+ */
+ if ((dtp = dtrace_open(DTRACE_VERSION, 0, &err)) == NULL) {
+ fatal("cannot open dtrace library: %s\n",
+ dtrace_errmsg(NULL, err));
+ }
+
+ pgp = dtrace_program_fcompile(dtp, fp, 0, 0, NULL);
+ fclose(fp);
+
+ if (pgp == NULL) {
+ fatal("failed to compile script %s: %s\n", filename,
+ dtrace_errmsg(dtp, dtrace_errno(dtp)));
+ }
+
+ dof = dtrace_dof_create(dtp, pgp, 0);
+ len = ((dof_hdr_t *)dof)->dofh_loadsz;
+
+ if ((copy = malloc(len)) == NULL)
+ fatal("could not allocate copy of %d bytes", len);
+
+ for (;;) {
+ bcopy(dof, copy, len);
+ /*
+ * Open another instance of the dtrace device.
+ */
+ fd = open("/devices/pseudo/dtrace@0:dtrace", O_RDWR);
+
+ if (fd == -1)
+ fatal("couldn't open DTrace pseudo device");
+
+ corrupt(fd, copy, len);
+ close(fd);
+ }
+
+ /* NOTREACHED */
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/badioctl/badioctl.c b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/badioctl/badioctl.c
new file mode 100644
index 000000000000..8d6833d52173
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/badioctl/badioctl.c
@@ -0,0 +1,145 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <sys/varargs.h>
+#include <errno.h>
+#include <sys/mman.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#define DTRACEIOC (('d' << 24) | ('t' << 16) | ('r' << 8))
+#define DTRACEIOC_MAX 17
+
+void
+fatal(char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+
+ fprintf(stderr, "%s: ", "badioctl");
+ vfprintf(stderr, fmt, ap);
+
+ if (fmt[strlen(fmt) - 1] != '\n')
+ fprintf(stderr, ": %s\n", strerror(errno));
+
+ exit(1);
+}
+
+void
+badioctl(pid_t parent)
+{
+ int fd = -1, random, ps = sysconf(_SC_PAGESIZE);
+ int i = 0, seconds;
+ caddr_t addr;
+ hrtime_t now, last = 0, end;
+
+ if ((random = open("/dev/random", O_RDONLY)) == -1)
+ fatal("couldn't open /dev/random");
+
+ if ((addr = mmap(0, ps, PROT_READ | PROT_WRITE,
+ MAP_ANON | MAP_PRIVATE, -1, 0)) == (caddr_t)-1)
+ fatal("mmap");
+
+ for (;;) {
+ unsigned int ioc;
+
+ if ((now = gethrtime()) - last > NANOSEC) {
+ if (kill(parent, 0) == -1 && errno == ESRCH) {
+ /*
+ * Our parent died. We will kill ourselves in
+ * sympathy.
+ */
+ exit(0);
+ }
+
+ /*
+ * Once a second, we'll reopen the device.
+ */
+ if (fd != -1)
+ close(fd);
+
+ fd = open("/devices/pseudo/dtrace@0:dtrace", O_RDONLY);
+
+ if (fd == -1)
+ fatal("couldn't open DTrace pseudo device");
+
+ last = now;
+ }
+
+
+ if ((i++ % 1000) == 0) {
+ /*
+ * Every thousand iterations, change our random gunk.
+ */
+ read(random, addr, ps);
+ }
+
+ read(random, &ioc, sizeof (ioc));
+ ioc %= DTRACEIOC_MAX;
+ ioc++;
+ ioctl(fd, DTRACEIOC | ioc, addr);
+ }
+}
+
+int
+main()
+{
+ pid_t child, parent = getpid();
+ int status;
+
+ for (;;) {
+ if ((child = fork()) == 0)
+ badioctl(parent);
+
+ while (waitpid(child, &status, WEXITED) != child)
+ continue;
+
+ if (WIFEXITED(status)) {
+ /*
+ * Our child exited by design -- we'll exit with
+ * the same status code.
+ */
+ exit(WEXITSTATUS(status));
+ }
+
+ /*
+ * Our child died on a signal. Respawn it.
+ */
+ printf("badioctl: child died on signal %d; respawning.\n",
+ WTERMSIG(status));
+ fflush(stdout);
+ }
+
+ /* NOTREACHED */
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/chkargs/chkargs.c b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/chkargs/chkargs.c
new file mode 100644
index 000000000000..a7e0222fd0ea
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/chkargs/chkargs.c
@@ -0,0 +1,149 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <strings.h>
+#include <unistd.h>
+#include <dtrace.h>
+
+static int g_count;
+static int g_errs;
+static int g_fd;
+static int g_verbose;
+static int g_errexit;
+static char *g_progname;
+
+static int
+probe(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp, void *data)
+{
+ dtrace_probeinfo_t p;
+ dtrace_argdesc_t arg;
+ char buf[BUFSIZ];
+ int i;
+
+ (void) printf("\r%6d", ++g_count);
+ (void) fflush(stdout);
+
+ if (dtrace_probe_info(dtp, pdp, &p) != 0) {
+ (void) printf(" failed to get probe info for "
+ "%s:%s:%s:%s [%d]\n", pdp->dtpd_provider, pdp->dtpd_mod,
+ pdp->dtpd_func, pdp->dtpd_name, pdp->dtpd_id);
+ g_errs++;
+ return (0);
+ }
+
+ for (i = 0; i < p.dtp_argc; i++) {
+ if (p.dtp_argv[i].dtt_type == CTF_ERR) {
+ bzero(&arg, sizeof (dtrace_argdesc_t));
+ arg.dtargd_id = pdp->dtpd_id;
+ arg.dtargd_ndx = i;
+ (void) ioctl(g_fd, DTRACEIOC_PROBEARG, &arg);
+
+ (void) printf(" failed to get types for args[%d] "
+ "of %s:%s:%s:%s [%d]: <%s> -> <%s>\n", i,
+ pdp->dtpd_provider, pdp->dtpd_mod, pdp->dtpd_func,
+ pdp->dtpd_name, pdp->dtpd_id,
+ arg.dtargd_native, arg.dtargd_xlate);
+
+ g_errs++;
+
+ if (g_errexit)
+ return (-1);
+
+ } else if (g_verbose) {
+ (void) printf("%d args[%d] : %s\n", pdp->dtpd_id, i,
+ ctf_type_name(p.dtp_argv[i].dtt_ctfp,
+ p.dtp_argv[i].dtt_type, buf, sizeof (buf)));
+ }
+ }
+
+ return (0);
+}
+
+int
+main(int argc, char *argv[])
+{
+ dtrace_probedesc_t pd, *pdp = NULL;
+ dtrace_hdl_t *dtp;
+ int err, c;
+ char *p;
+
+ g_progname = argv[0];
+
+ if ((dtp = dtrace_open(DTRACE_VERSION, 0, &err)) == NULL) {
+ (void) fprintf(stderr, "%s: failed to open dtrace: %s\n",
+ g_progname, dtrace_errmsg(dtp, err));
+ return (1);
+ }
+
+ while ((c = getopt(argc, argv, "evx:")) != -1) {
+ switch (c) {
+ case 'e':
+ g_errexit++;
+ break;
+ case 'v':
+ g_verbose++;
+ break;
+ case 'x':
+ if ((p = strchr(optarg, '=')) != NULL)
+ *p++ = '\0';
+
+ if (dtrace_setopt(dtp, optarg, p) != 0) {
+ (void) fprintf(stderr, "%s: failed to set "
+ "option -x %s: %s\n", g_progname, optarg,
+ dtrace_errmsg(dtp, dtrace_errno(dtp)));
+ return (2);
+ }
+ break;
+
+ default:
+ (void) fprintf(stderr, "Usage: %s [-ev] "
+ "[-x opt[=arg]] [probedesc]\n", g_progname);
+ return (2);
+ }
+ }
+
+ argv += optind;
+ argc -= optind;
+
+ if (argc > 0) {
+ if (dtrace_str2desc(dtp, DTRACE_PROBESPEC_NAME, argv[0], &pd)) {
+ (void) fprintf(stderr, "%s: invalid probe description "
+ "%s: %s\n", g_progname, argv[0],
+ dtrace_errmsg(dtp, dtrace_errno(dtp)));
+ return (2);
+ }
+ pdp = &pd;
+ }
+
+ g_fd = dtrace_ctlfd(dtp);
+ (void) dtrace_probe_iter(dtp, pdp, probe, NULL);
+ dtrace_close(dtp);
+
+ (void) printf("\nTotal probes: %d\n", g_count);
+ (void) printf("Total errors: %d\n\n", g_errs);
+
+ return (g_errs != 0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/Getopt.java b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/Getopt.java
new file mode 100644
index 000000000000..e06a170d6a88
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/Getopt.java
@@ -0,0 +1,453 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+/* Copyright (c) 1988 AT&T */
+/* All Rights Reserved */
+
+import java.io.StringWriter;
+import java.io.PrintWriter;
+
+/**
+ * A Java port of Solaris {@code lib/libc/port/gen/getopt.c}, which is a
+ * port of System V UNIX getopt. See <b>getopt(3C)</b> and SUS/XPG
+ * getopt() for function definition and requirements. Unlike that
+ * definition, this implementation moves non-options to the end of the
+ * argv array rather than quitting at the first non-option.
+ */
+public class Getopt {
+ static final int EOF = -1;
+
+ private String progname;
+ private String[] args;
+ private int argc;
+ private String optstring;
+ private int optind = 0; // args index
+ private int optopt = 0;
+ private String optarg = null;
+ private boolean opterr = true;
+
+ /*
+ * _sp is required to keep state between successive calls to
+ * getopt() while extracting aggregated short-options (ie: -abcd).
+ */
+ private int _sp = 1;
+
+ /**
+ * Creates a {Code Getopt} instance to parse the given command-line
+ * arguments. Modifies the given args array by swapping the
+ * positions of non-options and options so that non-options appear
+ * at the end of the array.
+ */
+ public Getopt(String programName, String[] args,
+ String optionString)
+ {
+ progname = programName;
+ // No defensive copy; Getopt is expected to modify the given
+ // args array
+ this.args = args;
+ argc = this.args.length;
+ optstring = optionString;
+ validate();
+ }
+
+ private void
+ validate()
+ {
+ if (progname == null) {
+ throw new NullPointerException("program name is null");
+ }
+ int i = 0;
+ for (String s : args) {
+ if (s == null) {
+ throw new NullPointerException("null arg at index " + i);
+ }
+ ++i;
+ }
+ if (optstring == null) {
+ throw new NullPointerException("option string is null");
+ }
+ }
+
+ private static class StringRef {
+ private String s;
+
+ public String
+ get()
+ {
+ return s;
+ }
+
+ public StringRef
+ set(String value)
+ {
+ s = value;
+ return this;
+ }
+ }
+
+ /*
+ * Generalized error processing method. If the optstr parameter is
+ * null, the character c is converted to a string and displayed
+ * instead.
+ */
+ void
+ err(String format, char c, String optstr)
+ {
+ if (opterr && optstring.charAt(0) != ':') {
+ StringWriter w = new StringWriter();
+ PrintWriter p = new PrintWriter(w);
+ p.printf(format, progname, (optstr == null ?
+ Character.toString(c) : optstr.substring(2)));
+ System.err.println(w.toString());
+ }
+ }
+
+ /*
+ * Determine if the specified character (c) is present in the string
+ * (optstring) as a regular, single character option. If the option
+ * is found, return an index into optstring where the short-option
+ * character is found, otherwise return -1. The characters ':' and
+ * '(' are not allowed.
+ */
+ static int
+ parseshort(String optstring, char c)
+ {
+ if (c == ':' || c == '(') {
+ return -1;
+ }
+
+ int ch;
+ int len = optstring.length();
+ for (int i = 0; i < len; ++i) {
+ ch = optstring.charAt(i);
+ if (ch == c) {
+ return i;
+ }
+
+ while (i < len && ch == '(') {
+ for (++i; i < len && (ch = optstring.charAt(i)) != ')'; ++i);
+ }
+ }
+
+ return -1;
+ }
+
+ /**
+ * Determine if the specified string (opt) is present in the string
+ * (optstring) as a long-option contained within parenthesis. If the
+ * long-option specifies option-argument, return a reference to it
+ * in longoptarg. Otherwise set the longoptarg reference to null.
+ * If the option is found, return an index into optstring at the
+ * position of the short-option character associated with the
+ * long-option; otherwise return -1.
+ *
+ * @param optstring the entire optstring passed to the {@code
+ * Getopt} constructor
+ * @param opt the long option read from the command line
+ * @param longoptarg the value of the option is returned in this
+ * parameter, if an option exists. Possible return values in
+ * longoptarg are:
+ * <ul>
+ * <li><b>NULL:</b> No argument was found</li>
+ * <li><b>empty string (""):</b> Argument was explicitly left empty
+ * by the user (e.g., --option= )</li>
+ * <li><b>valid string:</b> Argument found on the command line</li>
+ * </ul>
+ * @return index to equivalent short-option in optstring, or -1 if
+ * option not found in optstring.
+ */
+ static int
+ parselong(String optstring, String opt, StringRef longoptarg)
+ {
+ int cp; // index into optstring, beginning of one option spec
+ int ip; // index into optstring, traverses every char
+ char ic; // optstring char
+ int il; // optstring length
+ int op; // index into opt
+ char oc; // opt char
+ int ol; // opt length
+ boolean match; // true if opt is matching part of optstring
+
+ longoptarg.set(null);
+ cp = ip = 0;
+ il = optstring.length();
+ ol = opt.length();
+ do {
+ ic = optstring.charAt(ip);
+ if (ic != '(' && ++ip == il)
+ break;
+ ic = optstring.charAt(ip);
+ if (ic == ':' && ++ip == il)
+ break;
+ ic = optstring.charAt(ip);
+ while (ic == '(') {
+ if (++ip == il)
+ break;
+ op = 0;
+ match = true;
+ while (ip < il && (ic = optstring.charAt(ip)) != ')' &&
+ op < ol) {
+ oc = opt.charAt(op++);
+ match = (ic == oc && match);
+ ++ip;
+ }
+
+ if (match && ip < il && ic == ')' && (op >= ol ||
+ opt.charAt(op) == '=')) {
+ if (op < ol && opt.charAt(op) == '=') {
+ /* may be an empty string - OK */
+ longoptarg.set(opt.substring(op + 1));
+ } else {
+ longoptarg.set(null);
+ }
+ return cp;
+ }
+ if (ip < il && ic == ')' && ++ip == il)
+ break;
+ ic = optstring.charAt(ip);
+ }
+ cp = ip;
+ /*
+ * Handle double-colon in optstring ("a::(longa)") The old
+ * getopt() accepts it and treats it as a required argument.
+ */
+ while ((cp > 0) && (cp < il) && (optstring.charAt(cp) == ':')) {
+ --cp;
+ }
+ } while (cp < il);
+ return -1;
+ }
+
+ /**
+ * Get the current option value.
+ */
+ public String
+ getOptarg()
+ {
+ return optarg;
+ }
+
+ /**
+ * Get the index of the next option to be parsed.
+ */
+ public int
+ getOptind()
+ {
+ return optind;
+ }
+
+ /**
+ * Gets the command-line arguments.
+ */
+ public String[]
+ getArgv()
+ {
+ // No defensive copy: Getopt is expected to modify the given
+ // args array.
+ return args;
+ }
+
+ /**
+ * Gets the aggregated short option that just failed. Since long
+ * options can't be aggregated, a failed long option can be obtained
+ * by {@code getArgv()[getOptind() - 1]}.
+ */
+ public int
+ getOptopt()
+ {
+ return optopt;
+ }
+
+ /**
+ * Set to {@code false} to suppress diagnostic messages to stderr.
+ */
+ public void
+ setOpterr(boolean err)
+ {
+ opterr = err;
+ }
+
+ /**
+ * Gets the next option character, or -1 if there are no more
+ * options. If getopt() encounters a short-option character or a
+ * long-option string not described in the {@code optionString}
+ * argument to the constructor, it returns the question-mark (?)
+ * character. If it detects a missing option-argument, it also
+ * returns the question-mark (?) character, unless the first
+ * character of the {@code optionString} argument was a colon (:),
+ * in which case getopt() returns the colon (:) character.
+ * <p>
+ * This implementation swaps the positions of options and
+ * non-options in the given argv array.
+ */
+ public int
+ getopt()
+ {
+ char c;
+ int cp;
+ boolean longopt;
+ StringRef longoptarg = new StringRef();
+
+ /*
+ * Has the end of the options been encountered? The following
+ * implements the SUS requirements:
+ *
+ * If, when getopt() is called:
+ * - the first character of argv[optind] is not '-'
+ * - argv[optind] is the string "-"
+ * getopt() returns -1 without changing optind if
+ * - argv[optind] is the string "--"
+ * getopt() returns -1 after incrementing optind
+ */
+ if (_sp == 1) {
+ boolean nonOption;
+ do {
+ nonOption = false;
+ if (optind >= argc || args[optind].equals("-")) {
+ return EOF;
+ } else if (args[optind].equals("--")) {
+ ++optind;
+ return EOF;
+ } else if (args[optind].charAt(0) != '-') {
+ // non-option: here we deviate from the SUS requirements
+ // by not quitting, and instead move non-options to the
+ // end of the args array
+ nonOption = true;
+ String tmp = args[optind];
+ if (optind + 1 < args.length) {
+ System.arraycopy(args, optind + 1, args, optind,
+ args.length - (optind + 1));
+ args[args.length - 1] = tmp;
+ }
+ --argc;
+ }
+ } while (nonOption);
+ }
+
+ /*
+ * Getting this far indicates that an option has been encountered.
+ * Note that the syntax of optstring applies special meanings to
+ * the characters ':' and '(', so they are not permissible as
+ * option letters. A special meaning is also applied to the ')'
+ * character, but its meaning can be determined from context.
+ * Note that the specification only requires that the alnum
+ * characters be accepted.
+ *
+ * If the second character of the argument is a '-' this must be
+ * a long-option, otherwise it must be a short option. Scan for
+ * the option in optstring by the appropriate algorithm. Either
+ * scan will return an index to the short-option character in
+ * optstring if the option is found and -1 otherwise.
+ *
+ * For an unrecognized long-option, optopt will equal 0, but
+ * since long-options can't aggregate the failing option can be
+ * identified by argv[optind-1].
+ */
+ optopt = c = args[optind].charAt(_sp);
+ optarg = null;
+ longopt = (_sp == 1 && c == '-');
+ if (!(longopt
+ ? ((cp = parselong(optstring, args[optind].substring(2),
+ longoptarg)) != -1)
+ : ((cp = parseshort(optstring, c)) != -1))) {
+ err("%s: illegal option -- %s", c,
+ (longopt ? args[optind] : null));
+ /*
+ * Note: When the long option is unrecognized, optopt will
+ * be '-' here, which matches the specification.
+ */
+ if (args[optind].length() == ++_sp || longopt) {
+ ++optind;
+ _sp = 1;
+ }
+ return '?';
+ }
+ optopt = c = optstring.charAt(cp);
+
+ /*
+ * A valid option has been identified. If it should have an
+ * option-argument, process that now. SUS defines the setting
+ * of optarg as follows:
+ *
+ * 1. If the option was the last character in an element of
+ * argv, then optarg contains the next element of argv, and
+ * optind is incremented by 2. If the resulting value of
+ * optind is not less than argc, this indicates a missing
+ * option-argument, and getopt() returns an error indication.
+ *
+ * 2. Otherwise, optarg points to the string following the
+ * option character in that element of argv, and optind is
+ * incremented by 1.
+ *
+ * The second clause allows -abcd (where b requires an
+ * option-argument) to be interpreted as "-a -b cd".
+ *
+ * Note that the option-argument can legally be an empty string,
+ * such as:
+ * command --option= operand
+ * which explicitly sets the value of --option to nil
+ */
+ if (cp + 1 < optstring.length() && optstring.charAt(cp + 1) == ':') {
+ // The option takes an argument
+ if (!longopt && ((_sp + 1) < args[optind].length())) {
+ optarg = args[optind++].substring(_sp + 1);
+ } else if (longopt && (longoptarg.get() != null)) {
+ /*
+ * The option argument was explicitly set to the empty
+ * string on the command line (--option=)
+ */
+ optind++;
+ optarg = longoptarg.get();
+ } else if (++optind >= argc) {
+ err("%s: option requires an argument -- %s", c,
+ (longopt ? args[optind - 1] : null));
+ _sp = 1;
+ optarg = null;
+ return (optstring.charAt(0) == ':' ? ':' : '?');
+ } else
+ optarg = args[optind++];
+ _sp = 1;
+ } else {
+ // The option does NOT take an argument
+ if (longopt && (longoptarg.get() != null)) {
+ // User supplied an arg to an option that takes none
+ err("%s: option doesn't take an argument -- %s", (char)0,
+ (longopt ? args[optind] : null));
+ optarg = longoptarg.set(null).get();
+ c = '?';
+ }
+
+ if (longopt || args[optind].length() == ++_sp) {
+ _sp = 1;
+ ++optind;
+ }
+ optarg = null;
+ }
+ return (c);
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/JDTrace.java b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/JDTrace.java
new file mode 100644
index 000000000000..3c5654d88df5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/JDTrace.java
@@ -0,0 +1,1042 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+import org.opensolaris.os.dtrace.*;
+import java.io.*;
+import java.util.*;
+import java.util.logging.*;
+
+/**
+ * Emulates {@code dtrace(1M)} using the Java DTrace API.
+ */
+public class JDTrace {
+ static Logger logger = Logger.getLogger(JDTrace.class.getName());
+
+ static Consumer dtrace;
+
+ static {
+ Handler handler = new ConsoleHandler();
+ handler.setLevel(Level.ALL);
+ logger.addHandler(handler);
+ }
+
+ static final String CLASSNAME = "JDTrace";
+ static final String OPTSTR =
+ "3:6:b:c:CD:ef:Fi:I:lL:m:n:o:p:P:qs:U:vVwx:X:Z";
+ static boolean heading = false;
+ static boolean quiet = false;
+ static boolean flow = false;
+ static int stackindent = 14;
+ static int exitStatus = 0;
+ static boolean started;
+ static boolean stopped;
+ static PrintStream out = System.out;
+ static final String ATS = "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
+ static final String SPACES = " ";
+ static final int QUANTIZE_ZERO_BUCKET = 63;
+
+ enum Mode {
+ EXEC,
+ INFO,
+ LIST,
+ VERSION
+ }
+
+ enum ProgramType {
+ STRING,
+ FILE
+ }
+
+ static class CompileRequest {
+ String s;
+ ProgramType type;
+ ProbeDescription.Spec probespec;
+ }
+
+ // Modify program string by expanding an incomplete probe
+ // description according to the requested probespec.
+ static void
+ applyProbespec(CompileRequest req)
+ {
+ ProbeDescription.Spec spec = ((req.probespec == null)
+ ? ProbeDescription.Spec.NAME
+ : req.probespec);
+
+ int colons = 0;
+ switch (req.probespec) {
+ case PROVIDER:
+ colons = 3;
+ break;
+ case MODULE:
+ colons = 2;
+ break;
+ case FUNCTION:
+ colons = 1;
+ break;
+ }
+
+ StringBuffer buf = new StringBuffer();
+ if (colons > 0) {
+ char ch;
+ int len = req.s.length();
+
+ int i = 0;
+ // Find first whitespace character not including leading
+ // whitespace (end of first token). Ignore whitespace
+ // inside a block if the block is concatenated with the
+ // probe description.
+ for (; (i < len) && Character.isWhitespace(req.s.charAt(i)); ++i);
+ int npos = i;
+ boolean inBlock = false;
+ for (; (npos < len) &&
+ (!Character.isWhitespace(ch = req.s.charAt(npos)) ||
+ inBlock); ++npos) {
+ if (ch == '{') {
+ inBlock = true;
+ } else if (ch == '}') {
+ inBlock = false;
+ }
+ }
+
+ // libdtrace lets you concatenate multiple probe
+ // descriptions separated by code blocks in curly braces,
+ // for example genunix::'{printf("FOUND");}'::entry, as long
+ // as the concatenated probe descriptions begin with ':' and
+ // not a specific field such as 'syscall'. So to expand the
+ // possibly multiple probe descriptions, we need to insert
+ // colons before each open curly brace, and again at the end
+ // only if there is at least one non-whitespace (probe
+ // specifying) character after the last closing curly brace.
+
+ int prev_i = 0;
+ while (i < npos) {
+ for (; (i < npos) && (req.s.charAt(i) != '{'); ++i);
+ buf.append(req.s.substring(prev_i, i));
+ if ((i < npos) || ((i > 0) && (req.s.charAt(i - 1) != '}'))) {
+ for (int c = 0; c < colons; ++c) {
+ buf.append(':');
+ }
+ }
+ if (i < npos) {
+ buf.append(req.s.charAt(i++));
+ }
+ prev_i = i;
+ }
+
+ // append remainder of program text
+ buf.append(req.s.substring(i));
+
+ req.s = buf.toString();
+ }
+ }
+
+ static void
+ printValue(Object value, int bytes, String stringFormat)
+ {
+ if (value instanceof Integer) {
+ if (bytes == 1) {
+ out.printf(" %3d", (Integer)value);
+ } else if (bytes == 2) {
+ out.printf(" %5d", (Integer)value);
+ } else {
+ out.printf(" %8d", (Integer)value);
+ }
+ } else if (value instanceof Long) {
+ out.printf(" %16d", (Long)value);
+ } else {
+ out.printf(stringFormat, value.toString());
+ }
+ }
+
+ static void
+ consumeProbeData(ProbeData data)
+ {
+ if (logger.isLoggable(Level.FINER)) {
+ logger.finer(data.toString());
+ }
+
+ if (!heading) {
+ if (flow) {
+ out.printf("%3s %-41s\n", "CPU", "FUNCTION");
+ } else {
+ if (!quiet) {
+ out.printf("%3s %6s %32s\n",
+ "CPU", "ID", "FUNCTION:NAME");
+ }
+ }
+ heading = true;
+ }
+ ProbeDescription probe = data.getEnabledProbeDescription();
+ if (flow) {
+ Flow flow = data.getFlow();
+ int indent = (flow.getDepth() * 2);
+ StringBuffer buf = new StringBuffer();
+ // indent
+ buf.append(' ');
+ for (int i = 0; i < indent; ++i) {
+ buf.append(' ');
+ }
+ // prefix
+ switch (flow.getKind()) {
+ case ENTRY:
+ if (indent == 0) {
+ buf.append("=> ");
+ } else {
+ buf.append("-> ");
+ }
+ break;
+ case RETURN:
+ if (indent == 0) {
+ buf.append("<= ");
+ } else {
+ buf.append("<- ");
+ }
+ break;
+ }
+
+ switch (flow.getKind()) {
+ case NONE:
+ buf.append(probe.getFunction());
+ buf.append(':');
+ buf.append(probe.getName());
+ break;
+ default:
+ buf.append(probe.getFunction());
+ }
+
+ out.printf("%3s %-41s ", data.getCPU(),
+ buf.toString());
+ } else {
+ if (!quiet) {
+ StringBuffer buf = new StringBuffer();
+ buf.append(probe.getFunction());
+ buf.append(':');
+ buf.append(probe.getName());
+ out.printf("%3s %6s %32s ",
+ data.getCPU(), probe.getID(),
+ buf.toString());
+ }
+ }
+ Record record = null;
+ Object value;
+ List <Record> records = data.getRecords();
+ Iterator <Record> itr = records.iterator();
+ while (itr.hasNext()) {
+ record = itr.next();
+
+ if (record instanceof ExitRecord) {
+ exitStatus = ((ExitRecord)record).getStatus();
+ } else if (record instanceof ScalarRecord) {
+ ScalarRecord scalar = (ScalarRecord)record;
+ value = scalar.getValue();
+ if (value instanceof byte[]) {
+ out.print(record.toString());
+ } else {
+ if (quiet) {
+ out.print(value);
+ } else {
+ printValue(value, scalar.getNumberOfBytes(),
+ " %-33s");
+ }
+ }
+ } else if (record instanceof PrintfRecord) {
+ out.print(record);
+ } else if (record instanceof PrintaRecord) {
+ PrintaRecord printa = (PrintaRecord)record;
+ List <Tuple> tuples = printa.getTuples();
+ if (tuples.isEmpty()) {
+ out.print(printa.getOutput());
+ } else {
+ for (Tuple t : tuples) {
+ out.print(printa.getFormattedString(t));
+ }
+ }
+
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine(printa.toString());
+ }
+ } else if (record instanceof StackValueRecord) {
+ printStack((StackValueRecord)record);
+ }
+ }
+ if (!quiet) {
+ out.println();
+ }
+ }
+
+ static void
+ printDistribution(Distribution d)
+ {
+ out.printf("\n%16s %41s %-9s\n", "value",
+ "------------- Distribution -------------",
+ "count");
+ long v; // bucket frequency (value)
+ long b; // lower bound of bucket range
+ double total = 0;
+ boolean positives = false;
+ boolean negatives = false;
+
+ Distribution.Bucket bucket;
+ int b1 = 0; // first displayed bucket
+ int b2 = d.size() - 1; // last displayed bucket
+ for (; (b1 <= b2) && (d.get(b1).getFrequency() == 0); ++b1);
+ // If possible, get one bucket before the first non-zero
+ // bucket and one bucket after the last.
+ if (b1 > b2) {
+ // There isn't any data. This is possible if (and only if)
+ // negative increment values have been used. In this case,
+ // print the buckets around the base.
+ if (d instanceof LinearDistribution) {
+ b1 = 0;
+ b2 = 2;
+ } else {
+ b1 = QUANTIZE_ZERO_BUCKET - 1;
+ b2 = QUANTIZE_ZERO_BUCKET + 1;
+ }
+ } else {
+ if (b1 > 0) --b1;
+ for (; (b2 > 0) && (d.get(b2).getFrequency() == 0); --b2);
+ if (b2 < (d.size() - 1)) ++b2;
+ }
+ for (int i = b1; i <= b2; ++i) {
+ v = d.get(i).getFrequency();
+ if (v > 0) {
+ positives = true;
+ }
+ if (v < 0) {
+ negatives = true;
+ }
+ total += Math.abs((double)v);
+ }
+ for (int i = b1; i <= b2; ++i) {
+ bucket = d.get(i);
+ v = bucket.getFrequency();
+ b = bucket.getMin();
+
+ if (d instanceof LinearDistribution) {
+ if (b == Long.MIN_VALUE) {
+ String lt = "< " + ((LinearDistribution)d).getBase();
+ out.printf("%16s ", lt);
+ } else if (bucket.getMax() == Long.MAX_VALUE) {
+ String ge = ">= " + b;
+ out.printf("%16s ", ge);
+ } else {
+ out.printf("%16d ", b);
+ }
+ } else {
+ out.printf("%16d ", b);
+ }
+
+ printDistributionLine(v, total, positives, negatives);
+ }
+ }
+
+ static void
+ printDistributionLine(long val, double total, boolean positives,
+ boolean negatives)
+ {
+ double f;
+ int depth, len = 40;
+
+ assert (ATS.length() == len && SPACES.length() == len);
+ assert (!(total == 0 && (positives || negatives)));
+ assert (!(val < 0 && !negatives));
+ assert (!(val > 0 && !positives));
+ assert (!(val != 0 && total == 0));
+
+ if (!negatives) {
+ if (positives) {
+ f = (Math.abs((double)val) * (double)len) / total;
+ depth = (int)(f + 0.5);
+ } else {
+ depth = 0;
+ }
+
+ out.printf("|%s%s %-9d\n", ATS.substring(len - depth),
+ SPACES.substring(depth), val);
+ return;
+ }
+
+ if (!positives) {
+ f = (Math.abs((double)val) * (double)len) / total;
+ depth = (int)(f + 0.5);
+
+ out.printf("%s%s| %-9d\n", SPACES.substring(depth),
+ ATS.substring(len - depth), val);
+ return;
+ }
+
+ /*
+ * If we're here, we have both positive and negative bucket values.
+ * To express this graphically, we're going to generate both positive
+ * and negative bars separated by a centerline. These bars are half
+ * the size of normal quantize()/lquantize() bars, so we divide the
+ * length in half before calculating the bar length.
+ */
+ len /= 2;
+ String ats = ATS.substring(len);
+ String spaces = SPACES.substring(len);
+
+ f = (Math.abs((double)val) * (double)len) / total;
+ depth = (int)(f + 0.5);
+
+ if (val <= 0) {
+ out.printf("%s%s|%s %-9d\n", spaces.substring(depth),
+ ats.substring(len - depth), repeat(" ", len), val);
+ return;
+ } else {
+ out.printf("%20s|%s%s %-9d\n", "", ats.substring(len - depth),
+ spaces.substring(depth), val);
+ }
+ }
+
+ public static String
+ repeat(String s, int n)
+ {
+ StringBuffer buf = new StringBuffer();
+ for (int i = 0; i < n; ++i) {
+ buf.append(s);
+ }
+ return buf.toString();
+ }
+
+ static void
+ printStack(StackValueRecord rec)
+ {
+ StackFrame[] frames = rec.getStackFrames();
+ int i;
+ out.println();
+ String s;
+ for (StackFrame f : frames) {
+ for (i = 0; i < stackindent; ++i) {
+ out.print(' ');
+ }
+ s = f.getFrame();
+ if (s.indexOf('[') == 0) {
+ out.print(" ");
+ }
+ out.println(s);
+ }
+ }
+
+ static void
+ printAggregate(Aggregate aggregate)
+ {
+ printAggregationRecords(aggregate.getOrderedRecords());
+ }
+
+ static void
+ printAggregationRecords(List <AggregationRecord> list)
+ {
+ Tuple tuple;
+ AggregationValue value;
+ ValueRecord tupleRecord;
+ int i;
+ int len;
+ for (AggregationRecord r : list) {
+ tuple = r.getTuple();
+ value = r.getValue();
+ len = tuple.size();
+ for (i = 0; i < len; ++i) {
+ tupleRecord = tuple.get(i);
+ if (tupleRecord instanceof StackValueRecord) {
+ printStack((StackValueRecord)tupleRecord);
+ } else if (tupleRecord instanceof SymbolValueRecord) {
+ printValue(tupleRecord.toString(), -1, " %-50s");
+ } else {
+ printValue(tupleRecord.getValue(),
+ ((ScalarRecord)tupleRecord).getNumberOfBytes(),
+ " %-50s");
+ }
+ }
+ if (value instanceof Distribution) {
+ Distribution d = (Distribution)value;
+ printDistribution(d);
+ } else {
+ Number v = value.getValue();
+ printValue(v, -1, " %-50s");
+ }
+ out.println();
+ }
+ }
+
+ static void
+ exit(int status)
+ {
+ out.flush();
+ System.err.flush();
+ if (status == 0) {
+ status = exitStatus;
+ }
+ System.exit(status);
+ }
+
+ static void
+ usage()
+ {
+ String predact = "[[ predicate ] action ]";
+ System.err.printf("Usage: java %s [-32|-64] [-CeFlqvVwZ] " +
+ "[-b bufsz] [-c cmd] [-D name[=def]]\n\t[-I path] [-L path] " +
+ "[-o output] [-p pid] [-s script] [-U name]\n\t" +
+ "[-x opt[=val]] [-X a|c|s|t]\n\n" +
+ "\t[-P provider %s]\n" +
+ "\t[-m [ provider: ] module %s]\n" +
+ "\t[-f [[ provider: ] module: ] func %s]\n" +
+ "\t[-n [[[ provider: ] module: ] func: ] name %s]\n" +
+ "\t[-i probe-id %s] [ args ... ]\n\n", CLASSNAME,
+ predact, predact, predact, predact, predact);
+ System.err.printf("\tpredicate -> '/' D-expression '/'\n");
+ System.err.printf("\t action -> '{' D-statements '}'\n");
+ System.err.printf("\n" +
+ "\t-32 generate 32-bit D programs\n" +
+ "\t-64 generate 64-bit D programs\n\n" +
+ "\t-b set trace buffer size\n" +
+ "\t-c run specified command and exit upon its completion\n" +
+ "\t-C run cpp(1) preprocessor on script files\n" +
+ "\t-D define symbol when invoking preprocessor\n" +
+ "\t-e exit after compiling request but prior to enabling " +
+ "probes\n" +
+ "\t-f enable or list probes matching the specified " +
+ "function name\n" +
+ "\t-F coalesce trace output by function\n" +
+ "\t-i enable or list probes matching the specified probe id\n" +
+ "\t-I add include directory to preprocessor search path\n" +
+ "\t-l list probes matching specified criteria\n" +
+ "\t-L add library directory to library search path\n" +
+ "\t-m enable or list probes matching the specified " +
+ "module name\n" +
+ "\t-n enable or list probes matching the specified probe name\n" +
+ "\t-o set output file\n" +
+ "\t-p grab specified process-ID and cache its symbol tables\n" +
+ "\t-P enable or list probes matching the specified " +
+ "provider name\n" +
+ "\t-q set quiet mode (only output explicitly traced data)\n" +
+ "\t-s enable or list probes according to the specified " +
+ "D script\n" +
+ "\t-U undefine symbol when invoking preprocessor\n" +
+ "\t-v set verbose mode (report stability attributes, " +
+ "arguments)\n" +
+ "\t-V report DTrace API version\n" +
+ "\t-w permit destructive actions\n" +
+ "\t-x enable or modify compiler and tracing options\n" +
+ "\t-X specify ISO C conformance settings for preprocessor\n" +
+ "\t-Z permit probe descriptions that match zero probes\n" +
+ "\n" +
+ "\tTo log PrintaRecord, set this environment variable:\n" +
+ "\t\tJDTRACE_LOGGING_LEVEL=FINE\n" +
+ "\tTo log ProbeData, set JDTRACE_LOGGING_LEVEL=FINER\n");
+ exit(2);
+ }
+
+ static void
+ printProgramStability(String programType, String programDescription,
+ ProgramInfo info)
+ {
+ out.println();
+ out.printf("Stability data for %s %s:\n\n",
+ programType, programDescription);
+ InterfaceAttributes a;
+ out.println("\tMinimum probe description " +
+ "attributes");
+ a = info.getMinimumProbeAttributes();
+ out.printf("\t\tIdentifier Names: %s\n",
+ a.getNameStability());
+ out.printf("\t\tData Semantics: %s\n",
+ a.getDataStability());
+ out.printf("\t\tDependency Class: %s\n",
+ a.getDependencyClass());
+ out.println("\tMinimum probe statement attributes");
+ a = info.getMinimumStatementAttributes();
+ out.printf("\t\tIdentifier Names: %s\n",
+ a.getNameStability());
+ out.printf("\t\tData Semantics: %s\n",
+ a.getDataStability());
+ out.printf("\t\tDependency Class: %s\n",
+ a.getDependencyClass());
+ }
+
+ static void
+ printProbeDescription(ProbeDescription p)
+ {
+ out.printf("%5d %10s %17s %33s %s\n", p.getID(),
+ p.getProvider(), p.getModule(),
+ p.getFunction(), p.getName());
+ }
+
+ static void
+ printProbeInfo(ProbeInfo p)
+ {
+ InterfaceAttributes a;
+ out.println("\n\tProbe Description Attributes");
+
+ a = p.getProbeAttributes();
+ out.printf("\t\tIdentifier Names: %s\n",
+ a.getNameStability());
+ out.printf("\t\tData Semantics: %s\n",
+ a.getDataStability());
+ out.printf("\t\tDependency Class: %s\n",
+ a.getDependencyClass());
+
+ out.println("\n\tArgument Attributes");
+
+ a = p.getArgumentAttributes();
+ out.printf("\t\tIdentifier Names: %s\n",
+ a.getNameStability());
+ out.printf("\t\tData Semantics: %s\n",
+ a.getDataStability());
+ out.printf("\t\tDependency Class: %s\n",
+ a.getDependencyClass());
+
+ // Argument types unsupported for now.
+
+ out.println();
+ }
+
+ public static void
+ main(String[] args)
+ {
+ String loggingLevel = System.getenv().get("JDTRACE_LOGGING_LEVEL");
+ try {
+ logger.setLevel(Level.parse(loggingLevel));
+ } catch (Exception e) {
+ logger.setLevel(Level.OFF);
+ }
+
+ if (args.length == 0) {
+ usage();
+ }
+
+ List <CompileRequest> compileRequests = new LinkedList
+ <CompileRequest> ();
+ List <Program> programList = new LinkedList <Program> ();
+ boolean verbose = false;
+ Mode mode = Mode.EXEC;
+
+ final ExceptionHandler exceptionHandler = new ExceptionHandler() {
+ public void handleException(Throwable e) {
+ if (e instanceof DTraceException) {
+ DTraceException de = (DTraceException)e;
+ System.err.printf("dtrace: %s\n", de.getMessage());
+ } else if (e instanceof ConsumerException) {
+ ConsumerException ce = (ConsumerException)e;
+ Object msg = ce.getNotificationObject();
+ if ((msg instanceof org.opensolaris.os.dtrace.Error) ||
+ (msg instanceof Drop)) {
+ System.err.printf("dtrace: %s\n", ce.getMessage());
+ } else {
+ ce.printStackTrace();
+ }
+ } else {
+ e.printStackTrace();
+ }
+ exit(1);
+ }
+ };
+
+ Getopt g = new Getopt(CLASSNAME, args, OPTSTR);
+ int c = 0;
+
+ List <Consumer.OpenFlag> openFlags =
+ new ArrayList <Consumer.OpenFlag> ();
+
+ while ((c = g.getopt()) != -1) {
+ switch (c) {
+ case '3': {
+ String s = g.getOptarg();
+ if (!s.equals("2")) {
+ System.err.println("dtrace: illegal option -- 3" + s);
+ usage();
+ }
+ openFlags.add(Consumer.OpenFlag.ILP32);
+ break;
+ }
+ case '6': {
+ String s = g.getOptarg();
+ if (!s.equals("4")) {
+ System.err.println("dtrace: illegal option -- 6" + s);
+ usage();
+ }
+ openFlags.add(Consumer.OpenFlag.LP64);
+ break;
+ }
+ }
+ }
+
+ Consumer.OpenFlag[] oflags = new Consumer.OpenFlag[openFlags.size()];
+ oflags = openFlags.toArray(oflags);
+
+ dtrace = new LocalConsumer() {
+ protected Thread createThread() {
+ Thread t = super.createThread();
+ t.setDaemon(false);
+ t.setPriority(Thread.MIN_PRIORITY);
+ return t;
+ }
+ };
+
+ g = new Getopt(CLASSNAME, args, OPTSTR);
+ c = 0;
+
+ try {
+ dtrace.open(oflags);
+
+ // Set default options that may be overriden by options or #pragma
+ dtrace.setOption(Option.bufsize, Option.mb(4));
+ dtrace.setOption(Option.aggsize, Option.mb(4));
+
+ CompileRequest r;
+ while ((c = g.getopt()) != -1) {
+ switch (c) {
+ case 'b':
+ dtrace.setOption(Option.bufsize, g.getOptarg());
+ break;
+ case 'c':
+ dtrace.createProcess(g.getOptarg());
+ break;
+ case 'C':
+ dtrace.setOption(Option.cpp);
+ break;
+ case 'D':
+ dtrace.setOption(Option.define, g.getOptarg());
+ break;
+ case 'e':
+ mode = Mode.INFO;
+ break;
+ case 'f':
+ r = new CompileRequest();
+ r.s = g.getOptarg();
+ r.type = ProgramType.STRING;
+ r.probespec = ProbeDescription.Spec.FUNCTION;
+ compileRequests.add(r);
+ break;
+ case 'F':
+ dtrace.setOption(Option.flowindent);
+ break;
+ case 'i':
+ r = new CompileRequest();
+ r.s = g.getOptarg();
+ r.type = ProgramType.STRING;
+ r.probespec = ProbeDescription.Spec.NAME;
+ compileRequests.add(r);
+ break;
+ case 'I':
+ dtrace.setOption(Option.incdir, g.getOptarg());
+ break;
+ case 'l':
+ mode = Mode.LIST;
+ dtrace.setOption(Option.zdefs); // -l implies -Z
+ break;
+ case 'L':
+ dtrace.setOption(Option.libdir, g.getOptarg());
+ break;
+ case 'm':
+ r = new CompileRequest();
+ r.s = g.getOptarg();
+ r.type = ProgramType.STRING;
+ r.probespec = ProbeDescription.Spec.MODULE;
+ compileRequests.add(r);
+ break;
+ case 'n':
+ r = new CompileRequest();
+ r.s = g.getOptarg();
+ r.type = ProgramType.STRING;
+ r.probespec = ProbeDescription.Spec.NAME;
+ compileRequests.add(r);
+ break;
+ case 'o':
+ String outFileName = g.getOptarg();
+ File outFile = new File(outFileName);
+ try {
+ FileOutputStream fos = new FileOutputStream(
+ outFile, true);
+ out = new PrintStream(fos);
+ } catch (FileNotFoundException e) {
+ System.err.println("failed to open " +
+ outFileName + " in write mode");
+ exit(1);
+ } catch (SecurityException e) {
+ System.err.println("failed to open " +
+ outFileName);
+ exit(1);
+ }
+ break;
+ case 'p':
+ String pidstr = g.getOptarg();
+ int pid = -1;
+ try {
+ pid = Integer.parseInt(pidstr);
+ } catch (NumberFormatException e) {
+ System.err.println("invalid pid: " + pidstr);
+ exit(1);
+ }
+ dtrace.grabProcess(pid);
+ break;
+ case 'P':
+ r = new CompileRequest();
+ r.s = g.getOptarg();
+ r.type = ProgramType.STRING;
+ r.probespec = ProbeDescription.Spec.PROVIDER;
+ compileRequests.add(r);
+ break;
+ case 'q':
+ dtrace.setOption(Option.quiet);
+ break;
+ case 's':
+ r = new CompileRequest();
+ r.s = g.getOptarg();
+ r.type = ProgramType.FILE;
+ compileRequests.add(r);
+ break;
+ case 'U':
+ dtrace.setOption(Option.undef, g.getOptarg());
+ break;
+ case 'v':
+ verbose = true;
+ break;
+ case 'V':
+ mode = Mode.VERSION;
+ break;
+ case 'w':
+ dtrace.setOption(Option.destructive);
+ break;
+ case 'x':
+ String[] xarg = g.getOptarg().split("=", 2);
+ if (xarg.length > 1) {
+ dtrace.setOption(xarg[0], xarg[1]);
+ } else if (xarg.length == 1) {
+ dtrace.setOption(xarg[0]);
+ }
+ break;
+ case 'X':
+ dtrace.setOption(Option.stdc, g.getOptarg());
+ break;
+ case 'Z':
+ dtrace.setOption(Option.zdefs);
+ break;
+ case '?':
+ usage(); // getopt() already printed an error
+ break;
+ default:
+ System.err.print("getopt() returned " + c + "\n");
+ c = 0;
+ }
+ }
+ c = 0;
+ List <String> argList = new LinkedList <String> ();
+ for (int i = g.getOptind(); i < args.length; ++i) {
+ argList.add(args[i]);
+ }
+
+ if (mode == Mode.VERSION) {
+ out.printf("dtrace: %s\n", dtrace.getVersion());
+ dtrace.close();
+ exit(0);
+ }
+
+ String[] compileArgs = new String[argList.size()];
+ compileArgs = argList.toArray(compileArgs);
+
+ Program program;
+ for (CompileRequest req : compileRequests) {
+ switch (req.type) {
+ case STRING:
+ applyProbespec(req);
+ program = dtrace.compile(req.s, compileArgs);
+ break;
+ case FILE:
+ File file = new File(req.s);
+ program = dtrace.compile(file, compileArgs);
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "Unexpected program type: " + req.type);
+ }
+
+ programList.add(program);
+ }
+
+ // Get options set by #pragmas in compiled program
+ long optval;
+ quiet = (dtrace.getOption(Option.quiet) != Option.UNSET);
+ flow = (dtrace.getOption(Option.flowindent) != Option.UNSET);
+ optval = dtrace.getOption("stackindent");
+ if (optval != Option.UNSET) {
+ stackindent = (int)optval;
+ }
+
+ if (mode == Mode.LIST) {
+ out.printf("%5s %10s %17s %33s %s\n",
+ "ID", "PROVIDER", "MODULE", "FUNCTION", "NAME");
+
+ if (verbose) {
+ List <List <Probe>> lists =
+ new LinkedList <List <Probe>> ();
+ for (Program p : programList) {
+ lists.add(dtrace.listProgramProbeDetail(p));
+ }
+ ProbeDescription p;
+ ProbeInfo pinfo;
+ for (List <Probe> list : lists) {
+ for (Probe probe : list) {
+ p = probe.getDescription();
+ pinfo = probe.getInfo();
+ printProbeDescription(p);
+ printProbeInfo(pinfo);
+ }
+ }
+ } else {
+ List <List <ProbeDescription>> lists =
+ new LinkedList <List <ProbeDescription>> ();
+ for (Program p : programList) {
+ lists.add(dtrace.listProgramProbes(p));
+ }
+ for (List <ProbeDescription> list : lists) {
+ for (ProbeDescription p : list) {
+ printProbeDescription(p);
+ }
+ }
+ }
+ exit(0);
+ }
+
+ String programType;
+ String programDescription;
+ ProgramInfo info;
+ for (Program p : programList) {
+ if (p instanceof Program.File) {
+ Program.File pf = (Program.File)p;
+ programType = "script";
+ programDescription = pf.getFile().getPath();
+ } else {
+ programType = "description";
+ programDescription =
+ p.getContents().split("[/{;]", 2)[0];
+ }
+
+ if (mode == Mode.EXEC) {
+ dtrace.enable(p);
+ } else {
+ dtrace.getProgramInfo(p);
+ }
+ info = p.getInfo();
+ if ((mode == Mode.EXEC) && !quiet) {
+ System.err.printf("dtrace: %s '%s' matched %d probe%s\n",
+ programType, programDescription,
+ info.getMatchingProbeCount(),
+ info.getMatchingProbeCount() == 1 ? "" : "s");
+ }
+ if (verbose) {
+ printProgramStability(programType,
+ programDescription, info);
+ }
+ }
+ if (mode != Mode.EXEC) {
+ exit(0);
+ }
+ dtrace.addConsumerListener(new ConsumerAdapter() {
+ public void consumerStarted(ConsumerEvent e) {
+ started = true;
+ }
+ public void consumerStopped(ConsumerEvent e) {
+ stopped = true;
+ out.println();
+ try {
+ Aggregate aggregate = dtrace.getAggregate();
+ if (aggregate != null) {
+ printAggregate(aggregate);
+ }
+ dtrace.close();
+ } catch (Throwable x) {
+ exceptionHandler.handleException(x);
+ }
+ exit(0);
+ }
+ public void dataDropped(DropEvent e) {
+ System.err.printf("dtrace: %s",
+ e.getDrop().getDefaultMessage());
+ }
+ public void errorEncountered(ErrorEvent e)
+ throws ConsumerException {
+ org.opensolaris.os.dtrace.Error error = e.getError();
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine(error.toString());
+ }
+ System.err.printf("dtrace: %s",
+ error.getDefaultMessage());
+ }
+ public void dataReceived(DataEvent e)
+ throws ConsumerException {
+ consumeProbeData(e.getProbeData());
+ }
+ public void processStateChanged(ProcessEvent e)
+ throws ConsumerException {
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine(e.getProcessState().toString());
+ }
+ }
+ });
+ // Print unprinted aggregations after Ctrl-C
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ public void run() {
+ if (stopped || !started) {
+ return;
+ }
+
+ try {
+ Aggregate aggregate = dtrace.getAggregate();
+ if (aggregate != null) {
+ out.println();
+ out.println();
+ printAggregate(aggregate);
+ }
+ } catch (Throwable x) {
+ exceptionHandler.handleException(x);
+ }
+ }
+ });
+ dtrace.go(exceptionHandler);
+ } catch (DTraceException e) {
+ if (c > 0) {
+ // set option error
+ if (g.getOptarg() == null) {
+ System.err.printf("dtrace: failed to set -%c: %s\n",
+ c, e.getMessage());
+ } else {
+ System.err.printf("dtrace: failed to set -%c %s: %s\n",
+ c, g.getOptarg(), e.getMessage());
+ }
+ } else {
+ // any other error
+ System.err.printf("dtrace: %s\n", e.getMessage());
+ }
+ exit(1);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst
new file mode 100644
index 000000000000..19fc3aca51c2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst
@@ -0,0 +1,79 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# Exception list: names tests that are bypassed when running in Java
+# mode (relative to /opt/SUNWdtrt/tst)
+
+# double precision (64-bit floating point) not same in java
+common/aggs/tst.neglquant.d
+common/aggs/tst.negquant.d
+
+# freopen() (to suppress output) not supported by Java DTrace API
+common/printa/tst.walltimestamp.ksh
+
+# -G option not supported by jdtrace
+common/dtraceUtil/tst.ELFGenerationOut.d.ksh
+common/dtraceUtil/tst.ELFGenerationWithO.d.ksh
+
+# -H option not supported by jdtrace
+common/dtraceUtil/tst.PreprocessorStatement.d.ksh
+
+# -G and -h options not supported by jdtrace
+common/usdt/tst.badguess.ksh
+common/usdt/tst.dlclose1.ksh
+common/usdt/tst.dlclose2.ksh
+common/usdt/tst.dlclose3.ksh
+common/usdt/tst.eliminate.ksh
+common/usdt/tst.enabled.ksh
+common/usdt/tst.enabled2.ksh
+common/usdt/tst.entryreturn.ksh
+common/usdt/tst.fork.ksh
+common/usdt/tst.guess32.ksh
+common/usdt/tst.guess64.ksh
+common/usdt/tst.header.ksh
+common/usdt/tst.linkpriv.ksh
+common/usdt/tst.linkunpriv.ksh
+common/usdt/tst.multiple.ksh
+common/usdt/tst.nodtrace.ksh
+common/usdt/tst.noreap.ksh
+common/usdt/tst.noreapring.ksh
+common/usdt/tst.onlyenabled.ksh
+common/usdt/tst.reap.ksh
+common/usdt/tst.reeval.ksh
+common/usdt/tst.static.ksh
+common/usdt/tst.static2.ksh
+common/usdt/tst.user.ksh
+sparc/usdt/tst.tailcall.ksh
+common/pid/tst.provregex3.ksh
+common/pid/tst.provregex4.ksh
+
+# freopen() and ftruncate() not supported by Java DTrace API
+common/funcs/tst.badfreopen.ksh
+common/funcs/tst.freopen.ksh
+common/funcs/tst.ftruncate.ksh
+
+# jdtrace doesn't pull in library files?
+common/pragma/tst.libdepfullyconnected.ksh
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/jdtrace.c b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/jdtrace.c
new file mode 100644
index 000000000000..095126569cc1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/jdtrace.c
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <alloca.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/systeminfo.h>
+
+int
+main(int argc, char **argv)
+{
+ int i, ac, has64;
+ char **av, **p;
+
+ ac = argc + 3;
+ av = p = alloca(sizeof (char *) * ac);
+
+ *p++ = "java";
+ *p++ = "-jar";
+ *p++ = "/opt/SUNWdtrt/lib/java/jdtrace.jar";
+
+ argc--;
+ argv++;
+
+ for (i = 0; i < argc; i++) {
+ p[i] = argv[i];
+ }
+ p[i] = NULL;
+
+ (void) execvp(av[0], av);
+
+ perror("exec failed");
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/manifest/jdtrace.jar-manifest b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/manifest/jdtrace.jar-manifest
new file mode 100644
index 000000000000..add47ebf4c8d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/manifest/jdtrace.jar-manifest
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: JDTrace
+Class-Path: /usr/share/lib/java/dtrace.jar
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl
new file mode 100755
index 000000000000..3c3e180a0e75
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl
@@ -0,0 +1,235 @@
+#!/usr/local/bin/perl
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+require 5.8.4;
+
+$PNAME = $0;
+$PNAME =~ s:.*/::;
+$USAGE = "Usage: $PNAME [file ...]\n";
+$errs = 0;
+
+sub err
+{
+ my($msg) = @_;
+
+ print "$file: $lineno: $msg\n";
+ $errs++;
+}
+
+sub dstyle
+{
+ open(FILE, "$file");
+ $lineno = 0;
+ $inclause = 0;
+ $skipnext = 0;
+
+ while (<FILE>) {
+ $lineno++;
+
+ chop;
+
+ if ($skipnext) {
+ $skipnext = 0;
+ next;
+ }
+
+ #
+ # Amazingly, some ident strings are longer than 80 characters!
+ #
+ if (/^#pragma ident/) {
+ next;
+ }
+
+ #
+ # The algorithm to calculate line length from cstyle.
+ #
+ $line = $_;
+ if ($line =~ tr/\t/\t/ * 7 + length($line) > 80) {
+ # yes, there is a chance.
+ # replace tabs with spaces and check again.
+ $eline = $line;
+ 1 while $eline =~
+ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
+
+ if (length($eline) > 80) {
+ err "line > 80 characters";
+ }
+ }
+
+ if (/\/\*DSTYLED\*\//) {
+ $skipnext = 1;
+ next;
+ }
+
+ if (/^#pragma/) {
+ next;
+ }
+
+ if (/^#include/) {
+ next;
+ }
+
+ #
+ # Before we do any more analysis, we want to prune out any
+ # quoted strings. This is a bit tricky because we need
+ # to be careful of backslashed quotes within quoted strings.
+ # I'm sure there is a very crafty way to do this with a
+ # single regular expression, but that will have to wait for
+ # somone with better regex juju that I; we do this by first
+ # eliminating the backslashed quotes, and then eliminating
+ # whatever quoted strings are left. Note that we eliminate
+ # the string by replacing it with "quotedstr"; this is to
+ # allow lines to end with a quoted string. (If we simply
+ # eliminated the quoted string, dstyle might complain about
+ # the line ending in a space or tab.)
+ #
+ s/\\\"//g;
+ s/\"[^\"]*\"/quotedstr/g;
+
+ if (/[ \t]$/) {
+ err "space or tab at end of line";
+ }
+
+ if (/^[\t]+[ ]+[\t]+/) {
+ err "spaces between tabs";
+ }
+
+ if (/^[\t]* \*/) {
+ next;
+ }
+
+ if (/^ /) {
+ err "indented by spaces not tabs";
+ }
+
+ if (/^{}$/) {
+ next;
+ }
+
+ if (!/^enum/ && !/^\t*struct/ && !/^\t*union/ && !/^typedef/ &&
+ !/^translator/ && !/^provider/) {
+ if (/[\w\s]+{/) {
+ err "left brace not on its own line";
+ }
+
+ if (/{[\w\s]+/) {
+ err "left brace not on its own line";
+ }
+ }
+
+ if (!/;$/) {
+ if (/[\w\s]+}/) {
+ err "right brace not on its own line";
+ }
+
+ if (/}[\w\s]+/) {
+ err "right brace not on its own line";
+ }
+ }
+
+ if (/^}/) {
+ $inclause = 0;
+ }
+
+ if (!$inclause && /^[\w ]+\//) {
+ err "predicate not at beginning of line";
+ }
+
+ if (!$inclause && /^\/[ \t]+\w/) {
+ err "space between '/' and expression in predicate";
+ }
+
+ if (!$inclause && /\w[ \t]+\/$/) {
+ err "space between expression and '/' in predicate";
+ }
+
+ if (!$inclause && /\s,/) {
+ err "space before comma in probe description";
+ }
+
+ if (!$inclause && /\w,[\w\s]/ && !/;$/) {
+ if (!/extern/ && !/\(/ && !/inline/) {
+ err "multiple probe descriptions on same line";
+ }
+ }
+
+ if ($inclause && /sizeof\(/) {
+ err "missing space after sizeof";
+ }
+
+ if ($inclause && /^[\w ]/) {
+ err "line doesn't begin with a tab";
+ }
+
+ if ($inclause && /,[\w]/) {
+ err "comma without trailing space";
+ }
+
+ if (/\w&&/ || /&&\w/ || /\w\|\|/ || /\|\|\w/) {
+ err "logical operator not set off with spaces";
+ }
+
+ #
+ # We want to catch "i<0" variants, but we don't want to
+ # erroneously flag translators.
+ #
+ if (!/\w<\w+>\(/) {
+ if (/\w>/ || / >\w/ || /\w</ || /<\w/) {
+ err "comparison operator not set " .
+ "off with spaces";
+ }
+ }
+
+ if (/\w==/ || /==\w/ || /\w<=/ || />=\w/ || /\w!=/ || /!=\w/) {
+ err "comparison operator not set off with spaces";
+ }
+
+ if (/\w=/ || /=\w/) {
+ err "assignment operator not set off with spaces";
+ }
+
+ if (/^{/) {
+ $inclause = 1;
+ }
+ }
+}
+
+foreach $arg (@ARGV) {
+ if (-f $arg) {
+ push(@files, $arg);
+ } else {
+ die "$PNAME: $arg is not a valid file\n";
+ }
+}
+
+die $USAGE if (scalar(@files) == 0);
+
+foreach $file (@files) {
+ dstyle($file);
+}
+
+exit($errs != 0);
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl
new file mode 100755
index 000000000000..db157415b62b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl
@@ -0,0 +1,706 @@
+#!/usr/local/bin/perl
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+require 5.8.4;
+
+use File::Find;
+use File::Basename;
+use Getopt::Std;
+use Cwd;
+use Cwd 'abs_path';
+
+$PNAME = $0;
+$PNAME =~ s:.*/::;
+$OPTSTR = 'abd:fghi:jlnqsx:';
+$USAGE = "Usage: $PNAME [-abfghjlnqs] [-d dir] [-i isa] "
+ . "[-x opt[=arg]] [file | dir ...]\n";
+($MACH = `uname -p`) =~ s/\W*\n//;
+($PLATFORM = `uname -i`) =~ s/\W*\n//;
+
+@dtrace_argv = ();
+
+$ksh_path = '/usr/local/bin/ksh';
+
+@files = ();
+%exceptions = ();
+%results = ();
+$errs = 0;
+
+#
+# If no test files are specified on the command-line, execute a find on "."
+# and append any tst.*.d, tst.*.ksh, err.*.d or drp.*.d files found within
+# the directory tree.
+#
+sub wanted
+{
+ push(@files, $File::Find::name)
+ if ($_ =~ /^(tst|err|drp)\..+\.(d|ksh)$/ && -f "$_");
+}
+
+sub dirname {
+ my($s) = @_;
+ my($i);
+
+ $s = substr($s, 0, $i) if (($i = rindex($s, '/')) != -1);
+ return $i == -1 ? '.' : $i == 0 ? '/' : $s;
+}
+
+sub usage
+{
+ print $USAGE;
+ print "\t -a execute test suite using anonymous enablings\n";
+ print "\t -b execute bad ioctl test program\n";
+ print "\t -d specify directory for test results files and cores\n";
+ print "\t -g enable libumem debugging when running tests\n";
+ print "\t -f force bypassed tests to run\n";
+ print "\t -h display verbose usage message\n";
+ print "\t -i specify ISA to test instead of isaexec(3C) default\n";
+ print "\t -j execute test suite using jdtrace (Java API) only\n";
+ print "\t -l save log file of results and PIDs used by tests\n";
+ print "\t -n execute test suite using dtrace(1m) only\n";
+ print "\t -q set quiet mode (only report errors and summary)\n";
+ print "\t -s save results files even for tests that pass\n";
+ print "\t -x pass corresponding -x argument to dtrace(1M)\n";
+ exit(2);
+}
+
+sub errmsg
+{
+ my($msg) = @_;
+
+ print STDERR $msg;
+ print LOG $msg if ($opt_l);
+ $errs++;
+}
+
+sub fail
+{
+ my(@parms) = @_;
+ my($msg) = $parms[0];
+ my($errfile) = $parms[1];
+ my($n) = 0;
+ my($dest) = basename($file);
+
+ while (-d "$opt_d/failure.$n") {
+ $n++;
+ }
+
+ unless (mkdir "$opt_d/failure.$n") {
+ warn "ERROR: failed to make directory $opt_d/failure.$n: $!\n";
+ exit(125);
+ }
+
+ open(README, ">$opt_d/failure.$n/README");
+ print README "ERROR: " . $file . " " . $msg;
+
+ if (scalar @parms > 1) {
+ print README "; see $errfile\n";
+ } else {
+ if (-f "$opt_d/$pid.core") {
+ print README "; see $pid.core\n";
+ } else {
+ print README "\n";
+ }
+ }
+
+ close(README);
+
+ if (-f "$opt_d/$pid.out") {
+ rename("$opt_d/$pid.out", "$opt_d/failure.$n/$pid.out");
+ link("$file.out", "$opt_d/failure.$n/$dest.out");
+ }
+
+ if (-f "$opt_d/$pid.err") {
+ rename("$opt_d/$pid.err", "$opt_d/failure.$n/$pid.err");
+ link("$file.err", "$opt_d/failure.$n/$dest.err");
+ }
+
+ if (-f "$opt_d/$pid.core") {
+ rename("$opt_d/$pid.core", "$opt_d/failure.$n/$pid.core");
+ }
+
+ link("$file", "$opt_d/failure.$n/$dest");
+
+ $msg = "ERROR: " . $dest . " " . $msg;
+
+ if (scalar @parms > 1) {
+ $msg = $msg . "; see $errfile in failure.$n\n";
+ } else {
+ $msg = $msg . "; details in failure.$n\n";
+ }
+
+ errmsg($msg);
+}
+
+sub logmsg
+{
+ my($msg) = @_;
+
+ print STDOUT $msg unless ($opt_q);
+ print LOG $msg if ($opt_l);
+}
+
+# Trim leading and trailing whitespace
+sub trim {
+ my($s) = @_;
+
+ $s =~ s/^\s*//;
+ $s =~ s/\s*$//;
+ return $s;
+}
+
+# Load exception set of skipped tests from the file at the given
+# pathname. The test names are assumed to be paths relative to $dt_tst,
+# for example: common/aggs/tst.neglquant.d, and specify tests to be
+# skipped.
+sub load_exceptions {
+ my($listfile) = @_;
+ my($line) = "";
+
+ %exceptions = ();
+ if (length($listfile) > 0) {
+ exit(123) unless open(STDIN, "<$listfile");
+ while (<STDIN>) {
+ chomp;
+ $line = $_;
+ # line is non-empty and not a comment
+ if ((length($line) > 0) && ($line =~ /^\s*[^\s#]/ )) {
+ $exceptions{trim($line)} = 1;
+ }
+ }
+ }
+}
+
+# Return 1 if the test is found in the exception set, 0 otherwise.
+sub is_exception {
+ my($file) = @_;
+ my($i) = -1;
+
+ if (scalar(keys(%exceptions)) == 0) {
+ return 0;
+ }
+
+ # hash absolute pathname after $dt_tst/
+ $file = abs_path($file);
+ $i = index($file, $dt_tst);
+ if ($i == 0) {
+ $file = substr($file, length($dt_tst) + 1);
+ return $exceptions{$file};
+ }
+ return 0;
+}
+
+#
+# Iterate over the set of test files specified on the command-line or by a find
+# on "$defdir/common", "$defdir/$MACH" and "$defdir/$PLATFORM" and execute each
+# one. If the test file is executable, we fork and exec it. If the test is a
+# .ksh file, we run it with $ksh_path. Otherwise we run dtrace -s on it. If
+# the file is named tst.* we assume it should return exit status 0. If the
+# file is named err.* we assume it should return exit status 1. If the file is
+# named err.D_[A-Z0-9]+[.*].d we use dtrace -xerrtags and examine stderr to
+# ensure that a matching error tag was produced. If the file is named
+# drp.[A-Z0-9]+[.*].d we use dtrace -xdroptags and examine stderr to ensure
+# that a matching drop tag was produced. If any *.out or *.err files are found
+# we perform output comparisons.
+#
+# run_tests takes two arguments: The first is the pathname of the dtrace
+# command to invoke when running the tests. The second is the pathname
+# of a file (may be the empty string) listing tests that ought to be
+# skipped (skipped tests are listed as paths relative to $dt_tst, for
+# example: common/aggs/tst.neglquant.d).
+#
+sub run_tests {
+ my($dtrace, $exceptions_path) = @_;
+ my($passed) = 0;
+ my($bypassed) = 0;
+ my($failed) = $errs;
+ my($total) = 0;
+
+ die "$PNAME: $dtrace not found\n" unless (-x "$dtrace");
+ logmsg($dtrace . "\n");
+
+ load_exceptions($exceptions_path);
+
+ foreach $file (sort @files) {
+ $file =~ m:.*/((.*)\.(\w+)):;
+ $name = $1;
+ $base = $2;
+ $ext = $3;
+
+ $dir = dirname($file);
+ $isksh = 0;
+ $tag = 0;
+ $droptag = 0;
+
+ if ($name =~ /^tst\./) {
+ $isksh = ($ext eq 'ksh');
+ $status = 0;
+ } elsif ($name =~ /^err\.(D_[A-Z0-9_]+)\./) {
+ $status = 1;
+ $tag = $1;
+ } elsif ($name =~ /^err\./) {
+ $status = 1;
+ } elsif ($name =~ /^drp\.([A-Z0-9_]+)\./) {
+ $status = 0;
+ $droptag = $1;
+ } else {
+ errmsg("ERROR: $file is not a valid test file name\n");
+ next;
+ }
+
+ $fullname = "$dir/$name";
+ $exe = "./$base.exe";
+ $exe_pid = -1;
+
+ if ($opt_a && ($status != 0 || $tag != 0 || $droptag != 0 ||
+ -x $exe || $isksh || -x $fullname)) {
+ $bypassed++;
+ next;
+ }
+
+ if (!$opt_f && is_exception("$dir/$name")) {
+ $bypassed++;
+ next;
+ }
+
+ if (!$isksh && -x $exe) {
+ if (($exe_pid = fork()) == -1) {
+ errmsg(
+ "ERROR: failed to fork to run $exe: $!\n");
+ next;
+ }
+
+ if ($exe_pid == 0) {
+ open(STDIN, '</dev/null');
+
+ exec($exe);
+
+ warn "ERROR: failed to exec $exe: $!\n";
+ }
+ }
+
+ logmsg("testing $file ... ");
+
+ if (($pid = fork()) == -1) {
+ errmsg("ERROR: failed to fork to run test $file: $!\n");
+ next;
+ }
+
+ if ($pid == 0) {
+ open(STDIN, '</dev/null');
+ exit(125) unless open(STDOUT, ">$opt_d/$$.out");
+ exit(125) unless open(STDERR, ">$opt_d/$$.err");
+
+ unless (chdir($dir)) {
+ warn "ERROR: failed to chdir for $file: $!\n";
+ exit(126);
+ }
+
+ push(@dtrace_argv, '-xerrtags') if ($tag);
+ push(@dtrace_argv, '-xdroptags') if ($droptag);
+ push(@dtrace_argv, $exe_pid) if ($exe_pid != -1);
+
+ if ($isksh) {
+ exit(123) unless open(STDIN, "<$name");
+ exec("$ksh_path /dev/stdin $dtrace");
+ } elsif (-x $name) {
+ warn "ERROR: $name is executable\n";
+ exit(1);
+ } else {
+ if ($tag == 0 && $status == $0 && $opt_a) {
+ push(@dtrace_argv, '-A');
+ }
+
+ push(@dtrace_argv, '-C');
+ push(@dtrace_argv, '-s');
+ push(@dtrace_argv, $name);
+ exec($dtrace, @dtrace_argv);
+ }
+
+ warn "ERROR: failed to exec for $file: $!\n";
+ exit(127);
+ }
+
+ if (waitpid($pid, 0) == -1) {
+ errmsg("ERROR: timed out waiting for $file\n");
+ kill(9, $exe_pid) if ($exe_pid != -1);
+ kill(9, $pid);
+ next;
+ }
+
+ kill(9, $exe_pid) if ($exe_pid != -1);
+
+ if ($tag == 0 && $status == $0 && $opt_a) {
+ #
+ # We can chuck the earler output.
+ #
+ unlink($pid . '.out');
+ unlink($pid . '.err');
+
+ #
+ # This is an anonymous enabling. We need to get
+ # the module unloaded.
+ #
+ system("dtrace -ae 1> /dev/null 2> /dev/null");
+ system("svcadm disable -s " .
+ "svc:/network/nfs/mapid:default");
+ system("modunload -i 0 ; modunload -i 0 ; " .
+ "modunload -i 0");
+ if (!system("modinfo | grep dtrace")) {
+ warn "ERROR: couldn't unload dtrace\n";
+ system("svcadm enable " .
+ "-s svc:/network/nfs/mapid:default");
+ exit(124);
+ }
+
+ #
+ # DTrace is gone. Now update_drv(1M), and rip
+ # everything out again.
+ #
+ system("update_drv dtrace");
+ system("dtrace -ae 1> /dev/null 2> /dev/null");
+ system("modunload -i 0 ; modunload -i 0 ; " .
+ "modunload -i 0");
+ if (!system("modinfo | grep dtrace")) {
+ warn "ERROR: couldn't unload dtrace\n";
+ system("svcadm enable " .
+ "-s svc:/network/nfs/mapid:default");
+ exit(124);
+ }
+
+ #
+ # Now bring DTrace back in.
+ #
+ system("sync ; sync");
+ system("dtrace -l -n bogusprobe 1> /dev/null " .
+ "2> /dev/null");
+ system("svcadm enable -s " .
+ "svc:/network/nfs/mapid:default");
+
+ #
+ # That should have caused DTrace to reload with
+ # the new configuration file. Now we can try to
+ # snag our anonymous state.
+ #
+ if (($pid = fork()) == -1) {
+ errmsg("ERROR: failed to fork to run " .
+ "test $file: $!\n");
+ next;
+ }
+
+ if ($pid == 0) {
+ open(STDIN, '</dev/null');
+ exit(125) unless open(STDOUT, ">$opt_d/$$.out");
+ exit(125) unless open(STDERR, ">$opt_d/$$.err");
+
+ push(@dtrace_argv, '-a');
+
+ unless (chdir($dir)) {
+ warn "ERROR: failed to chdir " .
+ "for $file: $!\n";
+ exit(126);
+ }
+
+ exec($dtrace, @dtrace_argv);
+ warn "ERROR: failed to exec for $file: $!\n";
+ exit(127);
+ }
+
+ if (waitpid($pid, 0) == -1) {
+ errmsg("ERROR: timed out waiting for $file\n");
+ kill(9, $pid);
+ next;
+ }
+ }
+
+ logmsg("[$pid]\n");
+ $wstat = $?;
+ $wifexited = ($wstat & 0xFF) == 0;
+ $wexitstat = ($wstat >> 8) & 0xFF;
+ $wtermsig = ($wstat & 0x7F);
+
+ if (!$wifexited) {
+ fail("died from signal $wtermsig");
+ next;
+ }
+
+ if ($wexitstat == 125) {
+ die "$PNAME: failed to create output file in $opt_d " .
+ "(cd elsewhere or use -d)\n";
+ }
+
+ if ($wexitstat != $status) {
+ fail("returned $wexitstat instead of $status");
+ next;
+ }
+
+ if (-f "$file.out" &&
+ system("cmp -s $file.out $opt_d/$pid.out") != 0) {
+ fail("stdout mismatch", "$pid.out");
+ next;
+ }
+
+ if (-f "$file.err" &&
+ system("cmp -s $file.err $opt_d/$pid.err") != 0) {
+ fail("stderr mismatch: see $pid.err");
+ next;
+ }
+
+ if ($tag) {
+ open(TSTERR, "<$opt_d/$pid.err");
+ $tsterr = <TSTERR>;
+ close(TSTERR);
+
+ unless ($tsterr =~ /: \[$tag\] line \d+:/) {
+ fail("errtag mismatch: see $pid.err");
+ next;
+ }
+ }
+
+ if ($droptag) {
+ $found = 0;
+ open(TSTERR, "<$opt_d/$pid.err");
+
+ while (<TSTERR>) {
+ if (/\[$droptag\] /) {
+ $found = 1;
+ last;
+ }
+ }
+
+ close (TSTERR);
+
+ unless ($found) {
+ fail("droptag mismatch: see $pid.err");
+ next;
+ }
+ }
+
+ unless ($opt_s) {
+ unlink($pid . '.out');
+ unlink($pid . '.err');
+ }
+ }
+
+ if ($opt_a) {
+ #
+ # If we're running with anonymous enablings, we need to
+ # restore the .conf file.
+ #
+ system("dtrace -A 1> /dev/null 2> /dev/null");
+ system("dtrace -ae 1> /dev/null 2> /dev/null");
+ system("modunload -i 0 ; modunload -i 0 ; modunload -i 0");
+ system("update_drv dtrace");
+ }
+
+ $total = scalar(@files);
+ $failed = $errs - $failed;
+ $passed = ($total - $failed - $bypassed);
+ $results{$dtrace} = {
+ "passed" => $passed,
+ "bypassed" => $bypassed,
+ "failed" => $failed,
+ "total" => $total
+ };
+}
+
+die $USAGE unless (getopts($OPTSTR));
+usage() if ($opt_h);
+
+foreach $arg (@ARGV) {
+ if (-f $arg) {
+ push(@files, $arg);
+ } elsif (-d $arg) {
+ find(\&wanted, $arg);
+ } else {
+ die "$PNAME: $arg is not a valid file or directory\n";
+ }
+}
+
+$dt_tst = '/opt/SUNWdtrt/tst';
+$dt_bin = '/opt/SUNWdtrt/bin';
+$defdir = -d $dt_tst ? $dt_tst : '.';
+$bindir = -d $dt_bin ? $dt_bin : '.';
+
+find(\&wanted, "$defdir/common") if (scalar(@ARGV) == 0);
+find(\&wanted, "$defdir/$MACH") if (scalar(@ARGV) == 0);
+find(\&wanted, "$defdir/$PLATFORM") if (scalar(@ARGV) == 0);
+die $USAGE if (scalar(@files) == 0);
+
+$dtrace_path = '/usr/sbin/dtrace';
+$jdtrace_path = "$bindir/jdtrace";
+
+%exception_lists = ("$jdtrace_path" => "$bindir/exception.lst");
+
+if ($opt_j || $opt_n || $opt_i) {
+ @dtrace_cmds = ();
+ push(@dtrace_cmds, $dtrace_path) if ($opt_n);
+ push(@dtrace_cmds, $jdtrace_path) if ($opt_j);
+ push(@dtrace_cmds, "/usr/sbin/$opt_i/dtrace") if ($opt_i);
+} else {
+ @dtrace_cmds = ($dtrace_path, $jdtrace_path);
+}
+
+if ($opt_d) {
+ die "$PNAME: -d arg must be absolute path\n" unless ($opt_d =~ /^\//);
+ die "$PNAME: -d arg $opt_d is not a directory\n" unless (-d "$opt_d");
+ system("coreadm -p $opt_d/%p.core");
+} else {
+ my $dir = getcwd;
+ system("coreadm -p $dir/%p.core");
+ $opt_d = '.';
+}
+
+if ($opt_x) {
+ push(@dtrace_argv, '-x');
+ push(@dtrace_argv, $opt_x);
+}
+
+die "$PNAME: failed to open $PNAME.$$.log: $!\n"
+ unless (!$opt_l || open(LOG, ">$PNAME.$$.log"));
+
+$ENV{'DTRACE_DEBUG_REGSET'} = 'true';
+
+if ($opt_g) {
+ $ENV{'UMEM_DEBUG'} = 'default,verbose';
+ $ENV{'UMEM_LOGGING'} = 'fail,contents';
+ $ENV{'LD_PRELOAD'} = 'libumem.so';
+}
+
+#
+# Ensure that $PATH contains a cc(1) so that we can execute the
+# test programs that require compilation of C code.
+#
+#$ENV{'PATH'} = $ENV{'PATH'} . ':/ws/onnv-tools/SUNWspro/SS11/bin';
+
+if ($opt_b) {
+ logmsg("badioctl'ing ... ");
+
+ if (($badioctl = fork()) == -1) {
+ errmsg("ERROR: failed to fork to run badioctl: $!\n");
+ next;
+ }
+
+ if ($badioctl == 0) {
+ open(STDIN, '</dev/null');
+ exit(125) unless open(STDOUT, ">$opt_d/$$.out");
+ exit(125) unless open(STDERR, ">$opt_d/$$.err");
+
+ exec($bindir . "/badioctl");
+ warn "ERROR: failed to exec badioctl: $!\n";
+ exit(127);
+ }
+
+
+ logmsg("[$badioctl]\n");
+
+ #
+ # If we're going to be bad, we're just going to iterate over each
+ # test file.
+ #
+ foreach $file (sort @files) {
+ ($name = $file) =~ s:.*/::;
+ $dir = dirname($file);
+
+ if (!($name =~ /^tst\./ && $name =~ /\.d$/)) {
+ next;
+ }
+
+ logmsg("baddof'ing $file ... ");
+
+ if (($pid = fork()) == -1) {
+ errmsg("ERROR: failed to fork to run baddof: $!\n");
+ next;
+ }
+
+ if ($pid == 0) {
+ open(STDIN, '</dev/null');
+ exit(125) unless open(STDOUT, ">$opt_d/$$.out");
+ exit(125) unless open(STDERR, ">$opt_d/$$.err");
+
+ unless (chdir($dir)) {
+ warn "ERROR: failed to chdir for $file: $!\n";
+ exit(126);
+ }
+
+ exec($bindir . "/baddof", $name);
+
+ warn "ERROR: failed to exec for $file: $!\n";
+ exit(127);
+ }
+
+ sleep 60;
+ kill(9, $pid);
+ waitpid($pid, 0);
+
+ logmsg("[$pid]\n");
+
+ unless ($opt_s) {
+ unlink($pid . '.out');
+ unlink($pid . '.err');
+ }
+ }
+
+ kill(9, $badioctl);
+ waitpid($badioctl, 0);
+
+ unless ($opt_s) {
+ unlink($badioctl . '.out');
+ unlink($badioctl . '.err');
+ }
+
+ exit(0);
+}
+
+#
+# Run all the tests specified on the command-line (the entire test suite
+# by default) once for each dtrace command tested, skipping any tests
+# not valid for that command.
+#
+foreach $dtrace_cmd (@dtrace_cmds) {
+ run_tests($dtrace_cmd, $exception_lists{$dtrace_cmd});
+}
+
+$opt_q = 0; # force final summary to appear regardless of -q option
+
+logmsg("\n==== TEST RESULTS ====\n");
+foreach $key (keys %results) {
+ my $passed = $results{$key}{"passed"};
+ my $bypassed = $results{$key}{"bypassed"};
+ my $failed = $results{$key}{"failed"};
+ my $total = $results{$key}{"total"};
+
+ logmsg("\n mode: " . $key . "\n");
+ logmsg(" passed: " . $passed . "\n");
+ if ($bypassed) {
+ logmsg(" bypassed: " . $bypassed . "\n");
+ }
+ logmsg(" failed: " . $failed . "\n");
+ logmsg(" total: " . $total . "\n");
+}
+
+exit($errs != 0);
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_FUNC.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_FUNC.bad.d
new file mode 100644
index 000000000000..d12454be4eb5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_FUNC.bad.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * An aggregation must call an aggregating function.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+
+ @counts["xyz"] = breakpoint();
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_MDIM.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_MDIM.bad.d
new file mode 100644
index 000000000000..2c47289b54b5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_MDIM.bad.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * An aggregation may not be used as a multi-dimensional array
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+
+ @counts[0][2] = count();
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_NULL.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_NULL.bad.d
new file mode 100644
index 000000000000..87d18187c3f0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_NULL.bad.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * An aggregation must have an aggregating function applied.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+
+ @a[1];
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_REDEF.redef.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_REDEF.redef.d
new file mode 100644
index 000000000000..9b4b425e4929
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_REDEF.redef.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test redefining the aggregation
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a = count();
+}
+
+END
+{
+ @a = max(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.avgtoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.avgtoofew.d
new file mode 100644
index 000000000000..106f4cdebc41
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.avgtoofew.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * avg() should not accept a non-scalar value
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a[pid] = avg(probefunc);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.maxnoarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.maxnoarg.d
new file mode 100644
index 000000000000..181e1962febd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.maxnoarg.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * max() should not accept a non-scalar value
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+BEGIN
+{
+ @a[pid] = max(probefunc);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.mintoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.mintoofew.d
new file mode 100644
index 000000000000..3ca34ffbc1c0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.mintoofew.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * min() should not accept a non-scalar value
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[pid] = min(probefunc);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.quantizetoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.quantizetoofew.d
new file mode 100644
index 000000000000..b7464552eb13
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.quantizetoofew.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * quantize() should not accept a non-scalar value
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[pid] = quantize(probefunc);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d
new file mode 100644
index 000000000000..262040f1b820
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * stddev() should not accept a non-scalar value
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a[pid] = stddev(probefunc);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.sumtoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.sumtoofew.d
new file mode 100644
index 000000000000..a77a2d5d2e08
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.sumtoofew.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * sum() should not accept a non-scalar value
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[pid] = sum(probefunc);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_AGGARG.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_AGGARG.bad.d
new file mode 100644
index 000000000000..0e6060ae95c4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_AGGARG.bad.d
@@ -0,0 +1,77 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * The argument to clear() must be an aggregation.
+ *
+ * SECTION: Aggregations/Clearing aggregations
+ *
+ *
+ */
+
+#pragma D option quiet
+#pragma D option aggrate=10ms
+#pragma D option switchrate=10ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i < 20/
+{
+ @func[i%5] = sum(i * 100);
+ i++;
+}
+
+tick-100ms
+/i == 10/
+{
+ printf("Aggregation data before clear():\n");
+ printa(@func);
+
+ clear(count());
+
+ printf("Aggregation data after clear():\n");
+ printa(@func);
+ i++;
+}
+
+tick-100ms
+/i == 20/
+{
+ printf("Final aggregation data:\n");
+ printa(@func);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_PROTO.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_PROTO.bad.d
new file mode 100644
index 000000000000..57fa8841389c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_PROTO.bad.d
@@ -0,0 +1,77 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * clear() should handle no args as an error.
+ *
+ * SECTION: Aggregations/Clearing aggregations
+ *
+ *
+ */
+
+#pragma D option quiet
+#pragma D option aggrate=10ms
+#pragma D option switchrate=10ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i < 20/
+{
+ @func[i%5] = sum(i * 100);
+ i++;
+}
+
+tick-100ms
+/i == 10/
+{
+ printf("Aggregation data before clear():\n");
+ printa(@func);
+
+ clear();
+
+ printf("Aggregation data after clear():\n");
+ printa(@func);
+ i++;
+}
+
+tick-100ms
+/i == 20/
+{
+ printf("Final aggregation data:\n");
+ printa(@func);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_IDENT.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_IDENT.bad.d
new file mode 100644
index 000000000000..866a7acf3b0e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_IDENT.bad.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * An aggregation must call an aggregating function, not a probe
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+
+ @counts[0][2] = tick-1();
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_UNDEF.badaggfunc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_UNDEF.badaggfunc.d
new file mode 100644
index 000000000000..65c12da4990a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_UNDEF.badaggfunc.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the use of a non-supported aggregate function.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+
+
+BEGIN
+{
+ @counts["badtest"] = foo();
+
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badexpr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badexpr.d
new file mode 100644
index 000000000000..83e6ab796c59
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badexpr.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test using an aggregation in an expression context.
+ * This should result in a compile-time error.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ trace(@a + 3);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badkey3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badkey3.d
new file mode 100644
index 000000000000..67c5b64e4bd5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badkey3.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the use of a dynamic expression as an aggregation key.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+
+BEGIN
+{
+ @t[i] = count();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.noeffect.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.noeffect.d
new file mode 100644
index 000000000000..9bdff78921df
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.noeffect.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test compiling an aggregation statement that has no effect.
+ * This should result in a compile-time error.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey1.d
new file mode 100644
index 000000000000..abf3dd8c552d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey1.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the use of a void expression as an aggregation key.
+ * This should result in a compile-time error.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[1, (void)0] = count();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey2.d
new file mode 100644
index 000000000000..9490b821f6ee
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey2.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the use of a dynamic expression as an aggregation key.
+ * This should result in a compile-time error.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[0] = count();
+ @b[@a] = count();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey4.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey4.d
new file mode 100644
index 000000000000..057746eb9da1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey4.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Test the use of a dynamic expression as an aggregation key.
+ * This should result in a compile-time error.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+
+BEGIN
+{
+ @a[curpsinfo] = count();
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqbad1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqbad1.d
new file mode 100644
index 000000000000..6bb6765a7f4e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqbad1.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * lquantize() lower bound around must be an integer constant
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+
+BEGIN
+{
+ x = 'a';
+ @a[1] = lquantize(timestamp, x, 1000, 1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqshort.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqshort.d
new file mode 100644
index 000000000000..6bb6765a7f4e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqshort.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * lquantize() lower bound around must be an integer constant
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+
+BEGIN
+{
+ x = 'a';
+ @a[1] = lquantize(timestamp, x, 1000, 1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASEVAL.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASEVAL.bad.d
new file mode 100644
index 000000000000..23d318e75a22
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASEVAL.bad.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * lquantize() lower bound must be a 32-bit quantity
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[1] = lquantize(timestamp, 2147483657, 1000, 1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMTYPE.lqbad1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMTYPE.lqbad1.d
new file mode 100644
index 000000000000..894f064a4a6b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMTYPE.lqbad1.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * lquantize() upper bound around must be an integer constant
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+
+BEGIN
+{
+ x = 'a';
+ @a[1] = lquantize(timestamp, 100, rand(), 1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMVAL.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMVAL.bad.d
new file mode 100644
index 000000000000..0a2f5e7f0796
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMVAL.bad.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * lquantize() upper bound around must be an integer constant
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ x = 'a';
+ @a[1] = lquantize(timestamp, 100, 2147483657, 1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.d
new file mode 100644
index 000000000000..b93ffabf88c1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.d
@@ -0,0 +1,33 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @ = lquantize(0, 10, 20, 1);
+ @ = lquantize(0, 15, 20, 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.order.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.order.d
new file mode 100644
index 000000000000..763c1e0b793f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.order.d
@@ -0,0 +1,33 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @ = lquantize(0, 10, 20, 1);
+ @ = lquantize(0, 15, 30, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.d
new file mode 100644
index 000000000000..d9ba023e4fa9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.d
@@ -0,0 +1,33 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @ = lquantize(0, 10, 20, 1);
+ @ = lquantize(0, 10, 2000, 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.order.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.order.d
new file mode 100644
index 000000000000..62be0c5b27b0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.order.d
@@ -0,0 +1,33 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @ = lquantize(0, 10, 20, 1);
+ @ = lquantize(0, 10, 2000, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHSTEP.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHSTEP.d
new file mode 100644
index 000000000000..086f4392f3d3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHSTEP.d
@@ -0,0 +1,33 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @ = lquantize(0, 10, 20, 1);
+ @ = lquantize(0, 10, 20, 2);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MISMATCH.lqbadarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MISMATCH.lqbadarg.d
new file mode 100644
index 000000000000..a4444ad11b8d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MISMATCH.lqbadarg.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Upper bound must be greater than lower bound argument
+ *
+ * SECTION: Aggregations/Aggregations
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-1
+/i < 1000/
+{
+ @a[i] = lquantize(i, 1100, -100, -100 );
+ i += 100;
+}
+
+tick-1
+/i == 1000/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPLARGE.lqtoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPLARGE.lqtoofew.d
new file mode 100644
index 000000000000..664f70f29341
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPLARGE.lqtoofew.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * lquantize() should not accept more than 4 arguments.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[1] = lquantize(1, 2, 3, 4, 5);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPSMALL.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPSMALL.bad.d
new file mode 100644
index 000000000000..634e8c06a81d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPSMALL.bad.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Number of quantization levels must be a 16-bit quantity
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 1000/
+{
+ @a[i] = lquantize(i, 0, 1000000, 10);
+ i += 100;
+}
+
+tick-10ms
+/i == 1000/
+{
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPTYPE.lqbadinc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPTYPE.lqbadinc.d
new file mode 100644
index 000000000000..87c51273a7c5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPTYPE.lqbadinc.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Upper bound must be greater than lower bound argument
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-1
+/i < 1000/
+{
+ @a[i] = lquantize(i, 0, 1100, -100);
+ i += 100;
+}
+
+tick-1
+/i == 1000/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPVAL.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPVAL.bad.d
new file mode 100644
index 000000000000..a90d7571ac6a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPVAL.bad.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * lquantize() step value should be a 16-bit quantity
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 1000/
+{
+ @a[i] = lquantize(i, 100, 1100, 200000 );
+ i += 100;
+}
+
+tick-10ms
+/i == 1000/
+{
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_AGGARG.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_AGGARG.bad.d
new file mode 100644
index 000000000000..7e5974c5b7ca
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_AGGARG.bad.d
@@ -0,0 +1,65 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * The first argument to normalize() should be an aggregation.
+ *
+ * SECTION: Aggregations/Clearing aggregations
+ *
+ *
+ */
+
+
+#pragma D option quiet
+#pragma D option aggrate=1ms
+#pragma D option switchrate=1ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i < 20/
+{
+ @func[i % 5] = sum(i * 100);
+ i++;
+}
+
+tick-100ms
+/i == 20/
+{
+
+ printf("normalized data:\n");
+ normalize(count(), 4);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_PROTO.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_PROTO.bad.d
new file mode 100644
index 000000000000..82d819d4c02a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_PROTO.bad.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * normalize() accepts 2 args - passing fewer is an error.
+ *
+ * SECTION: Aggregations/Clearing aggregations
+ *
+ *
+ */
+
+
+#pragma D option quiet
+#pragma D option aggrate=1ms
+#pragma D option switchrate=1ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i < 20/
+{
+ @func[i % 5] = sum(i * 100);
+ i++;
+}
+
+tick-100ms
+/i == 20/
+{
+ printf("normalized data:\n");
+ normalize(@func);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_SCALAR.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_SCALAR.bad.d
new file mode 100644
index 000000000000..14a258648e5a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_SCALAR.bad.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * The second argument to normalize() should be a scalar.
+ *
+ * SECTION: Aggregations/Clearing aggregations
+ *
+ *
+ */
+
+
+#pragma D option quiet
+#pragma D option aggrate=1ms
+#pragma D option switchrate=1ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i < 20/
+{
+ @func[i % 5] = sum(i * 100);
+ i++;
+}
+
+tick-100ms
+/i == 20/
+{
+ printf("normalized data:\n");
+ normalize(@func, "hello");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_ARG.lquantizetoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_ARG.lquantizetoofew.d
new file mode 100644
index 000000000000..db4567f8e851
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_ARG.lquantizetoofew.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * lquantize() should not accept a non-scalar value
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[pid] = lquantize(probefunc, probefunc, probefunc, probefunc);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgnoarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgnoarg.d
new file mode 100644
index 000000000000..628eeabaccf0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgnoarg.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * avg() should not accept a call with no arguments
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a[1] = avg();
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgtoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgtoomany.d
new file mode 100644
index 000000000000..42e5c1cc91ca
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgtoomany.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * avg() should not more than one argument
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a[1] = avg(1, 2);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.counttoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.counttoomany.d
new file mode 100644
index 000000000000..5dc5b800bf2c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.counttoomany.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * count() should not accept any arguments
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a["badtest"] = count(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizenoarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizenoarg.d
new file mode 100644
index 000000000000..ae4b67247216
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizenoarg.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * lquantize() should not accept a call with no arguments
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[1] = lquantize();
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizetoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizetoomany.d
new file mode 100644
index 000000000000..bf87a4688c1c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizetoomany.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * lquantize() should not have more than five (!) arguments
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @[1] = lquantize(10, 0, 100, 1, 10, 20);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxnoarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxnoarg.d
new file mode 100644
index 000000000000..aad2c2498daf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxnoarg.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * max() should not accept a call with no arguments
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[1] = max();
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxtoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxtoomany.d
new file mode 100644
index 000000000000..d0fb0918c346
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxtoomany.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * max() should not more than one argument
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[1] = max(1, 2);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.minnoarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.minnoarg.d
new file mode 100644
index 000000000000..09db51f2265a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.minnoarg.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * min() should not accept a call with no arguments
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[1] = min();
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.mintoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.mintoomany.d
new file mode 100644
index 000000000000..2647402cb87c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.mintoomany.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * min() should not more than one argument
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[1] = min(1, 2);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizenoarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizenoarg.d
new file mode 100644
index 000000000000..b33957a232eb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizenoarg.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * quantize() should not accept a call with no arguments
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[1] = quantize();
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizetoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizetoomany.d
new file mode 100644
index 000000000000..9b162bd252f5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizetoomany.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * quantize() should not have more than two arguments
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[1] = quantize(1, 2, 3);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d
new file mode 100644
index 000000000000..2952cf50c6d2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * stddev() should not accept a call with no arguments
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a[1] = stddev();
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d
new file mode 100644
index 000000000000..c42e9628ce48
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * stddev() should not have more than one argument
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a[1] = stddev(1, 2);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumnoarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumnoarg.d
new file mode 100644
index 000000000000..4f279017bd4d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumnoarg.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * sum() should not accept a call with no arguments
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[pid] = sum();
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumtoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumtoomany.d
new file mode 100644
index 000000000000..5e899be64395
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumtoomany.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * sum() should not more than one argument
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+BEGIN
+{
+ @a[pid] = sum(1, 2);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_AGGARG.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_AGGARG.bad.d
new file mode 100644
index 000000000000..69cb729184a4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_AGGARG.bad.d
@@ -0,0 +1,35 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+int i;
+
+BEGIN
+{
+ trunc(i);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badmany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badmany.d
new file mode 100644
index 000000000000..61271a74562e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badmany.d
@@ -0,0 +1,34 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @[0] = count();
+ trunc(@, 10, 20);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badnone.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badnone.d
new file mode 100644
index 000000000000..e141e6c97880
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badnone.d
@@ -0,0 +1,33 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ trunc();
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_SCALAR.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_SCALAR.bad.d
new file mode 100644
index 000000000000..e5485766d14d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_SCALAR.bad.d
@@ -0,0 +1,34 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @[0] = count();
+ trunc(@, @);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.allquant.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.allquant.d
new file mode 100644
index 000000000000..26241b31ea4f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.allquant.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+int i;
+
+tick-10ms
+{
+ @ = quantize(1LL << i);
+ @ = quantize((1LL << i) + 1);
+ @ = quantize(-(1LL << i));
+ @ = quantize(-(1LL << i) - 1);
+ i++;
+}
+
+tick-10ms
+/i == 64/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.allquant.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.allquant.d.out
new file mode 100644
index 000000000000..356d6b46080e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.allquant.d.out
@@ -0,0 +1,131 @@
+
+
+ value ------------- Distribution ------------- count
+-4611686018427387904 |@ 5
+-2305843009213693952 | 2
+-1152921504606846976 | 2
+-576460752303423488 | 2
+-288230376151711744 | 2
+-144115188075855872 | 2
+-72057594037927936 | 2
+-36028797018963968 | 2
+-18014398509481984 | 2
+-9007199254740992 | 2
+-4503599627370496 | 2
+-2251799813685248 | 2
+-1125899906842624 | 2
+-562949953421312 | 2
+-281474976710656 | 2
+-140737488355328 | 2
+ -70368744177664 | 2
+ -35184372088832 | 2
+ -17592186044416 | 2
+ -8796093022208 | 2
+ -4398046511104 | 2
+ -2199023255552 | 2
+ -1099511627776 | 2
+ -549755813888 | 2
+ -274877906944 | 2
+ -137438953472 | 2
+ -68719476736 | 2
+ -34359738368 | 2
+ -17179869184 | 2
+ -8589934592 | 2
+ -4294967296 | 2
+ -2147483648 | 2
+ -1073741824 | 2
+ -536870912 | 2
+ -268435456 | 2
+ -134217728 | 2
+ -67108864 | 2
+ -33554432 | 2
+ -16777216 | 2
+ -8388608 | 2
+ -4194304 | 2
+ -2097152 | 2
+ -1048576 | 2
+ -524288 | 2
+ -262144 | 2
+ -131072 | 2
+ -65536 | 2
+ -32768 | 2
+ -16384 | 2
+ -8192 | 2
+ -4096 | 2
+ -2048 | 2
+ -1024 | 2
+ -512 | 2
+ -256 | 2
+ -128 | 2
+ -64 | 2
+ -32 | 2
+ -16 | 2
+ -8 | 2
+ -4 | 2
+ -2 | 3
+ -1 | 1
+ 0 | 0
+ 1 | 1
+ 2 | 3
+ 4 | 2
+ 8 | 2
+ 16 | 2
+ 32 | 2
+ 64 | 2
+ 128 | 2
+ 256 | 2
+ 512 | 2
+ 1024 | 2
+ 2048 | 2
+ 4096 | 2
+ 8192 | 2
+ 16384 | 2
+ 32768 | 2
+ 65536 | 2
+ 131072 | 2
+ 262144 | 2
+ 524288 | 2
+ 1048576 | 2
+ 2097152 | 2
+ 4194304 | 2
+ 8388608 | 2
+ 16777216 | 2
+ 33554432 | 2
+ 67108864 | 2
+ 134217728 | 2
+ 268435456 | 2
+ 536870912 | 2
+ 1073741824 | 2
+ 2147483648 | 2
+ 4294967296 | 2
+ 8589934592 | 2
+ 17179869184 | 2
+ 34359738368 | 2
+ 68719476736 | 2
+ 137438953472 | 2
+ 274877906944 | 2
+ 549755813888 | 2
+ 1099511627776 | 2
+ 2199023255552 | 2
+ 4398046511104 | 2
+ 8796093022208 | 2
+ 17592186044416 | 2
+ 35184372088832 | 2
+ 70368744177664 | 2
+ 140737488355328 | 2
+ 281474976710656 | 2
+ 562949953421312 | 2
+1125899906842624 | 2
+2251799813685248 | 2
+4503599627370496 | 2
+9007199254740992 | 2
+18014398509481984 | 2
+36028797018963968 | 2
+72057594037927936 | 2
+144115188075855872 | 2
+288230376151711744 | 2
+576460752303423488 | 2
+1152921504606846976 | 2
+2305843009213693952 | 2
+4611686018427387904 | 3
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg.d
new file mode 100644
index 000000000000..a4bfd3cd213d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Positive avg() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES: This is a simple verifiable positive test of the avg() function.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 1000/
+{
+ @a = avg(i);
+ i += 100;
+}
+
+tick-10ms
+/i == 1000/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg.d.out
new file mode 100644
index 000000000000..e3c0687d05d5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg.d.out
@@ -0,0 +1,2 @@
+
+ 450
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d
new file mode 100644
index 000000000000..5c1e77d124e7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Positive avg() test using negative values
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES: This is a simple verifiable positive test of the avg() function.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @ = avg(0);
+ @ = avg(-900);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d.out
new file mode 100644
index 000000000000..3fafcd452ac7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d.out
@@ -0,0 +1,2 @@
+
+ -450
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clear.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clear.d
new file mode 100644
index 000000000000..2acd8ee91758
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clear.d
@@ -0,0 +1,75 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for clearing aggregations
+ *
+ * SECTION: Aggregations/Clearing aggregations
+ *
+ *
+ */
+
+#pragma D option quiet
+#pragma D option aggrate=1ms
+#pragma D option switchrate=50ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i < 20/
+{
+ @func[i%5] = sum(i * 100);
+ i++;
+}
+
+tick-100ms
+/i == 10/
+{
+ printf("Aggregation data before clear():\n");
+ printa(@func);
+
+ clear(@func);
+
+ printf("Aggregation data after clear():\n");
+ printa(@func);
+ i++;
+}
+
+tick-100ms
+/i == 20/
+{
+ printf("Final aggregation data:\n");
+ printa(@func);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clear.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clear.d.out
new file mode 100644
index 000000000000..486e4ac01a2f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clear.d.out
@@ -0,0 +1,22 @@
+Aggregation data before clear():
+
+ 0 500
+ 1 700
+ 2 900
+ 3 1100
+ 4 1300
+Aggregation data after clear():
+
+ 0 0
+ 1 0
+ 2 0
+ 3 0
+ 4 0
+Final aggregation data:
+
+ 0 1500
+ 1 2700
+ 2 2900
+ 3 3100
+ 4 3300
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d
new file mode 100644
index 000000000000..135e511b8d6d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Positive avg() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES:
+ * Verifies that printing a clear()'d aggregation with an avg()
+ * aggregation function doesn't cause problems.
+ *
+ */
+
+#pragma D option quiet
+
+tick-10ms
+/i++ < 5/
+{
+ @a = avg(timestamp);
+}
+
+tick-10ms
+/i == 5/
+{
+ exit(2);
+}
+
+END
+{
+ clear(@a);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d.out
new file mode 100644
index 000000000000..8d23188fd1f0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d.out
@@ -0,0 +1,2 @@
+
+ 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d
new file mode 100644
index 000000000000..0f7a9584c0c2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Positive avg() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES:
+ * Verifies that printing a clear()'d aggregation with an avg()
+ * aggregation function of 0 doesn't cause divide-by-zero problems.
+ *
+ */
+
+#pragma D option quiet
+#pragma D option switchrate=50ms
+#pragma D option aggrate=1ms
+
+tick-100ms
+/(x++ % 5) == 0/
+{
+ @time = avg(0);
+}
+
+tick-100ms
+/x > 5 && x <= 20/
+{
+ printa(" %@d\n", @time);
+ clear(@time);
+}
+
+tick-100ms
+/x > 20/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d.out
new file mode 100644
index 000000000000..7cceedda7a5f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d.out
@@ -0,0 +1,16 @@
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d
new file mode 100644
index 000000000000..7aefed038d11
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Denormalized aggregations can be cleared
+ *
+ * SECTION: Aggregations/Normalization;
+ * Aggregations/Clearing aggregations
+ *
+ */
+
+#pragma D option quiet
+#pragma D option aggrate=1ms
+#pragma D option switchrate=50ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i != 10 || i != 20/
+{
+ @func[i%5] = sum(i * 100);
+ i++;
+}
+
+tick-100ms
+/i == 10/
+{
+ printf("Denormalized data before clear:\n");
+ denormalize(@func);
+ printa(@func);
+
+ clear(@func);
+
+ printf("Aggregation data after clear:\n");
+ printa(@func);
+ i++
+}
+
+tick-100ms
+/i == 20/
+{
+ printf("Final (denormalized) aggregation data:\n");
+ denormalize(@func);
+ printa(@func);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d.out
new file mode 100644
index 000000000000..ed7f2f3493a4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d.out
@@ -0,0 +1,22 @@
+Denormalized data before clear:
+
+ 0 500
+ 1 700
+ 2 900
+ 3 1100
+ 4 1300
+Aggregation data after clear:
+
+ 0 0
+ 1 0
+ 2 0
+ 3 0
+ 4 0
+Final (denormalized) aggregation data:
+
+ 0 1500
+ 1 2700
+ 2 2900
+ 3 3100
+ 4 3300
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d
new file mode 100644
index 000000000000..2d0ff83862da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Positive lquantize()/clear() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES:
+ * Verifies that printing a clear()'d aggregation with an lquantize()
+ * aggregation function doesn't cause problems.
+ *
+ */
+
+
+#pragma D option switchrate=50ms
+#pragma D option aggrate=1ms
+#pragma D option quiet
+
+tick-100ms
+{
+ x++;
+ @a["linear"] = lquantize(x, 0, 100, 1);
+ @b["exp"] = quantize(x);
+}
+
+tick-100ms
+/(x % 5) == 0 && y++ < 5/
+{
+ printa(@a);
+ printa(@b);
+ clear(@a);
+ clear(@b);
+}
+
+tick-100ms
+/(x % 5) == 0 && y == 5/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d.out
new file mode 100644
index 000000000000..e7e2a6006530
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d.out
@@ -0,0 +1,94 @@
+
+ linear
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@ 1
+ 2 |@@@@@@@@ 1
+ 3 |@@@@@@@@ 1
+ 4 |@@@@@@@@ 1
+ 5 |@@@@@@@@ 1
+ 6 | 0
+
+
+ exp
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@ 1
+ 2 |@@@@@@@@@@@@@@@@ 2
+ 4 |@@@@@@@@@@@@@@@@ 2
+ 8 | 0
+
+
+ linear
+ value ------------- Distribution ------------- count
+ 5 | 0
+ 6 |@@@@@@@@ 1
+ 7 |@@@@@@@@ 1
+ 8 |@@@@@@@@ 1
+ 9 |@@@@@@@@ 1
+ 10 |@@@@@@@@ 1
+ 11 | 0
+
+
+ exp
+ value ------------- Distribution ------------- count
+ 2 | 0
+ 4 |@@@@@@@@@@@@@@@@ 2
+ 8 |@@@@@@@@@@@@@@@@@@@@@@@@ 3
+ 16 | 0
+
+
+ linear
+ value ------------- Distribution ------------- count
+ 10 | 0
+ 11 |@@@@@@@@ 1
+ 12 |@@@@@@@@ 1
+ 13 |@@@@@@@@ 1
+ 14 |@@@@@@@@ 1
+ 15 |@@@@@@@@ 1
+ 16 | 0
+
+
+ exp
+ value ------------- Distribution ------------- count
+ 4 | 0
+ 8 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 16 | 0
+
+
+ linear
+ value ------------- Distribution ------------- count
+ 15 | 0
+ 16 |@@@@@@@@ 1
+ 17 |@@@@@@@@ 1
+ 18 |@@@@@@@@ 1
+ 19 |@@@@@@@@ 1
+ 20 |@@@@@@@@ 1
+ 21 | 0
+
+
+ exp
+ value ------------- Distribution ------------- count
+ 8 | 0
+ 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 32 | 0
+
+
+ linear
+ value ------------- Distribution ------------- count
+ 20 | 0
+ 21 |@@@@@@@@ 1
+ 22 |@@@@@@@@ 1
+ 23 |@@@@@@@@ 1
+ 24 |@@@@@@@@ 1
+ 25 |@@@@@@@@ 1
+ 26 | 0
+
+
+ exp
+ value ------------- Distribution ------------- count
+ 8 | 0
+ 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 32 | 0
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d
new file mode 100644
index 000000000000..75cfa2d1c606
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d
@@ -0,0 +1,77 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Normalized aggregation data can be cleared
+ *
+ * SECTION: Aggregations/Normalization;
+ * Aggregations/Clearing aggregations
+ *
+ */
+
+#pragma D option quiet
+#pragma D option aggrate=1ms
+#pragma D option switchrate=50ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i < 20/
+{
+ @func[i % 5] = sum(i * 100);
+ i++;
+}
+
+tick-100ms
+/i == 10/
+{
+ printf("Normalized data before clear:\n");
+ normalize(@func, 5);
+ printa(@func);
+
+ clear(@func);
+
+ printf("Aggregation data after clear:\n");
+ printa(@func);
+ i++
+}
+
+tick-100ms
+/i == 20/
+{
+ printf("Final (normalized) aggregation data:\n");
+ normalize(@func, 5);
+ printa(@func);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d.out
new file mode 100644
index 000000000000..e568427e16c5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d.out
@@ -0,0 +1,22 @@
+Normalized data before clear:
+
+ 0 100
+ 1 140
+ 2 180
+ 3 220
+ 4 260
+Aggregation data after clear:
+
+ 0 0
+ 1 0
+ 2 0
+ 3 0
+ 4 0
+Final (normalized) aggregation data:
+
+ 0 300
+ 1 540
+ 2 580
+ 3 620
+ 4 660
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d
new file mode 100644
index 000000000000..af3ecd56a7fd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Positive stddev() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES:
+ * Verifies that printing a clear()'d aggregation with an stddev()
+ * aggregation function doesn't cause problems.
+ *
+ */
+
+#pragma D option quiet
+
+tick-10ms
+/i++ < 5/
+{
+ @a = stddev(timestamp);
+}
+
+tick-10ms
+/i == 5/
+{
+ exit(2);
+}
+
+END
+{
+ clear(@a);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out
new file mode 100644
index 000000000000..8d23188fd1f0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out
@@ -0,0 +1,2 @@
+
+ 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count.d
new file mode 100644
index 000000000000..e81d123d9881
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Postive count() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a = count();
+ @a = count();
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count.d.out
new file mode 100644
index 000000000000..d34fd3b03750
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count.d.out
@@ -0,0 +1,2 @@
+
+ 2
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count2.d
new file mode 100644
index 000000000000..624b1b4eeff9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count2.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive count() test
+ *
+ * SECTION: Aggregations/Aggregations
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i != 10/
+{
+ i++;
+ @counts["tick-count"] = count();
+}
+
+tick-10ms
+/i == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count2.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count2.d.out
new file mode 100644
index 000000000000..4998a339f8e6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count2.d.out
@@ -0,0 +1,2 @@
+
+ tick-count 10
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count3.d
new file mode 100644
index 000000000000..5913ff604c6d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count3.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test multiple count() calls.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i != 10/
+{
+ i++;
+ @counts1[execname] = count();
+ @counts2[execname, arg0] = count();
+}
+
+tick-10ms
+/i == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d
new file mode 100644
index 000000000000..37269e82d9a0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Simple denormalization test
+ *
+ * SECTION: Aggregations/Normalization
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-10ms
+/i < 20/
+{
+ @func[i % 5] = sum(i * 100);
+ i++;
+}
+
+tick-10ms
+/i == 20/
+{
+ normalize(@func, 5);
+
+ printf("denormalized:");
+ denormalize(@func);
+ printa(@func);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d.out
new file mode 100644
index 000000000000..fa4d0da79e94
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d.out
@@ -0,0 +1,7 @@
+denormalized:
+ 0 3000
+ 1 3400
+ 2 3800
+ 3 4200
+ 4 4600
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d
new file mode 100644
index 000000000000..d63a83e6f260
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * denormalize() should work even if normalize() isn't called.
+ *
+ * SECTION: Aggregations/Normalization
+ *
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-10ms
+/i < 20/
+{
+ @func[i%5] = sum(i * 100);
+ i++;
+}
+
+tick-10ms
+/i == 20/
+{
+ printf("denormalized:");
+ denormalize(@func);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d.out
new file mode 100644
index 000000000000..cc16f277b78c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d.out
@@ -0,0 +1,6 @@
+denormalized:
+ 0 3000
+ 1 3400
+ 2 3800
+ 3 4200
+ 4 4600
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d
new file mode 100644
index 000000000000..8ff3aabf2796
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for normalization() with printa()
+ *
+ * SECTION: Aggregations/Normalization
+ *
+ */
+
+#pragma D option quiet
+#pragma D option aggrate=1ms
+#pragma D option switchrate=50ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i < 20/
+{
+ @func[i % 5] = sum(i * 100);
+ i++;
+}
+
+tick-100ms
+/i == 20/
+{
+ printf("normalized data:\n");
+ normalize(@func, 5);
+ printa("%u %@u\n", @func);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d.out
new file mode 100644
index 000000000000..bbf345be29d7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d.out
@@ -0,0 +1,7 @@
+normalized data:
+0 600
+1 680
+2 760
+3 840
+4 920
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.forms.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.forms.d
new file mode 100644
index 000000000000..2b08a12d5ede
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.forms.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive aggregation test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a = count();
+ @b = max(1);
+ @c[0] = count();
+ @d[0] = max(1);
+
+ printa("\n@a = %@u\n", @a);
+ printa("@b = %@u\n", @b);
+ printa("@c = %@u\n", @c);
+ printa("@d = %@u\n", @d);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.forms.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.forms.d.out
new file mode 100644
index 000000000000..1f31450d34a5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.forms.d.out
@@ -0,0 +1,6 @@
+
+@a = 1
+@b = 1
+@c = 1
+@d = 1
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.goodkey.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.goodkey.d
new file mode 100644
index 000000000000..46becd56eff6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.goodkey.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive aggregation key test
+ *
+ * SECTION: Aggregations/Aggregations
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i != 5/
+{
+ i++;
+ @counts[execname, pid, id, tid, arg0, vtimestamp ] = count();
+
+}
+
+tick-10ms
+/i == 5/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.keysort.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.keysort.d
new file mode 100644
index 000000000000..dbc8b6d27002
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.keysort.d
@@ -0,0 +1,108 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+ j = 0;
+
+ @tour["Ghent", i++, j] = sum(5 - j);
+ j++;
+
+ @tour["Berlin", i++, j] = sum(5 - j);
+ j++;
+
+ @tour["London", i++, j] = sum(5 - j);
+ @tour["Dublin", i++, j] = sum(5 - j);
+ j++;
+
+ @tour["Shanghai", i++, j] = sum(5 - j);
+ j++;
+
+ @tour["Zurich", i++, j] = sum(5 - j);
+ j++;
+
+ @tour["Regina", i++, j] = sum(5 - j);
+ @tour["Winnipeg", i++, j] = sum(5 - j);
+ @tour["Edmonton", i++, j] = sum(5 - j);
+ @tour["Calgary", i++, j] = sum(5 - j);
+ @tour["Vancouver", i++, j] = sum(5 - j);
+ @tour["Victoria", i++, j] = sum(5 - j);
+ j++;
+
+ @tour["Prague", i++, j] = sum(5 - j);
+ @tour["London", i++, j] = sum(5 - j);
+ j++;
+
+ @tour["Brisbane", i++, j] = sum(5 - j);
+ @tour["Sydney", i++, j] = sum(5 - j);
+ @tour["Melbourne", i++, j] = sum(5 - j);
+ j++;
+
+ setopt("aggsortkey", "false");
+ setopt("aggsortkeypos", "0");
+ @tour["Amsterdam", i++, j] = sum(5 - j);
+
+ printf("By value:\n");
+ printa("%20s %8d %8d %8@d\n", @tour);
+
+ setopt("aggsortkey");
+ printf("\nBy key, position 0:\n");
+ printa("%20s %8d %8d %8@d\n", @tour);
+
+ setopt("aggsortkeypos", "1");
+ printf("\nBy key, position 1:\n");
+ printa("%20s %8d %8d %8@d\n", @tour);
+
+ setopt("aggsortkeypos", "2");
+ printf("\nBy key, position 2:\n");
+ printa("%20s %8d %8d %8@d\n", @tour);
+
+ setopt("aggsortkey", "false");
+ setopt("aggsortkeypos", "0");
+ setopt("aggsortrev");
+
+ printf("\nReversed by value:\n");
+ printa("%20s %8d %8d %8@d\n", @tour);
+
+ setopt("aggsortkey");
+ printf("\nReversed by key, position 0:\n");
+ printa("%20s %8d %8d %8@d\n", @tour);
+
+ setopt("aggsortkeypos", "1");
+ printf("\nReversed by key, position 1:\n");
+ printa("%20s %8d %8d %8@d\n", @tour);
+
+ setopt("aggsortkeypos", "2");
+ printf("\nReversed by key, position 2:\n");
+ printa("%20s %8d %8d %8@d\n", @tour);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.keysort.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.keysort.d.out
new file mode 100644
index 000000000000..250d84b92250
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.keysort.d.out
@@ -0,0 +1,160 @@
+By value:
+ Amsterdam 17 8 -3
+ Brisbane 14 7 -2
+ Melbourne 16 7 -2
+ Sydney 15 7 -2
+ London 13 6 -1
+ Prague 12 6 -1
+ Calgary 9 5 0
+ Edmonton 8 5 0
+ Regina 6 5 0
+ Vancouver 10 5 0
+ Victoria 11 5 0
+ Winnipeg 7 5 0
+ Zurich 5 4 1
+ Shanghai 4 3 2
+ Dublin 3 2 3
+ London 2 2 3
+ Berlin 1 1 4
+ Ghent 0 0 5
+
+By key, position 0:
+ Amsterdam 17 8 -3
+ Berlin 1 1 4
+ Brisbane 14 7 -2
+ Calgary 9 5 0
+ Dublin 3 2 3
+ Edmonton 8 5 0
+ Ghent 0 0 5
+ London 2 2 3
+ London 13 6 -1
+ Melbourne 16 7 -2
+ Prague 12 6 -1
+ Regina 6 5 0
+ Shanghai 4 3 2
+ Sydney 15 7 -2
+ Vancouver 10 5 0
+ Victoria 11 5 0
+ Winnipeg 7 5 0
+ Zurich 5 4 1
+
+By key, position 1:
+ Ghent 0 0 5
+ Berlin 1 1 4
+ London 2 2 3
+ Dublin 3 2 3
+ Shanghai 4 3 2
+ Zurich 5 4 1
+ Regina 6 5 0
+ Winnipeg 7 5 0
+ Edmonton 8 5 0
+ Calgary 9 5 0
+ Vancouver 10 5 0
+ Victoria 11 5 0
+ Prague 12 6 -1
+ London 13 6 -1
+ Brisbane 14 7 -2
+ Sydney 15 7 -2
+ Melbourne 16 7 -2
+ Amsterdam 17 8 -3
+
+By key, position 2:
+ Ghent 0 0 5
+ Berlin 1 1 4
+ Dublin 3 2 3
+ London 2 2 3
+ Shanghai 4 3 2
+ Zurich 5 4 1
+ Calgary 9 5 0
+ Edmonton 8 5 0
+ Regina 6 5 0
+ Vancouver 10 5 0
+ Victoria 11 5 0
+ Winnipeg 7 5 0
+ London 13 6 -1
+ Prague 12 6 -1
+ Brisbane 14 7 -2
+ Melbourne 16 7 -2
+ Sydney 15 7 -2
+ Amsterdam 17 8 -3
+
+Reversed by value:
+ Ghent 0 0 5
+ Berlin 1 1 4
+ London 2 2 3
+ Dublin 3 2 3
+ Shanghai 4 3 2
+ Zurich 5 4 1
+ Winnipeg 7 5 0
+ Victoria 11 5 0
+ Vancouver 10 5 0
+ Regina 6 5 0
+ Edmonton 8 5 0
+ Calgary 9 5 0
+ Prague 12 6 -1
+ London 13 6 -1
+ Sydney 15 7 -2
+ Melbourne 16 7 -2
+ Brisbane 14 7 -2
+ Amsterdam 17 8 -3
+
+Reversed by key, position 0:
+ Zurich 5 4 1
+ Winnipeg 7 5 0
+ Victoria 11 5 0
+ Vancouver 10 5 0
+ Sydney 15 7 -2
+ Shanghai 4 3 2
+ Regina 6 5 0
+ Prague 12 6 -1
+ Melbourne 16 7 -2
+ London 13 6 -1
+ London 2 2 3
+ Ghent 0 0 5
+ Edmonton 8 5 0
+ Dublin 3 2 3
+ Calgary 9 5 0
+ Brisbane 14 7 -2
+ Berlin 1 1 4
+ Amsterdam 17 8 -3
+
+Reversed by key, position 1:
+ Amsterdam 17 8 -3
+ Melbourne 16 7 -2
+ Sydney 15 7 -2
+ Brisbane 14 7 -2
+ London 13 6 -1
+ Prague 12 6 -1
+ Victoria 11 5 0
+ Vancouver 10 5 0
+ Calgary 9 5 0
+ Edmonton 8 5 0
+ Winnipeg 7 5 0
+ Regina 6 5 0
+ Zurich 5 4 1
+ Shanghai 4 3 2
+ Dublin 3 2 3
+ London 2 2 3
+ Berlin 1 1 4
+ Ghent 0 0 5
+
+Reversed by key, position 2:
+ Amsterdam 17 8 -3
+ Sydney 15 7 -2
+ Melbourne 16 7 -2
+ Brisbane 14 7 -2
+ Prague 12 6 -1
+ London 13 6 -1
+ Winnipeg 7 5 0
+ Victoria 11 5 0
+ Vancouver 10 5 0
+ Regina 6 5 0
+ Edmonton 8 5 0
+ Calgary 9 5 0
+ Zurich 5 4 1
+ Shanghai 4 3 2
+ London 2 2 3
+ Dublin 3 2 3
+ Berlin 1 1 4
+ Ghent 0 0 5
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d
new file mode 100644
index 000000000000..dd25f861caf2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive lquantize() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES: This is verifiable simple positive test of the lquantize() function.
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 1000/
+{
+ @a[i] = lquantize(i, -100, 1100, 100 );
+ i += 100;
+}
+
+tick-10ms
+/i == 1000/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d.out
new file mode 100644
index 000000000000..fecb4483c5ac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d.out
@@ -0,0 +1,61 @@
+
+ 0
+ value ------------- Distribution ------------- count
+ -100 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 100 | 0
+
+ 100
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 200 | 0
+
+ 200
+ value ------------- Distribution ------------- count
+ 100 | 0
+ 200 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 300 | 0
+
+ 300
+ value ------------- Distribution ------------- count
+ 200 | 0
+ 300 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 400 | 0
+
+ 400
+ value ------------- Distribution ------------- count
+ 300 | 0
+ 400 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 500 | 0
+
+ 500
+ value ------------- Distribution ------------- count
+ 400 | 0
+ 500 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 600 | 0
+
+ 600
+ value ------------- Distribution ------------- count
+ 500 | 0
+ 600 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 700 | 0
+
+ 700
+ value ------------- Distribution ------------- count
+ 600 | 0
+ 700 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 800 | 0
+
+ 800
+ value ------------- Distribution ------------- count
+ 700 | 0
+ 800 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 900 | 0
+
+ 900
+ value ------------- Distribution ------------- count
+ 800 | 0
+ 900 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1000 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d
new file mode 100644
index 000000000000..003f846f3884
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+tick-10ms
+/i++ < 10/
+{
+ @ = lquantize(i, 0, 10);
+ @ = lquantize(i, 0, 10);
+ @ = lquantize(i, 0, 10);
+ @ = lquantize(i, 0, 10);
+ @ = lquantize(i, 0, 10);
+}
+
+tick-10ms
+/i == 10/
+{
+ exit(0);
+}
+
+END
+{
+ normalize(@, 5);
+ printa(@);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d.out
new file mode 100644
index 000000000000..76b55b9c0822
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d.out
@@ -0,0 +1,16 @@
+
+
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@ 1
+ 2 |@@@@ 1
+ 3 |@@@@ 1
+ 4 |@@@@ 1
+ 5 |@@@@ 1
+ 6 |@@@@ 1
+ 7 |@@@@ 1
+ 8 |@@@@ 1
+ 9 |@@@@ 1
+ >= 10 |@@@@ 1
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d
new file mode 100644
index 000000000000..e9e671657cb7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ @["Nixon"] = lquantize(-20, -10, 10, 1, 25);
+ @["Hoover"] = lquantize(20, -10, 10, 1, -100);
+ @["Harding"] = lquantize(-10, -10, 10, 1, 15);
+ @["Bush"] = lquantize(10, -10, 10, 1, 150);
+
+ printa(@);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d.out
new file mode 100644
index 000000000000..88d3505b495a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d.out
@@ -0,0 +1,23 @@
+
+ Hoover
+ value ------------- Distribution ------------- count
+ 9 | 0
+ >= 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100
+
+ Nixon
+ value ------------- Distribution ------------- count
+ < -10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 25
+ -10 | 0
+
+ Harding
+ value ------------- Distribution ------------- count
+ < -10 | 0
+ -10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 15
+ -9 | 0
+
+ Bush
+ value ------------- Distribution ------------- count
+ 9 | 0
+ >= 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 150
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d
new file mode 100644
index 000000000000..ad609ed207da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+/*
+ * This test verifies that the height of the ASCII quantization bars is
+ * determined using rounding and not truncated integer arithmetic.
+ */
+tick-10ms
+/i++ >= 27/
+{
+ exit(0);
+}
+
+tick-10ms
+/i > 8/
+{
+ @ = lquantize(2, 0, 4);
+}
+
+tick-10ms
+/i > 2 && i <= 8/
+{
+ @ = lquantize(1, 0, 4);
+}
+
+tick-10ms
+/i <= 2/
+{
+ @ = lquantize(0, 0, 4);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d.out
new file mode 100644
index 000000000000..1aa94e33a8d4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d.out
@@ -0,0 +1,9 @@
+
+
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@ 2
+ 1 |@@@@@@@@@ 6
+ 2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 19
+ 3 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d
new file mode 100644
index 000000000000..3905f2bde346
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d
@@ -0,0 +1,96 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ a = 7;
+ b = 13;
+ val = (-a * b) + a;
+}
+
+tick-1ms
+{
+ incr = val % b;
+ val += a;
+}
+
+tick-1ms
+/val == 0/
+{
+ val += a;
+}
+
+tick-1ms
+/incr != 0/
+{
+ i++;
+ @one[i] = lquantize(0, 10, 20, 1, incr);
+ @two[i] = lquantize(0, 1, 20, 5, incr);
+ @three[i] = lquantize(0, 0, 20, 1, incr);
+ @four[i] = lquantize(0, -10, 10, 1, incr);
+ @five[i] = lquantize(0, -10, 0, 1, incr);
+ @six[i] = lquantize(0, -10, -1, 1, incr);
+ @seven[i] = lquantize(0, -10, -2, 1, incr);
+}
+
+tick-1ms
+/incr == 0/
+{
+ printf("Zero below the range:\n");
+ printa(@one);
+ printf("\n");
+
+ printf("Zero just below the range:\n");
+ printa(@two);
+ printf("\n");
+
+ printf("Zero at the bottom of the range:\n");
+ printa(@three);
+ printf("\n");
+
+ printf("Zero within the range:\n");
+ printa(@four);
+ printf("\n");
+
+ printf("Zero at the top of the range:\n");
+ printa(@five);
+ printf("\n");
+
+ printf("Zero just above the range:\n");
+ printa(@six);
+ printf("\n");
+
+ printf("Zero above the range:\n");
+ printa(@seven);
+ printf("\n");
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d.out
new file mode 100644
index 000000000000..330de38a7952
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d.out
@@ -0,0 +1,910 @@
+Zero below the range:
+
+ 2
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+ 10 | 0
+
+ 4
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+ 10 | 0
+
+ 6
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+ 10 | 0
+
+ 8
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+ 10 | 0
+
+ 10
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+ 10 | 0
+
+ 12
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+ 10 | 0
+
+ 1
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+ 10 | 0
+
+ 3
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+ 10 | 0
+
+ 5
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+ 10 | 0
+
+ 7
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+ 10 | 0
+
+ 9
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+ 10 | 0
+
+ 11
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+ 10 | 0
+
+ 14
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 10 | 0
+
+ 16
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+ 10 | 0
+
+ 18
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+ 10 | 0
+
+ 20
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+ 10 | 0
+
+ 22
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 10 | 0
+
+ 24
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+ 10 | 0
+
+ 13
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+ 10 | 0
+
+ 15
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+ 10 | 0
+
+ 17
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+ 10 | 0
+
+ 19
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+ 10 | 0
+
+ 21
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+ 10 | 0
+
+ 23
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+ 10 | 0
+
+
+Zero just below the range:
+
+ 2
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+ 1 | 0
+
+ 4
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+ 1 | 0
+
+ 6
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+ 1 | 0
+
+ 8
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+ 1 | 0
+
+ 10
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+ 1 | 0
+
+ 12
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+ 1 | 0
+
+ 1
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+ 1 | 0
+
+ 3
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+ 1 | 0
+
+ 5
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+ 1 | 0
+
+ 7
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+ 1 | 0
+
+ 9
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+ 1 | 0
+
+ 11
+ value ------------- Distribution ------------- count
+ < 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+ 1 | 0
+
+ 14
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1 | 0
+
+ 16
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+ 1 | 0
+
+ 18
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+ 1 | 0
+
+ 20
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+ 1 | 0
+
+ 22
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 1 | 0
+
+ 24
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+ 1 | 0
+
+ 13
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+ 1 | 0
+
+ 15
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+ 1 | 0
+
+ 17
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+ 1 | 0
+
+ 19
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+ 1 | 0
+
+ 21
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+ 1 | 0
+
+ 23
+ value ------------- Distribution ------------- count
+ < 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+ 1 | 0
+
+
+Zero at the bottom of the range:
+
+ 2
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+ 1 | 0
+
+ 4
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+ 1 | 0
+
+ 6
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+ 1 | 0
+
+ 8
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+ 1 | 0
+
+ 10
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+ 1 | 0
+
+ 12
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+ 1 | 0
+
+ 1
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+ 1 | 0
+
+ 3
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+ 1 | 0
+
+ 5
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+ 1 | 0
+
+ 7
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+ 1 | 0
+
+ 9
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+ 1 | 0
+
+ 11
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+ 1 | 0
+
+ 14
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1 | 0
+
+ 16
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+ 1 | 0
+
+ 18
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+ 1 | 0
+
+ 20
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+ 1 | 0
+
+ 22
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 1 | 0
+
+ 24
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+ 1 | 0
+
+ 13
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+ 1 | 0
+
+ 15
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+ 1 | 0
+
+ 17
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+ 1 | 0
+
+ 19
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+ 1 | 0
+
+ 21
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+ 1 | 0
+
+ 23
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+ 1 | 0
+
+
+Zero within the range:
+
+ 2
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+ 1 | 0
+
+ 4
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+ 1 | 0
+
+ 6
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+ 1 | 0
+
+ 8
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+ 1 | 0
+
+ 10
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+ 1 | 0
+
+ 12
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+ 1 | 0
+
+ 1
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+ 1 | 0
+
+ 3
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+ 1 | 0
+
+ 5
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+ 1 | 0
+
+ 7
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+ 1 | 0
+
+ 9
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+ 1 | 0
+
+ 11
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+ 1 | 0
+
+ 14
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1 | 0
+
+ 16
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+ 1 | 0
+
+ 18
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+ 1 | 0
+
+ 20
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+ 1 | 0
+
+ 22
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 1 | 0
+
+ 24
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+ 1 | 0
+
+ 13
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+ 1 | 0
+
+ 15
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+ 1 | 0
+
+ 17
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+ 1 | 0
+
+ 19
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+ 1 | 0
+
+ 21
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+ 1 | 0
+
+ 23
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+ 1 | 0
+
+
+Zero at the top of the range:
+
+ 2
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+
+ 4
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+
+ 6
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+
+ 8
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+
+ 10
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+
+ 12
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+
+ 1
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+
+ 3
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+
+ 5
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+
+ 7
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+
+ 9
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+
+ 11
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+
+ 14
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+
+ 16
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+
+ 18
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+
+ 20
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+
+ 22
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+
+ 24
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+
+ 13
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+
+ 15
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+
+ 17
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+
+ 19
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+
+ 21
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+
+ 23
+ value ------------- Distribution ------------- count
+ -1 | 0
+ >= 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+
+
+Zero just above the range:
+
+ 2
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+
+ 4
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+
+ 6
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+
+ 8
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+
+ 10
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+
+ 12
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+
+ 1
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+
+ 3
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+
+ 5
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+
+ 7
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+
+ 9
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+
+ 11
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+
+ 14
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+
+ 16
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+
+ 18
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+
+ 20
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+
+ 22
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+
+ 24
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+
+ 13
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+
+ 15
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+
+ 17
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+
+ 19
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+
+ 21
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+
+ 23
+ value ------------- Distribution ------------- count
+ -2 | 0
+ >= -1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+
+
+Zero above the range:
+
+ 23
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+
+ 21
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+
+ 19
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+
+ 17
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+
+ 15
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+
+ 13
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+
+ 24
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+
+ 22
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+
+ 20
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+
+ 18
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+
+ 16
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+
+ 14
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+
+ 11
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+
+ 9
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+
+ 7
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+
+ 5
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+
+ 3
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+
+ 1
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+
+ 12
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+
+ 10
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+
+ 8
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+
+ 6
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+
+ 4
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+
+ 2
+ value ------------- Distribution ------------- count
+ -3 | 0
+ >= -2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max.d
new file mode 100644
index 000000000000..0c973ad56dc6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max.d
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive max() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES: This is verifiable simple positive test of the max() function.
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 1000/
+{
+ @a = max(i);
+ i += 100;
+}
+
+tick-10ms
+/i == 1000/
+{
+ printa(@a);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max.d.out
new file mode 100644
index 000000000000..d3957f4ccf12
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max.d.out
@@ -0,0 +1,3 @@
+
+ 900
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d
new file mode 100644
index 000000000000..63486e5fce21
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive max() test using negative values
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES: This is verifiable simple positive test of the max() function.
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @ = max(0);
+ @ = max(-900);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d.out
new file mode 100644
index 000000000000..8d23188fd1f0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d.out
@@ -0,0 +1,2 @@
+
+ 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min.d
new file mode 100644
index 000000000000..aff5452e62be
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive min() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES: This is verifiable simple positive test of the min() function.
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 1000/
+{
+ @a = min(i);
+ i += 100;
+}
+
+tick-10ms
+/i == 1000/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min.d.out
new file mode 100644
index 000000000000..8d23188fd1f0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min.d.out
@@ -0,0 +1,2 @@
+
+ 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d
new file mode 100644
index 000000000000..20f0a56d8b88
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive min() test using negative values
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES: This is verifiable simple positive test of the min() function.
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @ = min(0);
+ @ = min(-900);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d.out
new file mode 100644
index 000000000000..461b29cfd2d3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d.out
@@ -0,0 +1,2 @@
+
+ -900
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d
new file mode 100644
index 000000000000..c65fb529e062
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Multiple aggregates can be used within the same D script.
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ time_1 = timestamp;
+ i = 0;
+}
+
+tick-10ms
+/i <= 10/
+{
+ time_2 = timestamp;
+ new_time = time_2 - time_1;
+ @a[pid] = max(new_time);
+ @b[pid] = min(new_time);
+ @c[pid] = avg(new_time);
+ @d[pid] = sum(new_time);
+ @e[pid] = quantize(new_time);
+ @f[pid] = stddev(new_time);
+ @g[timestamp] = max(new_time);
+ @h[timestamp] = quantize(new_time);
+ @i[timestamp] = lquantize(new_time, 0, 10000, 1000);
+
+ time_1 = time_2;
+ i++;
+}
+
+tick-10ms
+/i == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d
new file mode 100644
index 000000000000..b34d73fa8b84
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Test multiple aggregations and the default output order
+ *
+ * SECTION: Aggregations/Aggregations;
+ * Aggregations/Output
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 1000/
+{
+ @a = avg(i);
+ @b = sum(i);
+ @c = min(i);
+ @d = max(i);
+ @e = quantize(i);
+ @f = lquantize(i, 0, 1000, 100);
+ @g = stddev(i);
+
+ i += 100;
+}
+
+tick-10ms
+/i == 1000/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out
new file mode 100644
index 000000000000..579f78dd9bed
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out
@@ -0,0 +1,37 @@
+
+ 450
+ 4500
+ 0
+ 900
+
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@ 1
+ 1 | 0
+ 2 | 0
+ 4 | 0
+ 8 | 0
+ 16 | 0
+ 32 | 0
+ 64 |@@@@ 1
+ 128 |@@@@ 1
+ 256 |@@@@@@@@@@@@ 3
+ 512 |@@@@@@@@@@@@@@@@ 4
+ 1024 | 0
+
+
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@ 1
+ 100 |@@@@ 1
+ 200 |@@@@ 1
+ 300 |@@@@ 1
+ 400 |@@@@ 1
+ 500 |@@@@ 1
+ 600 |@@@@ 1
+ 700 |@@@@ 1
+ 800 |@@@@ 1
+ 900 |@@@@ 1
+ >= 1000 | 0
+
+ 287
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d
new file mode 100644
index 000000000000..21d2fa9e2d69
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d
@@ -0,0 +1,74 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Test multiple aggregations and overriding default order with
+ * printa() statements.
+ *
+ * SECTION: Aggregations/Aggregations;
+ * Aggregations/Output
+ *
+ * NOTES: This is a simple verifiable test.
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 1000/
+{
+ @a = count();
+ @b = avg(i);
+ @c = sum(i);
+ @d = min(i);
+ @e = max(i);
+ @f = quantize(i);
+ @g = lquantize(i, 0, 1000, 100);
+ @h = stddev(i);
+
+ i += 100;
+}
+
+tick-10ms
+/i == 1000/
+{
+ printa("%@d\n", @h);
+ printa("%@d\n", @g);
+ printa("%@d\n", @f);
+ printa("%@d\n", @e);
+ printa("%@d\n", @d);
+ printa("%@d\n", @c);
+ printa("%@d\n", @b);
+ printa("%@d\n", @a);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out
new file mode 100644
index 000000000000..ab976601b2af
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out
@@ -0,0 +1,38 @@
+287
+
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@ 1
+ 100 |@@@@ 1
+ 200 |@@@@ 1
+ 300 |@@@@ 1
+ 400 |@@@@ 1
+ 500 |@@@@ 1
+ 600 |@@@@ 1
+ 700 |@@@@ 1
+ 800 |@@@@ 1
+ 900 |@@@@ 1
+ >= 1000 | 0
+
+
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@ 1
+ 1 | 0
+ 2 | 0
+ 4 | 0
+ 8 | 0
+ 16 | 0
+ 32 | 0
+ 64 |@@@@ 1
+ 128 |@@@@ 1
+ 256 |@@@@@@@@@@@@ 3
+ 512 |@@@@@@@@@@@@@@@@ 4
+ 1024 | 0
+
+900
+0
+4500
+450
+10
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d
new file mode 100644
index 000000000000..2cfa1848bd3d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d
@@ -0,0 +1,65 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Multiple aggregations are supported
+ *
+ * SECTION: Aggregations/Normalization
+ *
+ */
+
+#pragma D option quiet
+#pragma D option aggrate=1ms
+#pragma D option switchrate=50ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i < 20/
+{
+ @func1[i % 5] = sum(i * 100);
+ @func2[i % 5 + 1] = sum(i * 200);
+ i++;
+}
+
+tick-100ms
+/i == 20/
+{
+ printf("normalized data #1:\n");
+ normalize(@func1, 5);
+ printa(@func1);
+
+ printf("\nnormalized data #2:\n");
+ normalize(@func2, 5);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d.out
new file mode 100644
index 000000000000..992b31e21fed
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d.out
@@ -0,0 +1,15 @@
+normalized data #1:
+
+ 0 600
+ 1 680
+ 2 760
+ 3 840
+ 4 920
+
+normalized data #2:
+
+ 1 1200
+ 2 1360
+ 3 1520
+ 4 1680
+ 5 1840
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d
new file mode 100644
index 000000000000..d24884b5da6d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d
@@ -0,0 +1,150 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ @["j-church"] = lquantize(1, 0, 10, 1, 100);
+ @["j-church"] = lquantize(1, 0, 10, 1, -99);
+ @["j-church"] = lquantize(1, 0, 10, 1, -1);
+ val = 123;
+}
+
+BEGIN
+{
+ @["k-ingleside"] = lquantize(1, 0, 10, 1, -val);
+}
+
+BEGIN
+{
+ @["l-taraval"] = lquantize(0, 0, 10, 1, -val);
+ @["l-taraval"] = lquantize(-1, 0, 10, 1, -val);
+ @["l-taraval"] = lquantize(1, 0, 10, 1, val);
+ @["l-taraval"] = lquantize(1, 0, 10, 1, val);
+}
+
+BEGIN
+{
+ @["m-oceanview"] = lquantize(1, 0, 10, 1, (1 << 63) - 1);
+ @["m-oceanview"] = lquantize(1, 0, 10, 1);
+ @["m-oceanview"] = lquantize(2, 0, 10, 1, (1 << 63) - 1);
+ @["m-oceanview"] = lquantize(8, 0, 10, 1, 400000);
+}
+
+BEGIN
+{
+ @["n-judah"] = lquantize(1, 0, 10, 1, val);
+ @["n-judah"] = lquantize(2, 0, 10, 1, val);
+ @["n-judah"] = lquantize(2, 0, 10, 1, val);
+ @["n-judah"] = lquantize(2, 0, 10, 1);
+}
+
+BEGIN
+{
+ this->i = 1;
+ this->val = (1 << 63) - 1;
+
+ @["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["f-market"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+}
+
+BEGIN
+{
+ this->i = 1;
+
+ /*
+ * We want to test the ability to sort very large quantizations
+ * that differ by a small amount. Ideally, they would differ only
+ * by 1 -- but that is smaller than the precision of long doubles of
+ * this magnitude on x86. To assure that the same test works on x86
+ * just as it does on SPARC, we pick a value that is just larger than
+ * the precision at this magnitude. It should go without saying that
+ * this robustness on new ISAs very much depends on the precision
+ * of the long double representation.
+ */
+ this->val = (1 << 63) - 7;
+
+ @["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+
+ @["s-castro"] = lquantize(this->i, 0, 10, 1, this->val);
+ this->i++;
+ this->val = ((1 << 63) - 1) / this->i;
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d.out
new file mode 100644
index 000000000000..3b7533b17145
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d.out
@@ -0,0 +1,64 @@
+
+ k-ingleside
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -123
+ 2 | 0
+
+ j-church
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 | 0
+ 1 | 0
+
+ l-taraval
+ value ------------- Distribution ------------- count
+ < 0 @@@@@| -123
+ 0 @@@@@| -123
+ 1 |@@@@@@@@@@ 246
+ 2 | 0
+
+ n-judah
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@ 123
+ 2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 247
+ 3 | 0
+
+ m-oceanview
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@| -9223372036854775808
+ 2 |@@@@@@@@@@ 9223372036854775807
+ 3 | 0
+ 4 | 0
+ 5 | 0
+ 6 | 0
+ 7 | 0
+ 8 | 400000
+ 9 | 0
+
+ s-castro
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@ 9223372036854775801
+ 2 |@@@@@@@@ 4611686018427387903
+ 3 |@@@@@ 3074457345618258602
+ 4 |@@@@ 2305843009213693951
+ 5 |@@@ 1844674407370955161
+ 6 |@@@ 1537228672809129301
+ 7 |@@ 1317624576693539401
+ 8 | 0
+
+ f-market
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@ 9223372036854775807
+ 2 |@@@@@@@@ 4611686018427387903
+ 3 |@@@@@ 3074457345618258602
+ 4 |@@@@ 2305843009213693951
+ 5 |@@@ 1844674407370955161
+ 6 |@@@ 1537228672809129301
+ 7 |@@ 1317624576693539401
+ 8 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negorder.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negorder.d
new file mode 100644
index 000000000000..440c4839459e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negorder.d
@@ -0,0 +1,85 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ a = 7;
+ b = 13;
+ val = (-a * b) + a;
+}
+
+tick-1ms
+{
+ incr = val % b;
+ val += a;
+}
+
+tick-1ms
+/val == 0/
+{
+ val += a;
+}
+
+tick-1ms
+/incr != 0/
+{
+ i++;
+ @quanty[i] = quantize(1, incr);
+ @lquanty[i] = lquantize(1, -10, 10, 1, incr);
+ @summy[i] = sum(incr);
+ @maxxy[i] = max(incr);
+ @minny[i] = min(incr);
+}
+
+tick-1ms
+/incr == 0/
+{
+ printf("Ordering of quantize() with some negative weights:\n");
+ printa(@quanty);
+ printf("\n");
+
+ printf("Ordering of lquantize() with some negative weights:\n");
+ printa(@lquanty);
+ printf("\n");
+
+ printf("Ordering of sum() with some negative weights:\n");
+ printa(@summy);
+ printf("\n");
+
+ printf("Ordering of max() with some negative weights:\n");
+ printa(@maxxy);
+ printf("\n");
+
+ printf("Ordering of min() with some negative weights:\n");
+ printa(@minny);
+ printf("\n");
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negorder.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negorder.d.out
new file mode 100644
index 000000000000..a03b685044a4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negorder.d.out
@@ -0,0 +1,376 @@
+Ordering of quantize() with some negative weights:
+
+ 2
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+ 2 | 0
+
+ 4
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+ 2 | 0
+
+ 6
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+ 2 | 0
+
+ 8
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+ 2 | 0
+
+ 10
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+ 2 | 0
+
+ 12
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+ 2 | 0
+
+ 1
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+ 2 | 0
+
+ 3
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+ 2 | 0
+
+ 5
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+ 2 | 0
+
+ 7
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+ 2 | 0
+
+ 9
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+ 2 | 0
+
+ 11
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+ 2 | 0
+
+ 14
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 2 | 0
+
+ 16
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+ 2 | 0
+
+ 18
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+ 2 | 0
+
+ 20
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+ 2 | 0
+
+ 22
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 2 | 0
+
+ 24
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+ 2 | 0
+
+ 13
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+ 2 | 0
+
+ 15
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+ 2 | 0
+
+ 17
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+ 2 | 0
+
+ 19
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+ 2 | 0
+
+ 21
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+ 2 | 0
+
+ 23
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+ 2 | 0
+
+
+Ordering of lquantize() with some negative weights:
+
+ 2
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+ 2 | 0
+
+ 4
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+ 2 | 0
+
+ 6
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+ 2 | 0
+
+ 8
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+ 2 | 0
+
+ 10
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+ 2 | 0
+
+ 12
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+ 2 | 0
+
+ 1
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+ 2 | 0
+
+ 3
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+ 2 | 0
+
+ 5
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+ 2 | 0
+
+ 7
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+ 2 | 0
+
+ 9
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+ 2 | 0
+
+ 11
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+ 2 | 0
+
+ 14
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 2 | 0
+
+ 16
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+ 2 | 0
+
+ 18
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+ 2 | 0
+
+ 20
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+ 2 | 0
+
+ 22
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 2 | 0
+
+ 24
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+ 2 | 0
+
+ 13
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+ 2 | 0
+
+ 15
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+ 2 | 0
+
+ 17
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+ 2 | 0
+
+ 19
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+ 2 | 0
+
+ 21
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+ 2 | 0
+
+ 23
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+ 2 | 0
+
+
+Ordering of sum() with some negative weights:
+
+ 2 -12
+ 4 -11
+ 6 -10
+ 8 -9
+ 10 -8
+ 12 -7
+ 1 -6
+ 3 -5
+ 5 -4
+ 7 -3
+ 9 -2
+ 11 -1
+ 14 1
+ 16 2
+ 18 3
+ 20 4
+ 22 5
+ 24 6
+ 13 7
+ 15 8
+ 17 9
+ 19 10
+ 21 11
+ 23 12
+
+Ordering of max() with some negative weights:
+
+ 2 -12
+ 4 -11
+ 6 -10
+ 8 -9
+ 10 -8
+ 12 -7
+ 1 -6
+ 3 -5
+ 5 -4
+ 7 -3
+ 9 -2
+ 11 -1
+ 14 1
+ 16 2
+ 18 3
+ 20 4
+ 22 5
+ 24 6
+ 13 7
+ 15 8
+ 17 9
+ 19 10
+ 21 11
+ 23 12
+
+Ordering of min() with some negative weights:
+
+ 2 -12
+ 4 -11
+ 6 -10
+ 8 -9
+ 10 -8
+ 12 -7
+ 1 -6
+ 3 -5
+ 5 -4
+ 7 -3
+ 9 -2
+ 11 -1
+ 14 1
+ 16 2
+ 18 3
+ 20 4
+ 22 5
+ 24 6
+ 13 7
+ 15 8
+ 17 9
+ 19 10
+ 21 11
+ 23 12
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negquant.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negquant.d
new file mode 100644
index 000000000000..bbc7263dc58c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negquant.d
@@ -0,0 +1,115 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ @["j-church"] = quantize(1, 100);
+ @["j-church"] = quantize(1, -99);
+ @["j-church"] = quantize(1, -1);
+ val = 123;
+}
+
+BEGIN
+{
+ @["k-ingleside"] = quantize(1, -val);
+}
+
+BEGIN
+{
+ @["l-taraval"] = quantize(0, -val);
+ @["l-taraval"] = quantize(-1, -val);
+ @["l-taraval"] = quantize(1, val);
+ @["l-taraval"] = quantize(1, val);
+}
+
+BEGIN
+{
+ @["m-oceanview"] = quantize(1, (1 << 63) - 1);
+ @["m-oceanview"] = quantize(1);
+ @["m-oceanview"] = quantize(2, (1 << 63) - 1);
+ @["m-oceanview"] = quantize(8, 400000);
+}
+
+BEGIN
+{
+ @["n-judah"] = quantize(1, val);
+ @["n-judah"] = quantize(2, val);
+ @["n-judah"] = quantize(2, val);
+ @["n-judah"] = quantize(2);
+}
+
+BEGIN
+{
+ this->i = 1;
+ this->val = (1 << 63) - 1;
+
+ @["f-market"] = quantize(this->i, this->val);
+ this->i <<= 1;
+ this->val >>= 1;
+
+ @["f-market"] = quantize(this->i, this->val);
+ this->i <<= 1;
+ this->val >>= 1;
+
+ @["f-market"] = quantize(this->i, this->val);
+ this->i <<= 1;
+ this->val >>= 1;
+
+ @["f-market"] = quantize(this->i, this->val);
+ this->i <<= 1;
+ this->val >>= 1;
+}
+
+BEGIN
+{
+ this->i = 1;
+ this->val = (1 << 63) - 4;
+
+ @["s-castro"] = quantize(this->i, this->val);
+ this->i <<= 1;
+ this->val >>= 1;
+
+ @["s-castro"] = quantize(this->i, this->val);
+ this->i <<= 1;
+ this->val >>= 1;
+
+ @["s-castro"] = quantize(this->i, this->val);
+ this->i <<= 1;
+ this->val >>= 1;
+
+ @["s-castro"] = quantize(this->i, this->val);
+ this->i <<= 1;
+ this->val >>= 1;
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negquant.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negquant.d.out
new file mode 100644
index 000000000000..f8466b3367ba
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negquant.d.out
@@ -0,0 +1,55 @@
+
+ k-ingleside
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -123
+ 2 | 0
+
+ j-church
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ l-taraval
+ value ------------- Distribution ------------- count
+ -2 | 0
+ -1 @@@@@| -123
+ 0 @@@@@| -123
+ 1 |@@@@@@@@@@ 246
+ 2 | 0
+
+ n-judah
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@ 123
+ 2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 247
+ 4 | 0
+
+ m-oceanview
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 @@@@@@@@@@| -9223372036854775808
+ 2 |@@@@@@@@@@ 9223372036854775807
+ 4 | 0
+ 8 | 400000
+ 16 | 0
+
+ s-castro
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@ 9223372036854775804
+ 2 |@@@@@@@@@@@ 4611686018427387902
+ 4 |@@@@@ 2305843009213693951
+ 8 |@@@ 1152921504606846975
+ 16 | 0
+
+ f-market
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@ 9223372036854775807
+ 2 |@@@@@@@@@@@ 4611686018427387903
+ 4 |@@@@@ 2305843009213693951
+ 8 |@@@ 1152921504606846975
+ 16 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d
new file mode 100644
index 000000000000..f90eae134805
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+int i;
+
+tick-10ms
+/i < 100/
+{
+ @[i] = sum(i);
+ i++;
+}
+
+tick-10ms
+/i == 100/
+{
+ exit(0);
+}
+
+END
+{
+ trunc(@, -10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d.out
new file mode 100644
index 000000000000..c1b07a6dae09
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d.out
@@ -0,0 +1,11 @@
+
+ 0 0
+ 1 1
+ 2 2
+ 3 3
+ 4 4
+ 5 5
+ 6 6
+ 7 7
+ 8 8
+ 9 9
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d
new file mode 100644
index 000000000000..2a13d659331c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+int i;
+
+tick-10ms
+/i < 100/
+{
+ @[i] = lquantize(i, 0, 150);
+ @[i] = lquantize(i + 1, 0, 150);
+ @[i] = lquantize(i + 2, 0, 150);
+ @[i] = lquantize(i + 3, 0, 150);
+ i++;
+}
+
+tick-10ms
+/i == 100/
+{
+ exit(0);
+}
+
+END
+{
+ trunc(@, -5);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d.out
new file mode 100644
index 000000000000..264aa392e2ab
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d.out
@@ -0,0 +1,46 @@
+
+ 0
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 |@@@@@@@@@@ 1
+ 1 |@@@@@@@@@@ 1
+ 2 |@@@@@@@@@@ 1
+ 3 |@@@@@@@@@@ 1
+ 4 | 0
+
+ 1
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@ 1
+ 2 |@@@@@@@@@@ 1
+ 3 |@@@@@@@@@@ 1
+ 4 |@@@@@@@@@@ 1
+ 5 | 0
+
+ 2
+ value ------------- Distribution ------------- count
+ 1 | 0
+ 2 |@@@@@@@@@@ 1
+ 3 |@@@@@@@@@@ 1
+ 4 |@@@@@@@@@@ 1
+ 5 |@@@@@@@@@@ 1
+ 6 | 0
+
+ 3
+ value ------------- Distribution ------------- count
+ 2 | 0
+ 3 |@@@@@@@@@@ 1
+ 4 |@@@@@@@@@@ 1
+ 5 |@@@@@@@@@@ 1
+ 6 |@@@@@@@@@@ 1
+ 7 | 0
+
+ 4
+ value ------------- Distribution ------------- count
+ 3 | 0
+ 4 |@@@@@@@@@@ 1
+ 5 |@@@@@@@@@@ 1
+ 6 |@@@@@@@@@@ 1
+ 7 |@@@@@@@@@@ 1
+ 8 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.normalize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.normalize.d
new file mode 100644
index 000000000000..0bcc0fe9134e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.normalize.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for normalization()
+ *
+ * SECTION: Aggregations/Normalization
+ *
+ */
+
+#pragma D option quiet
+#pragma D option aggrate=1ms
+#pragma D option switchrate=50ms
+
+BEGIN
+{
+ i = 0;
+ start = timestamp;
+}
+
+tick-100ms
+/i < 20/
+{
+ @func[i % 5] = sum(i * 100);
+ i++;
+}
+
+tick-100ms
+/i == 20/
+{
+ printf("normalized data:\n");
+ normalize(@func, 5);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.normalize.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.normalize.d.out
new file mode 100644
index 000000000000..11193e65d810
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.normalize.d.out
@@ -0,0 +1,7 @@
+normalized data:
+
+ 0 600
+ 1 680
+ 2 760
+ 3 840
+ 4 920
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.order.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.order.d
new file mode 100644
index 000000000000..139001164b6a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.order.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ @[8] = sum(1);
+ @[6] = sum(1);
+ @[7] = sum(1);
+ @[5] = sum(1);
+ @[3] = sum(1);
+ @[0] = sum(1);
+ @[9] = sum(1);
+
+ @tour["Ghent"] = sum(1);
+ @tour["Berlin"] = sum(1);
+ @tour["London"] = sum(1);
+ @tour["Dublin"] = sum(1);
+ @tour["Shanghai"] = sum(1);
+ @tour["Zurich"] = sum(1);
+ @tour["Regina"] = sum(1);
+ @tour["Winnipeg"] = sum(1);
+ @tour["Edmonton"] = sum(1);
+ @tour["Calgary"] = sum(1);
+
+ @ate[8, "Rice"] = sum(1);
+ @ate[8, "Oatmeal"] = sum(1);
+ @ate[8, "Barley"] = sum(1);
+ @ate[8, "Carrots"] = sum(1);
+ @ate[8, "Sweet potato"] = sum(1);
+ @ate[8, "Asparagus"] = sum(1);
+ @ate[8, "Squash"] = sum(1);
+
+ @chars['a'] = sum(1);
+ @chars['s'] = sum(1);
+ @chars['d'] = sum(1);
+ @chars['f'] = sum(1);
+
+ printa("%d\n", @);
+ printf("\n");
+
+ printa("%s\n", @tour);
+ printf("\n");
+
+ printa("%d %s\n", @ate);
+ printf("\n");
+
+ printa("%c\n", @chars);
+ printf("\n");
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.order.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.order.d.out
new file mode 100644
index 000000000000..505b0f32c9b9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.order.d.out
@@ -0,0 +1,33 @@
+0
+3
+5
+6
+7
+8
+9
+
+Berlin
+Calgary
+Dublin
+Edmonton
+Ghent
+London
+Regina
+Shanghai
+Winnipeg
+Zurich
+
+8 Asparagus
+8 Barley
+8 Carrots
+8 Oatmeal
+8 Rice
+8 Squash
+8 Sweet potato
+
+a
+d
+f
+s
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantize.d
new file mode 100644
index 000000000000..fad472af4b95
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantize.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive quantize() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES: This is verifiable simple positive test of the quantize() function.
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 1000/
+{
+ @a[i] = quantize(i);
+ i += 100;
+}
+
+tick-10ms
+/i == 1000/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantize.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantize.d.out
new file mode 100644
index 000000000000..f4882ed2bf5d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantize.d.out
@@ -0,0 +1,61 @@
+
+ 0
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1 | 0
+
+ 100
+ value ------------- Distribution ------------- count
+ 32 | 0
+ 64 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 128 | 0
+
+ 200
+ value ------------- Distribution ------------- count
+ 64 | 0
+ 128 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 256 | 0
+
+ 300
+ value ------------- Distribution ------------- count
+ 128 | 0
+ 256 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 512 | 0
+
+ 400
+ value ------------- Distribution ------------- count
+ 128 | 0
+ 256 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 512 | 0
+
+ 500
+ value ------------- Distribution ------------- count
+ 128 | 0
+ 256 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 512 | 0
+
+ 600
+ value ------------- Distribution ------------- count
+ 256 | 0
+ 512 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1024 | 0
+
+ 700
+ value ------------- Distribution ------------- count
+ 256 | 0
+ 512 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1024 | 0
+
+ 800
+ value ------------- Distribution ------------- count
+ 256 | 0
+ 512 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1024 | 0
+
+ 900
+ value ------------- Distribution ------------- count
+ 256 | 0
+ 512 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1024 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d
new file mode 100644
index 000000000000..e547b1ec73e4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+int64_t val, shift;
+
+tick-1ms
+/val == 0/
+{
+ val = -(1 << shift);
+ shift++;
+}
+
+tick-1ms
+/shift == 32/
+{
+ exit(0);
+}
+
+tick-1ms
+/val == -1/
+{
+ val = (1 << shift);
+}
+
+tick-1ms
+{
+ @[shift] = quantize(val, val);
+ val >>= 1;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d.out
new file mode 100644
index 000000000000..45df24910b84
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d.out
@@ -0,0 +1,1208 @@
+
+ 1
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@ 1
+ 2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+ 4 | 0
+
+ 2
+ value ------------- Distribution ------------- count
+ -4 | 0
+ -2 @@@@| -2
+ -1 | 0
+ 0 | 0
+ 1 |@@ 1
+ 2 |@@@@ 2
+ 4 |@@@@@@@@@ 4
+ 8 | 0
+
+ 3
+ value ------------- Distribution ------------- count
+ -8 | 0
+ -4 @@@@| -4
+ -2 @@| -2
+ -1 | 0
+ 0 | 0
+ 1 |@ 1
+ 2 |@@ 2
+ 4 |@@@@ 4
+ 8 |@@@@@@@@ 8
+ 16 | 0
+
+ 4
+ value ------------- Distribution ------------- count
+ -16 | 0
+ -8 @@@@| -8
+ -4 @@| -4
+ -2 @| -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 |@ 2
+ 4 |@@ 4
+ 8 |@@@@ 8
+ 16 |@@@@@@@ 16
+ 32 | 0
+
+ 5
+ value ------------- Distribution ------------- count
+ -32 | 0
+ -16 @@@| -16
+ -8 @@| -8
+ -4 @| -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 |@ 4
+ 8 |@@ 8
+ 16 |@@@ 16
+ 32 |@@@@@@@ 32
+ 64 | 0
+
+ 6
+ value ------------- Distribution ------------- count
+ -64 | 0
+ -32 @@@| -32
+ -16 @@| -16
+ -8 @| -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 |@ 8
+ 16 |@@ 16
+ 32 |@@@ 32
+ 64 |@@@@@@@ 64
+ 128 | 0
+
+ 7
+ value ------------- Distribution ------------- count
+ -128 | 0
+ -64 @@@| -64
+ -32 @@| -32
+ -16 @| -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 |@ 16
+ 32 |@@ 32
+ 64 |@@@ 64
+ 128 |@@@@@@@ 128
+ 256 | 0
+
+ 8
+ value ------------- Distribution ------------- count
+ -256 | 0
+ -128 @@@| -128
+ -64 @@| -64
+ -32 @| -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 |@ 32
+ 64 |@@ 64
+ 128 |@@@ 128
+ 256 |@@@@@@@ 256
+ 512 | 0
+
+ 9
+ value ------------- Distribution ------------- count
+ -512 | 0
+ -256 @@@| -256
+ -128 @@| -128
+ -64 @| -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 |@ 64
+ 128 |@@ 128
+ 256 |@@@ 256
+ 512 |@@@@@@@ 512
+ 1024 | 0
+
+ 10
+ value ------------- Distribution ------------- count
+ -1024 | 0
+ -512 @@@| -512
+ -256 @@| -256
+ -128 @| -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 |@ 128
+ 256 |@@ 256
+ 512 |@@@ 512
+ 1024 |@@@@@@@ 1024
+ 2048 | 0
+
+ 11
+ value ------------- Distribution ------------- count
+ -2048 | 0
+ -1024 @@@| -1024
+ -512 @@| -512
+ -256 @| -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 |@ 256
+ 512 |@@ 512
+ 1024 |@@@ 1024
+ 2048 |@@@@@@@ 2048
+ 4096 | 0
+
+ 12
+ value ------------- Distribution ------------- count
+ -4096 | 0
+ -2048 @@@| -2048
+ -1024 @@| -1024
+ -512 @| -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 |@ 512
+ 1024 |@@ 1024
+ 2048 |@@@ 2048
+ 4096 |@@@@@@@ 4096
+ 8192 | 0
+
+ 13
+ value ------------- Distribution ------------- count
+ -8192 | 0
+ -4096 @@@| -4096
+ -2048 @@| -2048
+ -1024 @| -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 |@ 1024
+ 2048 |@@ 2048
+ 4096 |@@@ 4096
+ 8192 |@@@@@@@ 8192
+ 16384 | 0
+
+ 14
+ value ------------- Distribution ------------- count
+ -16384 | 0
+ -8192 @@@| -8192
+ -4096 @@| -4096
+ -2048 @| -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 |@ 2048
+ 4096 |@@ 4096
+ 8192 |@@@ 8192
+ 16384 |@@@@@@@ 16384
+ 32768 | 0
+
+ 15
+ value ------------- Distribution ------------- count
+ -32768 | 0
+ -16384 @@@| -16384
+ -8192 @@| -8192
+ -4096 @| -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 |@ 4096
+ 8192 |@@ 8192
+ 16384 |@@@ 16384
+ 32768 |@@@@@@@ 32768
+ 65536 | 0
+
+ 16
+ value ------------- Distribution ------------- count
+ -65536 | 0
+ -32768 @@@| -32768
+ -16384 @@| -16384
+ -8192 @| -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 |@ 8192
+ 16384 |@@ 16384
+ 32768 |@@@ 32768
+ 65536 |@@@@@@@ 65536
+ 131072 | 0
+
+ 17
+ value ------------- Distribution ------------- count
+ -131072 | 0
+ -65536 @@@| -65536
+ -32768 @@| -32768
+ -16384 @| -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 |@ 16384
+ 32768 |@@ 32768
+ 65536 |@@@ 65536
+ 131072 |@@@@@@@ 131072
+ 262144 | 0
+
+ 18
+ value ------------- Distribution ------------- count
+ -262144 | 0
+ -131072 @@@| -131072
+ -65536 @@| -65536
+ -32768 @| -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 |@ 32768
+ 65536 |@@ 65536
+ 131072 |@@@ 131072
+ 262144 |@@@@@@@ 262144
+ 524288 | 0
+
+ 19
+ value ------------- Distribution ------------- count
+ -524288 | 0
+ -262144 @@@| -262144
+ -131072 @@| -131072
+ -65536 @| -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 |@ 65536
+ 131072 |@@ 131072
+ 262144 |@@@ 262144
+ 524288 |@@@@@@@ 524288
+ 1048576 | 0
+
+ 20
+ value ------------- Distribution ------------- count
+ -1048576 | 0
+ -524288 @@@| -524288
+ -262144 @@| -262144
+ -131072 @| -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 |@ 131072
+ 262144 |@@ 262144
+ 524288 |@@@ 524288
+ 1048576 |@@@@@@@ 1048576
+ 2097152 | 0
+
+ 21
+ value ------------- Distribution ------------- count
+ -2097152 | 0
+ -1048576 @@@| -1048576
+ -524288 @@| -524288
+ -262144 @| -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 |@ 262144
+ 524288 |@@ 524288
+ 1048576 |@@@ 1048576
+ 2097152 |@@@@@@@ 2097152
+ 4194304 | 0
+
+ 22
+ value ------------- Distribution ------------- count
+ -4194304 | 0
+ -2097152 @@@| -2097152
+ -1048576 @@| -1048576
+ -524288 @| -524288
+ -262144 | -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 | 262144
+ 524288 |@ 524288
+ 1048576 |@@ 1048576
+ 2097152 |@@@ 2097152
+ 4194304 |@@@@@@@ 4194304
+ 8388608 | 0
+
+ 23
+ value ------------- Distribution ------------- count
+ -8388608 | 0
+ -4194304 @@@| -4194304
+ -2097152 @@| -2097152
+ -1048576 @| -1048576
+ -524288 | -524288
+ -262144 | -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 | 262144
+ 524288 | 524288
+ 1048576 |@ 1048576
+ 2097152 |@@ 2097152
+ 4194304 |@@@ 4194304
+ 8388608 |@@@@@@@ 8388608
+ 16777216 | 0
+
+ 24
+ value ------------- Distribution ------------- count
+ -16777216 | 0
+ -8388608 @@@| -8388608
+ -4194304 @@| -4194304
+ -2097152 @| -2097152
+ -1048576 | -1048576
+ -524288 | -524288
+ -262144 | -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 | 262144
+ 524288 | 524288
+ 1048576 | 1048576
+ 2097152 |@ 2097152
+ 4194304 |@@ 4194304
+ 8388608 |@@@ 8388608
+ 16777216 |@@@@@@@ 16777216
+ 33554432 | 0
+
+ 25
+ value ------------- Distribution ------------- count
+ -33554432 | 0
+ -16777216 @@@| -16777216
+ -8388608 @@| -8388608
+ -4194304 @| -4194304
+ -2097152 | -2097152
+ -1048576 | -1048576
+ -524288 | -524288
+ -262144 | -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 | 262144
+ 524288 | 524288
+ 1048576 | 1048576
+ 2097152 | 2097152
+ 4194304 |@ 4194304
+ 8388608 |@@ 8388608
+ 16777216 |@@@ 16777216
+ 33554432 |@@@@@@@ 33554432
+ 67108864 | 0
+
+ 26
+ value ------------- Distribution ------------- count
+ -67108864 | 0
+ -33554432 @@@| -33554432
+ -16777216 @@| -16777216
+ -8388608 @| -8388608
+ -4194304 | -4194304
+ -2097152 | -2097152
+ -1048576 | -1048576
+ -524288 | -524288
+ -262144 | -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 | 262144
+ 524288 | 524288
+ 1048576 | 1048576
+ 2097152 | 2097152
+ 4194304 | 4194304
+ 8388608 |@ 8388608
+ 16777216 |@@ 16777216
+ 33554432 |@@@ 33554432
+ 67108864 |@@@@@@@ 67108864
+ 134217728 | 0
+
+ 27
+ value ------------- Distribution ------------- count
+ -134217728 | 0
+ -67108864 @@@| -67108864
+ -33554432 @@| -33554432
+ -16777216 @| -16777216
+ -8388608 | -8388608
+ -4194304 | -4194304
+ -2097152 | -2097152
+ -1048576 | -1048576
+ -524288 | -524288
+ -262144 | -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 | 262144
+ 524288 | 524288
+ 1048576 | 1048576
+ 2097152 | 2097152
+ 4194304 | 4194304
+ 8388608 | 8388608
+ 16777216 |@ 16777216
+ 33554432 |@@ 33554432
+ 67108864 |@@@ 67108864
+ 134217728 |@@@@@@@ 134217728
+ 268435456 | 0
+
+ 28
+ value ------------- Distribution ------------- count
+ -268435456 | 0
+ -134217728 @@@| -134217728
+ -67108864 @@| -67108864
+ -33554432 @| -33554432
+ -16777216 | -16777216
+ -8388608 | -8388608
+ -4194304 | -4194304
+ -2097152 | -2097152
+ -1048576 | -1048576
+ -524288 | -524288
+ -262144 | -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 | 262144
+ 524288 | 524288
+ 1048576 | 1048576
+ 2097152 | 2097152
+ 4194304 | 4194304
+ 8388608 | 8388608
+ 16777216 | 16777216
+ 33554432 |@ 33554432
+ 67108864 |@@ 67108864
+ 134217728 |@@@ 134217728
+ 268435456 |@@@@@@@ 268435456
+ 536870912 | 0
+
+ 29
+ value ------------- Distribution ------------- count
+ -536870912 | 0
+ -268435456 @@@| -268435456
+ -134217728 @@| -134217728
+ -67108864 @| -67108864
+ -33554432 | -33554432
+ -16777216 | -16777216
+ -8388608 | -8388608
+ -4194304 | -4194304
+ -2097152 | -2097152
+ -1048576 | -1048576
+ -524288 | -524288
+ -262144 | -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 | 262144
+ 524288 | 524288
+ 1048576 | 1048576
+ 2097152 | 2097152
+ 4194304 | 4194304
+ 8388608 | 8388608
+ 16777216 | 16777216
+ 33554432 | 33554432
+ 67108864 |@ 67108864
+ 134217728 |@@ 134217728
+ 268435456 |@@@ 268435456
+ 536870912 |@@@@@@@ 536870912
+ 1073741824 | 0
+
+ 30
+ value ------------- Distribution ------------- count
+ -1073741824 | 0
+ -536870912 @@@| -536870912
+ -268435456 @@| -268435456
+ -134217728 @| -134217728
+ -67108864 | -67108864
+ -33554432 | -33554432
+ -16777216 | -16777216
+ -8388608 | -8388608
+ -4194304 | -4194304
+ -2097152 | -2097152
+ -1048576 | -1048576
+ -524288 | -524288
+ -262144 | -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 | 262144
+ 524288 | 524288
+ 1048576 | 1048576
+ 2097152 | 2097152
+ 4194304 | 4194304
+ 8388608 | 8388608
+ 16777216 | 16777216
+ 33554432 | 33554432
+ 67108864 | 67108864
+ 134217728 |@ 134217728
+ 268435456 |@@ 268435456
+ 536870912 |@@@ 536870912
+ 1073741824 |@@@@@@@ 1073741824
+ 2147483648 | 0
+
+ 31
+ value ------------- Distribution ------------- count
+ -2147483648 | 0
+ -1073741824 @@@| -1073741824
+ -536870912 @@| -536870912
+ -268435456 @| -268435456
+ -134217728 | -134217728
+ -67108864 | -67108864
+ -33554432 | -33554432
+ -16777216 | -16777216
+ -8388608 | -8388608
+ -4194304 | -4194304
+ -2097152 | -2097152
+ -1048576 | -1048576
+ -524288 | -524288
+ -262144 | -262144
+ -131072 | -131072
+ -65536 | -65536
+ -32768 | -32768
+ -16384 | -16384
+ -8192 | -8192
+ -4096 | -4096
+ -2048 | -2048
+ -1024 | -1024
+ -512 | -512
+ -256 | -256
+ -128 | -128
+ -64 | -64
+ -32 | -32
+ -16 | -16
+ -8 | -8
+ -4 | -4
+ -2 | -2
+ -1 | 0
+ 0 | 0
+ 1 | 1
+ 2 | 2
+ 4 | 4
+ 8 | 8
+ 16 | 16
+ 32 | 32
+ 64 | 64
+ 128 | 128
+ 256 | 256
+ 512 | 512
+ 1024 | 1024
+ 2048 | 2048
+ 4096 | 4096
+ 8192 | 8192
+ 16384 | 16384
+ 32768 | 32768
+ 65536 | 65536
+ 131072 | 131072
+ 262144 | 262144
+ 524288 | 524288
+ 1048576 | 1048576
+ 2097152 | 2097152
+ 4194304 | 4194304
+ 8388608 | 8388608
+ 16777216 | 16777216
+ 33554432 | 33554432
+ 67108864 | 67108864
+ 134217728 | 134217728
+ 268435456 |@ 268435456
+ 536870912 |@@ 536870912
+ 1073741824 |@@@ 1073741824
+ 2147483648 |@@@@@@@ 2147483648
+ 4294967296 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantround.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantround.d
new file mode 100644
index 000000000000..c40d69c081df
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantround.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+/*
+ * This test verifies that the height of the ASCII quantization bars is
+ * determined using rounding and not truncated integer arithmetic.
+ */
+tick-10ms
+/i++ >= 27/
+{
+ exit(0);
+}
+
+tick-10ms
+/i > 8/
+{
+ @ = quantize(2);
+}
+
+tick-10ms
+/i > 2 && i <= 8/
+{
+ @ = quantize(1);
+}
+
+tick-10ms
+/i <= 2/
+{
+ @ = quantize(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantround.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantround.d.out
new file mode 100644
index 000000000000..9b89ec144489
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantround.d.out
@@ -0,0 +1,9 @@
+
+
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@ 2
+ 1 |@@@@@@@@@ 6
+ 2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 19
+ 4 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d
new file mode 100644
index 000000000000..bfa633cd03ac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ a = 7;
+ b = 13;
+ val = (-a * b) + a;
+}
+
+tick-1ms
+{
+ incr = val % b;
+ val += a;
+}
+
+tick-1ms
+/val == 0/
+{
+ val += a;
+}
+
+tick-1ms
+/incr != 0/
+{
+ i++;
+ @[i] = quantize(0, incr);
+}
+
+tick-1ms
+/incr == 0/
+{
+ printa(@);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d.out
new file mode 100644
index 000000000000..c2c1cf02b6d7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d.out
@@ -0,0 +1,146 @@
+
+ 2
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+ 1 | 0
+
+ 4
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+ 1 | 0
+
+ 6
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+ 1 | 0
+
+ 8
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+ 1 | 0
+
+ 10
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+ 1 | 0
+
+ 12
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+ 1 | 0
+
+ 1
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+ 1 | 0
+
+ 3
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+ 1 | 0
+
+ 5
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+ 1 | 0
+
+ 7
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+ 1 | 0
+
+ 9
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+ 1 | 0
+
+ 11
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+ 1 | 0
+
+ 14
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1 | 0
+
+ 16
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+ 1 | 0
+
+ 18
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+ 1 | 0
+
+ 20
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+ 1 | 0
+
+ 22
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 1 | 0
+
+ 24
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+ 1 | 0
+
+ 13
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+ 1 | 0
+
+ 15
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+ 1 | 0
+
+ 17
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+ 1 | 0
+
+ 19
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+ 1 | 0
+
+ 21
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+ 1 | 0
+
+ 23
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+ 1 | 0
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signature.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signature.d
new file mode 100644
index 000000000000..baa951a4e26c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signature.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * This is a simple test to make sure that signature checking works properly
+ * for the fake-o types.
+ */
+BEGIN
+{
+ @stk[ustack()] = count();
+ @symmy[sym(0)] = count();
+ @usymmy[usym(0)] = count();
+ @funky[func(0)] = count();
+ @ufunky[ufunc(0)] = count();
+ @moddy[mod(0)] = count();
+ @umoddy[umod(0)] = count();
+}
+
+BEGIN
+{
+ @stk[ustack()] = count();
+ @symmy[sym(0)] = count();
+ @usymmy[usym(0)] = count();
+ @funky[func(0)] = count();
+ @ufunky[ufunc(0)] = count();
+ @moddy[mod(0)] = count();
+ @umoddy[umod(0)] = count();
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d
new file mode 100644
index 000000000000..ed3d13141af3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d
@@ -0,0 +1,120 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Signed integer keys print and sort as expected.
+ *
+ * SECTION: Aggregations, Printing Aggregations
+ *
+ * NOTES: DTrace sorts integer keys as unsigned values, yet prints 32-
+ * and 64-bit integers as signed values. Since the Java DTrace API is
+ * expected to emulate this behavior, this test was added to ensure that
+ * the behavior is preserved. Consistency with trace() output is also
+ * tested.
+ */
+
+#pragma D option quiet
+#pragma D option aggsortkey
+
+BEGIN
+{
+ trace((char)-2);
+ trace("\n");
+ trace((char)-1);
+ trace("\n");
+ trace((char)0);
+ trace("\n");
+ trace((char)1);
+ trace("\n");
+ trace((char)2);
+ trace("\n");
+ trace("\n");
+
+ trace((short)-2);
+ trace("\n");
+ trace((short)-1);
+ trace("\n");
+ trace((short)0);
+ trace("\n");
+ trace((short)1);
+ trace("\n");
+ trace((short)2);
+ trace("\n");
+ trace("\n");
+
+ trace(-2);
+ trace("\n");
+ trace(-1);
+ trace("\n");
+ trace(0);
+ trace("\n");
+ trace(1);
+ trace("\n");
+ trace(2);
+ trace("\n");
+ trace("\n");
+
+ trace((long long)-2);
+ trace("\n");
+ trace((long long)-1);
+ trace("\n");
+ trace((long long)0);
+ trace("\n");
+ trace((long long)1);
+ trace("\n");
+ trace((long long)2);
+ trace("\n");
+
+ @i8[(char)-2] = sum(-2);
+ @i8[(char)-1] = sum(-1);
+ @i8[(char)0] = sum(0);
+ @i8[(char)1] = sum(1);
+ @i8[(char)2] = sum(2);
+
+ @i16[(short)-2] = sum(-2);
+ @i16[(short)-1] = sum(-1);
+ @i16[(short)0] = sum(0);
+ @i16[(short)1] = sum(1);
+ @i16[(short)2] = sum(2);
+
+ @i32[-2] = sum(-2);
+ @i32[-1] = sum(-1);
+ @i32[0] = sum(0);
+ @i32[1] = sum(1);
+ @i32[2] = sum(2);
+
+ @i64[(long long)-2] = sum(-2);
+ @i64[(long long)-1] = sum(-1);
+ @i64[(long long)0] = sum(0);
+ @i64[(long long)1] = sum(1);
+ @i64[(long long)2] = sum(2);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d.out
new file mode 100644
index 000000000000..42e619e01200
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d.out
@@ -0,0 +1,44 @@
+254
+255
+0
+1
+2
+
+65534
+65535
+0
+1
+2
+
+-2
+-1
+0
+1
+2
+
+-2
+-1
+0
+1
+2
+
+ 0 0
+ 1 1
+ 2 2
+ 254 -2
+ 255 -1
+ 0 0
+ 1 1
+ 2 2
+ 65534 -2
+ 65535 -1
+ 0 0
+ 1 1
+ 2 2
+ -2 -2
+ -1 -1
+ 0 0
+ 1 1
+ 2 2
+ -2 -2
+ -1 -1
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d
new file mode 100644
index 000000000000..5836c6a5ef60
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d
@@ -0,0 +1,115 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Signed integer keys print and sort as expected using the
+ * aggsortkeypos and aggsortrev options
+ *
+ * SECTION: Aggregations, Printing Aggregations
+ *
+ * NOTES: DTrace sorts integer keys as unsigned values, yet prints 32-
+ * and 64-bit integers as signed values. Since the Java DTrace API is
+ * expected to emulate this behavior, this test was added to ensure that
+ * the behavior is preserved.
+ */
+
+#pragma D option quiet
+#pragma D option aggsortkey
+#pragma D option aggsortkeypos=1
+#pragma D option aggsortrev
+
+BEGIN
+{
+ @i8["cat", (char)-2] = sum(-2);
+ @i8["dog", (char)-2] = sum(-22);
+ @i8["mouse", (char)-2] = sum(-222);
+ @i8["cat", (char)-1] = sum(-1);
+ @i8["dog", (char)-1] = sum(-11);
+ @i8["mouse", (char)-1] = sum(-111);
+ @i8["cat", (char)0] = sum(0);
+ @i8["dog", (char)0] = sum(10);
+ @i8["mouse", (char)0] = sum(100);
+ @i8["cat", (char)1] = sum(1);
+ @i8["dog", (char)1] = sum(11);
+ @i8["mouse", (char)1] = sum(111);
+ @i8["cat", (char)2] = sum(2);
+ @i8["dog", (char)2] = sum(22);
+ @i8["mouse", (char)2] = sum(222);
+
+ @i16["mouse", (short)-2] = sum(-2);
+ @i16["dog", (short)-2] = sum(-22);
+ @i16["cat", (short)-2] = sum(-222);
+ @i16["mouse", (short)-1] = sum(-1);
+ @i16["dog", (short)-1] = sum(-11);
+ @i16["cat", (short)-1] = sum(-111);
+ @i16["mouse", (short)0] = sum(0);
+ @i16["dog", (short)0] = sum(10);
+ @i16["cat", (short)0] = sum(100);
+ @i16["mouse", (short)1] = sum(1);
+ @i16["dog", (short)1] = sum(11);
+ @i16["cat", (short)1] = sum(111);
+ @i16["mouse", (short)2] = sum(2);
+ @i16["dog", (short)2] = sum(22);
+ @i16["cat", (short)2] = sum(222);
+
+ @i32["mouse", -2] = sum(-2);
+ @i32["bear", -2] = sum(-22);
+ @i32["cat", -2] = sum(-222);
+ @i32["mouse", -1] = sum(-1);
+ @i32["bear", -1] = sum(-11);
+ @i32["cat", -1] = sum(-111);
+ @i32["mouse", 0] = sum(0);
+ @i32["bear", 0] = sum(10);
+ @i32["cat", 0] = sum(100);
+ @i32["mouse", 1] = sum(1);
+ @i32["bear", 1] = sum(11);
+ @i32["cat", 1] = sum(111);
+ @i32["mouse", 2] = sum(2);
+ @i32["bear", 2] = sum(22);
+ @i32["cat", 2] = sum(222);
+
+ @i64["cat", (long long)-2] = sum(-2);
+ @i64["bear", (long long)-2] = sum(-22);
+ @i64["dog", (long long)-2] = sum(-222);
+ @i64["cat", (long long)-1] = sum(-1);
+ @i64["bear", (long long)-1] = sum(-11);
+ @i64["dog", (long long)-1] = sum(-111);
+ @i64["cat", (long long)0] = sum(0);
+ @i64["bear", (long long)0] = sum(10);
+ @i64["dog", (long long)0] = sum(100);
+ @i64["cat", (long long)1] = sum(1);
+ @i64["bear", (long long)1] = sum(11);
+ @i64["dog", (long long)1] = sum(111);
+ @i64["cat", (long long)2] = sum(2);
+ @i64["bear", (long long)2] = sum(22);
+ @i64["dog", (long long)2] = sum(222);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d.out
new file mode 100644
index 000000000000..28e95ac3196f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d.out
@@ -0,0 +1,61 @@
+
+ dog -1 -111
+ cat -1 -1
+ bear -1 -11
+ dog -2 -222
+ cat -2 -2
+ bear -2 -22
+ dog 2 222
+ cat 2 2
+ bear 2 22
+ dog 1 111
+ cat 1 1
+ bear 1 11
+ dog 0 100
+ cat 0 0
+ bear 0 10
+ mouse -1 -1
+ cat -1 -111
+ bear -1 -11
+ mouse -2 -2
+ cat -2 -222
+ bear -2 -22
+ mouse 2 2
+ cat 2 222
+ bear 2 22
+ mouse 1 1
+ cat 1 111
+ bear 1 11
+ mouse 0 0
+ cat 0 100
+ bear 0 10
+ mouse 65535 -1
+ dog 65535 -11
+ cat 65535 -111
+ mouse 65534 -2
+ dog 65534 -22
+ cat 65534 -222
+ mouse 2 2
+ dog 2 22
+ cat 2 222
+ mouse 1 1
+ dog 1 11
+ cat 1 111
+ mouse 0 0
+ dog 0 10
+ cat 0 100
+ mouse 255 -111
+ dog 255 -11
+ cat 255 -1
+ mouse 254 -222
+ dog 254 -22
+ cat 254 -2
+ mouse 2 222
+ dog 2 22
+ cat 2 2
+ mouse 1 111
+ dog 1 11
+ cat 1 1
+ mouse 0 100
+ dog 0 10
+ cat 0 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d
new file mode 100644
index 000000000000..bb3ed4789bf5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d
@@ -0,0 +1,35 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+#pragma D option quiet
+
+/*
+ * Make sure the sizes of compatible keys doesn't affect the sort order.
+ */
+
+BEGIN
+{
+ @[(int)1, 0] = sum(10);
+ @[(uint64_t)2, 0] = sum(20);
+ @[(int)3, 0] = sum(30);
+ @[(uint64_t)4, 0] = sum(40);
+ printa(@);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out
new file mode 100644
index 000000000000..83252ade53ae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out
@@ -0,0 +1,6 @@
+
+ 1 0 10
+ 2 0 20
+ 3 0 30
+ 4 0 40
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d
new file mode 100644
index 000000000000..041b82070f84
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Positive stddev() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES: This is a simple verifiable positive test of the stddev() function.
+ * printa() for one aggregation, default printing behavior for the other
+ * so that we exercise both code paths.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a = stddev(5000000000);
+ @a = stddev(5000000100);
+ @a = stddev(5000000200);
+ @a = stddev(5000000300);
+ @a = stddev(5000000400);
+ @a = stddev(5000000500);
+ @a = stddev(5000000600);
+ @a = stddev(5000000700);
+ @a = stddev(5000000800);
+ @a = stddev(5000000900);
+ @b = stddev(-5000000000);
+ @b = stddev(-5000000100);
+ @b = stddev(-5000000200);
+ @b = stddev(-5000000300);
+ @b = stddev(-5000000400);
+ @b = stddev(-5000000500);
+ @b = stddev(-5000000600);
+ @b = stddev(-5000000700);
+ @b = stddev(-5000000800);
+ @b = stddev(-5000000900);
+ printa("%@d\n", @a);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out
new file mode 100644
index 000000000000..0c02852e452f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out
@@ -0,0 +1,3 @@
+287
+
+ 287
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d
new file mode 100644
index 000000000000..d508596a97ff
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d
@@ -0,0 +1,111 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+#define INTFUNC(x) \
+ BEGIN \
+ /*DSTYLED*/ \
+ { \
+ subr++; \
+ @[(long)x] = sum(1); \
+ /*DSTYLED*/ \
+ }
+
+#define STRFUNC(x) \
+ BEGIN \
+ /*DSTYLED*/ \
+ { \
+ subr++; \
+ @str[x] = sum(1); \
+ /*DSTYLED*/ \
+ }
+
+#define VOIDFUNC(x) \
+ BEGIN \
+ /*DSTYLED*/ \
+ { \
+ subr++; \
+ /*DSTYLED*/ \
+ }
+
+INTFUNC(rand())
+INTFUNC(mutex_owned(&`cpu_lock))
+INTFUNC(mutex_owner(&`cpu_lock))
+INTFUNC(mutex_type_adaptive(&`cpu_lock))
+INTFUNC(mutex_type_spin(&`cpu_lock))
+INTFUNC(rw_read_held(&`vfssw_lock))
+INTFUNC(rw_write_held(&`vfssw_lock))
+INTFUNC(rw_iswriter(&`vfssw_lock))
+INTFUNC(copyin(NULL, 1))
+STRFUNC(copyinstr(NULL, 1))
+INTFUNC(speculation())
+INTFUNC(progenyof($pid))
+INTFUNC(strlen("fooey"))
+VOIDFUNC(copyout)
+VOIDFUNC(copyoutstr)
+INTFUNC(alloca(10))
+VOIDFUNC(bcopy)
+VOIDFUNC(copyinto)
+INTFUNC(msgdsize(NULL))
+INTFUNC(msgsize(NULL))
+INTFUNC(getmajor(0))
+INTFUNC(getminor(0))
+STRFUNC(ddi_pathname(NULL, 0))
+STRFUNC(strjoin("foo", "bar"))
+STRFUNC(lltostr(12373))
+STRFUNC(basename("/var/crash/systemtap"))
+STRFUNC(dirname("/var/crash/systemtap"))
+STRFUNC(cleanpath("/var/crash/systemtap"))
+STRFUNC(strchr("The SystemTap, The.", 't'))
+STRFUNC(strrchr("The SystemTap, The.", 't'))
+STRFUNC(strstr("The SystemTap, The.", "The"))
+STRFUNC(strtok("The SystemTap, The.", "T"))
+STRFUNC(substr("The SystemTap, The.", 0))
+INTFUNC(index("The SystemTap, The.", "The"))
+INTFUNC(rindex("The SystemTap, The.", "The"))
+INTFUNC(htons(0x1234))
+INTFUNC(htonl(0x12345678))
+INTFUNC(htonll(0x1234567890abcdefL))
+INTFUNC(ntohs(0x1234))
+INTFUNC(ntohl(0x12345678))
+INTFUNC(ntohll(0x1234567890abcdefL))
+STRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof (ipaddr_t))))
+STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t))))
+STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t))))
+
+BEGIN
+/subr == DIF_SUBR_MAX + 1/
+{
+ exit(0);
+}
+
+BEGIN
+{
+ printf("found %d subroutines, expected %d\n", subr, DIF_SUBR_MAX + 1);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sum.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sum.d
new file mode 100644
index 000000000000..1b9025af9715
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sum.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Positive sum() test
+ *
+ * SECTION: Aggregations/Aggregations
+ *
+ * NOTES: This is verifiable simple positive test of the sum() function.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 1000/
+{
+ @a = sum(i);
+ i += 100;
+}
+
+tick-10ms
+/i == 1000/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sum.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sum.d.out
new file mode 100644
index 000000000000..5d8b37b8ac42
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sum.d.out
@@ -0,0 +1,2 @@
+
+ 4500
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc.d
new file mode 100644
index 000000000000..d1c1b3cc2f87
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+int i;
+
+tick-10ms
+/i < 100/
+{
+ @[i] = sum(i);
+ i++;
+}
+
+tick-10ms
+/i == 100/
+{
+ exit(0);
+}
+
+END
+{
+ trunc(@, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc.d.out
new file mode 100644
index 000000000000..2e18ef8bff29
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc.d.out
@@ -0,0 +1,11 @@
+
+ 90 90
+ 91 91
+ 92 92
+ 93 93
+ 94 94
+ 95 95
+ 96 96
+ 97 97
+ 98 98
+ 99 99
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d
new file mode 100644
index 000000000000..5c31069d8601
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+#pragma D option aggrate=1ms
+#pragma D option switchrate=50ms
+
+int i;
+
+tick-100ms
+/i < 10/
+{
+ @[i] = sum(10 - i);
+ i++;
+}
+
+tick-100ms
+/i == 5/
+{
+ trunc(@);
+}
+
+tick-100ms
+/i == 10/
+{
+ exit(0);
+}
+
+END
+{
+ printa(@);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d.out
new file mode 100644
index 000000000000..70dc7a026d8c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d.out
@@ -0,0 +1,7 @@
+
+ 9 1
+ 8 2
+ 7 3
+ 6 4
+ 5 5
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d
new file mode 100644
index 000000000000..8baa56ab9512
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+int i;
+
+tick-10ms
+/i < 100/
+{
+ @[i] = lquantize(i, 0, 150);
+ @[i] = lquantize(i + 1, 0, 150);
+ @[i] = lquantize(i + 2, 0, 150);
+ @[i] = lquantize(i + 3, 0, 150);
+ i++;
+}
+
+tick-10ms
+/i == 100/
+{
+ exit(0);
+}
+
+END
+{
+ trunc(@, 5);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d.out
new file mode 100644
index 000000000000..86975af33398
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d.out
@@ -0,0 +1,46 @@
+
+ 95
+ value ------------- Distribution ------------- count
+ 94 | 0
+ 95 |@@@@@@@@@@ 1
+ 96 |@@@@@@@@@@ 1
+ 97 |@@@@@@@@@@ 1
+ 98 |@@@@@@@@@@ 1
+ 99 | 0
+
+ 96
+ value ------------- Distribution ------------- count
+ 95 | 0
+ 96 |@@@@@@@@@@ 1
+ 97 |@@@@@@@@@@ 1
+ 98 |@@@@@@@@@@ 1
+ 99 |@@@@@@@@@@ 1
+ 100 | 0
+
+ 97
+ value ------------- Distribution ------------- count
+ 96 | 0
+ 97 |@@@@@@@@@@ 1
+ 98 |@@@@@@@@@@ 1
+ 99 |@@@@@@@@@@ 1
+ 100 |@@@@@@@@@@ 1
+ 101 | 0
+
+ 98
+ value ------------- Distribution ------------- count
+ 97 | 0
+ 98 |@@@@@@@@@@ 1
+ 99 |@@@@@@@@@@ 1
+ 100 |@@@@@@@@@@ 1
+ 101 |@@@@@@@@@@ 1
+ 102 | 0
+
+ 99
+ value ------------- Distribution ------------- count
+ 98 | 0
+ 99 |@@@@@@@@@@ 1
+ 100 |@@@@@@@@@@ 1
+ 101 |@@@@@@@@@@ 1
+ 102 |@@@@@@@@@@ 1
+ 103 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d
new file mode 100644
index 000000000000..ec0bee32a25a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * aggsortkeypos option works when sorting by values, values are
+ * equal, and keys are compared to break the tie
+ *
+ * SECTION: Aggregations, Printing Aggregations
+ *
+ */
+
+#pragma D option quiet
+#pragma D option aggsortkeypos=1
+
+BEGIN
+{
+ @[1, 3] = sum(0);
+ @[2, 2] = sum(0);
+ @[3, 1] = sum(0);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d.out
new file mode 100644
index 000000000000..9b0acf92e64c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d.out
@@ -0,0 +1,4 @@
+
+ 3 1 0
+ 2 2 0
+ 1 3 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0.d
new file mode 100644
index 000000000000..0b7b6610b377
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify that divide by 0 errors are caught
+ *
+ * SECTION:
+ * Types, Operators, and Expressions/Arithmetic Operators
+ */
+
+
+BEGIN
+{
+ c = 123/0;
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_1.d
new file mode 100644
index 000000000000..110179511ef2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_1.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify that computed divide by 0 errors are caught
+ *
+ * SECTION:
+ * Types, Operators, and Expressions/Arithmetic Operators
+ */
+
+
+
+
+BEGIN
+{
+ c = 123/(7-7);
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_2.d
new file mode 100644
index 000000000000..454696144fd9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_2.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify that computed divide by 0 errors are caught
+ *
+ * SECTION:
+ * Types, Operators, and Expressions/Arithmetic Operators
+ */
+
+
+
+
+
+BEGIN
+{
+ c = 123/((7-7) * 999);
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.modby0.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.modby0.d
new file mode 100644
index 000000000000..b2bf1462fe67
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.modby0.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify that mod by 0 errors are caught
+ *
+ * SECTION:
+ * Types, Operators, and Expressions/Arithmetic Operators
+ */
+
+
+
+BEGIN
+{
+ c = 123%0;
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.addmin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.addmin.d
new file mode 100644
index 000000000000..f20339c169ed
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.addmin.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Call invalid / impossible arithmetic operations and make sure
+ * Test gives compilation error.
+ *
+ * SECTION: Types, Operators, and Expressions/Arithmetic Operators
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+ i+-;
+ printf("The value of i is %d\n", i);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.divmin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.divmin.d
new file mode 100644
index 000000000000..c11e64fde5e9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.divmin.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Call invalid / impossible arithmetic operations and make sure
+ * Test gives compilation error.
+ *
+ * SECTION: Types, Operators, and Expressions/Arithmetic Operators
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 1;
+ i /-= i;
+ printf("The value of i is %d\n", i);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muladd.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muladd.d
new file mode 100644
index 000000000000..bb107fb3aebd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muladd.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Call invalid / impossible arithmetic operations and make sure
+ * Test gives compilation error.
+ *
+ * SECTION: Types, Operators, and Expressions/Arithmetic Operators
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 1;
+ i *+= i;
+ printf("The value of i is %d\n", i);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muldiv.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muldiv.d
new file mode 100644
index 000000000000..7d44b6c76e55
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muldiv.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Call invalid / impossible arithmetic operations and make sure
+ * Test gives compilation error.
+ *
+ * SECTION: Types, Operators, and Expressions/Arithmetic Operators
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 1;
+ i */= i;
+ printf("The value of i is %d\n", i);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d
new file mode 100644
index 000000000000..435f09f6d925
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple Arithmetic expressions.
+ * Call simple expressions and make sure test succeeds.
+ * Match expected output in tst.basics.d.out
+ *
+ * SECTION: Types, Operators, and Expressions/Arithmetic Operators
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+ i = 1 + 2 + 3;
+ printf("The value of i is %d\n", i);
+
+ i = i * 3;
+ printf("The value of i is %d\n", i);
+
+ i = (i * 3) + i;
+ printf("The value of i is %d\n", i);
+
+ i = (i + (i * 3) + i) * i;
+ printf("The value of i is %d\n", i);
+
+ i = i - (i + (i * 3) + i) * i / i * i;
+ printf("The value of i is %d\n", i);
+
+ i = i * (i - 3 + 5 / i * i ) / i * 6;
+ printf("The value of i is %d\n", i);
+
+ i = i ^ 5;
+ printf("The value of i is %d\n", i);
+
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out
new file mode 100644
index 000000000000..d3b6af813101
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out
@@ -0,0 +1,8 @@
+The value of i is 6
+The value of i is 18
+The value of i is 72
+The value of i is 25920
+The value of i is 935761216
+The value of i is -91738734
+The value of i is -91738729
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d
new file mode 100644
index 000000000000..714fbe373b2c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * Test compile-time casting between integer types of different size.
+ */
+
+#pragma D option quiet
+
+int64_t x;
+
+BEGIN
+{
+ x = (int32_t)(int16_t)0xfff0;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (int32_t)(uint16_t)0xfff0;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (uint32_t)(int16_t)0xfff0;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (uint32_t)(uint16_t)0xfff0;
+ printf("%16x %20d %20u\n", x, x, x);
+ printf("\n");
+
+ x = (int16_t)(int32_t)0xfff0;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (int16_t)(uint32_t)0xfff0;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (uint16_t)(int32_t)0xfff0;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (uint16_t)(uint32_t)0xfff0;
+ printf("%16x %20d %20u\n", x, x, x);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out
new file mode 100644
index 000000000000..d43df27d5d5c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out
@@ -0,0 +1,10 @@
+fffffffffffffff0 -16 18446744073709551600
+ fff0 65520 65520
+ fffffff0 4294967280 4294967280
+ fff0 65520 65520
+
+fffffffffffffff0 -16 18446744073709551600
+fffffffffffffff0 -16 18446744073709551600
+ fff0 65520 65520
+ fff0 65520 65520
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d
new file mode 100644
index 000000000000..0589b721b421
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d
@@ -0,0 +1,36 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * Test narrowing at assignment.
+ */
+
+#pragma D option quiet
+
+uint16_t x;
+uint32_t y;
+
+BEGIN
+{
+ x = 0xbeefcafe;
+ y = x;
+ printf("%x", y); /* where's the beef? */
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out
new file mode 100644
index 000000000000..ea17b160d298
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out
@@ -0,0 +1 @@
+cafe
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d
new file mode 100644
index 000000000000..a7017bfee5e7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * Test execution-time casting between integer types of different size.
+ */
+
+#pragma D option quiet
+
+int64_t x;
+
+BEGIN
+{
+ z = 0xfff0;
+
+ x = (int32_t)(int16_t)z;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (int32_t)(uint16_t)z;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (uint32_t)(int16_t)z;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (uint32_t)(uint16_t)z;
+ printf("%16x %20d %20u\n", x, x, x);
+ printf("\n");
+
+ x = (int16_t)(int32_t)z;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (int16_t)(uint32_t)z;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (uint16_t)(int32_t)z;
+ printf("%16x %20d %20u\n", x, x, x);
+ x = (uint16_t)(uint32_t)z;
+ printf("%16x %20d %20u\n", x, x, x);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out
new file mode 100644
index 000000000000..d43df27d5d5c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out
@@ -0,0 +1,10 @@
+fffffffffffffff0 -16 18446744073709551600
+ fff0 65520 65520
+ fffffff0 4294967280 4294967280
+ fff0 65520 65520
+
+fffffffffffffff0 -16 18446744073709551600
+fffffffffffffff0 -16 18446744073709551600
+ fff0 65520 65520
+ fff0 65520 65520
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_ARR_BADREF.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_ARR_BADREF.bad.d
new file mode 100644
index 000000000000..d31b1f64c87c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_ARR_BADREF.bad.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Tuples can not be used in non-associative arrays.
+ *
+ * SECTION: Pointers and Arrays/Array Declarations and Storage
+ */
+
+int x[5];
+
+BEGIN
+{
+ x[1, 2] = 1;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRBIG.toobig.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRBIG.toobig.d
new file mode 100644
index 000000000000..80422e884796
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRBIG.toobig.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Array declarations with indexs over INT_MAX return a
+ * D_DECL_ARRBIG errtag.
+ *
+ * SECTION:
+ * Pointers and Arrays/Array Declarations and Storage
+ */
+
+int x[88294967295];
+
+BEGIN
+{
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRNULL.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRNULL.bad.d
new file mode 100644
index 000000000000..6e7a34ff01f3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRNULL.bad.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Arrays must have array dimensions
+ *
+ * SECTION: Pointers and Arrays/Array Declarations and Storage
+ */
+
+int a[];
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRSUB.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRSUB.bad.d
new file mode 100644
index 000000000000..f44036771b88
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRSUB.bad.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Arrays declarations must have a positive constant as a
+ * subscription.
+ *
+ * SECTION: Pointers and Arrays/Array Declarations and Storage
+ */
+
+int a[-7];
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_PROTO_TYPE.badtuple.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_PROTO_TYPE.badtuple.d
new file mode 100644
index 000000000000..7e879dc6120a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_PROTO_TYPE.badtuple.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invalid tuple types result in a DT_DECL_ARRTYPE error.
+ *
+ * SECTION:
+ * Pointers and Arrays/Array Declarations and Storage
+ */
+
+
+int x[void, char];
+
+BEGIN
+{
+ x[trace(), 'a'] = 456;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_IDENT_UNDEF.badureg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_IDENT_UNDEF.badureg.d
new file mode 100644
index 000000000000..e48541b61670
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_IDENT_UNDEF.badureg.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Arrays declarations must have a positive constant as a
+ * subscription.
+ *
+ * SECTION: User Process Tracing/uregs Array
+ */
+
+BEGIN
+{
+ printf("FOO = 0x%x\n", uregs[FOO]);
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic1.d
new file mode 100644
index 000000000000..ba5b2cf0d15c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic1.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple array test
+ *
+ * SECTION: Pointers and Arrays/Array Declarations and Storage
+ *
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ a[1] = 0;
+}
+
+tick-1
+/a[1] == 0/
+{
+ exit(0);
+}
+
+tick-1
+/a[1] != 0/
+{
+ printf("Expected 0, got %d\n", a[1]);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic2.d
new file mode 100644
index 000000000000..14e1c5cf4503
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic2.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple array test
+ *
+ * SECTION: Pointers and Arrays/Array Declarations and Storage
+ *
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ a[1] = 0;
+ a[1]++;
+}
+
+tick-1
+/a[1] == 1/
+{
+ exit(0);
+}
+
+tick-1
+/a[1] != 1/
+{
+ printf("Expected 1, got %d\n", a[1]);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic3.d
new file mode 100644
index 000000000000..897a12f2f23e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic3.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple array test
+ *
+ * SECTION: Pointers and Arrays/Array Declarations and Storage
+ *
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ a[1] = 0;
+ ++a[1];
+}
+
+tick-1
+/a[1] == 1/
+{
+ exit(0);
+}
+
+tick-1
+/a[1] != 1/
+{
+ printf("Expected 1, got %d\n", a[1]);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic4.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic4.d
new file mode 100644
index 000000000000..3635a42d5387
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic4.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple array test
+ *
+ * SECTION: Pointers and Arrays/Array Declarations and Storage
+ *
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ a["test"] = 0;
+}
+
+tick-1
+/a["test"] == 0/
+{
+ exit(0);
+}
+
+tick-1
+/a["test"] != 0/
+{
+ printf("Expected 0, got %d\n", a["test"]);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic5.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic5.d
new file mode 100644
index 000000000000..866a8c39aeb2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic5.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple array test
+ *
+ * SECTION: Pointers and Arrays/Array Declarations and Storage
+ *
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ a["test"] = 0;
+ b = ++a["test"];
+}
+
+tick-1
+/b == 1/
+{
+ exit(0);
+}
+
+tick-1
+/b != 1/
+{
+ printf("Expected b = 1, got %d\n", b);
+ exit(1);
+}
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic6.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic6.d
new file mode 100644
index 000000000000..0371db309331
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic6.d
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple array test
+ *
+ * SECTION: Pointers and Arrays/Array Declarations and Storage
+ *
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ a["test", "test"] = 0;
+ b = ++a["test", "test"];
+}
+
+tick-1
+/b == 1/
+{
+ exit(0);
+}
+
+tick-1
+/b != 1/
+{
+ printf("Expected b = 1, got %d\n", b);
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.uregsarray.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.uregsarray.d
new file mode 100644
index 000000000000..b3fba0ca4c82
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.uregsarray.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Positive test to make sure that we can invoke common
+ * ureg[] aliases.
+ *
+ * SECTION: User Process Tracing/uregs Array
+ *
+ * NOTES: This test does no verification - the value of the output
+ * is not deterministic.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("R_PC = 0x%x\n", uregs[R_PC]);
+ printf("R_SP = 0x%x\n", uregs[R_SP]);
+ printf("R_R0 = 0x%x\n", uregs[R_R0]);
+ printf("R_R1 = 0x%x\n", uregs[R_R1]);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d
new file mode 100644
index 000000000000..267d121274c7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test assigning a variable two different incompatible types. This should
+ * result in a compile-time error.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ */
+
+BEGIN
+{
+ x[123] = `kmem_flags;
+ x[456] = *`rootvp;
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d
new file mode 100644
index 000000000000..ce360cd25d9a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test assigning a variable two different incompatible types. This should
+ * result in a compile-time error.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ */
+
+BEGIN
+{
+ self->x[123] = `kmem_flags;
+ self->x[456] = *`rootvp;
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.this.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.this.d
new file mode 100644
index 000000000000..2af07ca52ae1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.this.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ *
+ * Declare 'this int' variable and assign inappropriate data type.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ *
+ */
+
+#pragma D option quiet
+
+this int x;
+
+BEGIN
+{
+ this->x = "dummy";
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_ARG.badsig.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_ARG.badsig.d
new file mode 100644
index 000000000000..d682fc68883d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_ARG.badsig.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test an associative array reference that is invalid because of a type
+ * signature mismatch -- this should produce a syntax error at compile time.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ */
+
+BEGIN
+{
+ x[123, "foo"] = timestamp;
+}
+
+END
+{
+ x[123, 456] = timestamp;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toofew.d
new file mode 100644
index 000000000000..b4e82b858880
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toofew.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test an associative array reference that is invalid because of too few
+ * arguments -- this should produce a syntax error at compile time.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ */
+
+BEGIN
+{
+ x[123, 456] = timestamp;
+}
+
+END
+{
+ x[123] = timestamp;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toomany.d
new file mode 100644
index 000000000000..3dc5f7dd7917
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toomany.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test an associative array reference that is invalid because of too many
+ * arguments -- this should produce a syntax error at compile time.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ */
+
+BEGIN
+{
+ x[123, 456] = timestamp;
+}
+
+END
+{
+ x[123, 456, 789] = timestamp;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_SYNTAX.errassign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_SYNTAX.errassign.d
new file mode 100644
index 000000000000..f31b66f11558
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_SYNTAX.errassign.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Assign one to 10 elements; make sure fails to compile.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ */
+
+BEGIN
+{
+ x[10]=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
+}
+
+END
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.tupoflow.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.tupoflow.d
new file mode 100644
index 000000000000..810420267523
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.tupoflow.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Generates an associative array reference that should overflow the tuple
+ * register stack. We should detect and report this at compile time.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ */
+
+BEGIN
+{
+ a[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] = 0;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.cpyarray.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.cpyarray.d
new file mode 100644
index 000000000000..ca31cc3590d9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.cpyarray.d
@@ -0,0 +1,65 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Copy value from associative arrays to local variables.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ *
+ */
+
+#pragma D option quiet
+
+this int x;
+
+BEGIN
+{
+ a["abc", 123] = 123;
+}
+
+tick-10ms
+{
+ this->x = a["abc", 123]++;
+ printf("The value of x is %d\n", this->x);
+}
+
+tick-10ms
+{
+ this->x = a["abc", 123]++;
+ printf("The value of x is %d\n", this->x);
+}
+
+tick-10ms
+{
+ this->x = a["abc", 123]++;
+ printf("The value of x is %d\n", this->x);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.diffprofile.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.diffprofile.d
new file mode 100644
index 000000000000..ad5fb377e55e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.diffprofile.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * To test Clause Local Variables ' this' across different profiles.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ *
+ */
+
+#pragma D option quiet
+
+this int x;
+this char c;
+
+tick-10ms
+{
+ this->x = 123;
+ this->c = 'D';
+ printf("The value of x is %d\n", this->x);
+}
+
+tick-10ms
+{
+ this->x = 235;
+ printf("The value of x is %d\n", this->x);
+}
+
+tick-10ms
+{
+ this->x = 456;
+ printf("The value of x is %d\n", this->x);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.initialize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.initialize.d
new file mode 100644
index 000000000000..1ab222b151c0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.initialize.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Clause local variables are not initialized to zero.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ *
+ */
+
+#pragma D option quiet
+
+this int x;
+
+BEGIN
+{
+ printf("the value of x is %d\n", this->x);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.invalidref.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.invalidref.d
new file mode 100644
index 000000000000..446acfad4d7f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.invalidref.d
@@ -0,0 +1,75 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * Test to ensure that invalid stores to a global associative array
+ * are caught correctly.
+ */
+
+#pragma D option quiet
+
+int last_cmds[int][4];
+
+BEGIN
+{
+ errors = 0;
+ forward = 0;
+ backward = 0;
+}
+
+tick-1s
+/!forward/
+{
+ forward = 1;
+ last_cmds[1][4] = 0xdeadbeef;
+}
+
+tick-1s
+/!backward/
+{
+ backward = 1;
+ last_cmds[1][-5] = 0xdeadbeef;
+}
+
+tick-1s
+/errors > 1/
+{
+ exit(0);
+}
+
+tick-1s
+/n++ > 5/
+{
+ exit(1);
+}
+
+ERROR
+/arg4 == DTRACEFLT_BADADDR/
+{
+ errors++;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.misc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.misc.d
new file mode 100644
index 000000000000..43147dec694d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.misc.d
@@ -0,0 +1,69 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the different kinds of associative scalar references.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ * NOTES:
+ * In particular, we test accessing a DTrace associative array
+ * defined with scalar type (first ref that forces creation as both global
+ * and TLS), and DTrace associative array scalar subsequent references
+ * (both global and TLS).
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i != 5/
+{
+ x[123, "foo"] = 123;
+ self->x[456, "bar"] = 456;
+ i++;
+}
+
+tick-10ms
+/i != 5/
+{
+ printf("x[] = %d\n", x[123, "foo"]);
+ printf("self->x[] = %d\n", self->x[456, "bar"]);
+}
+
+tick-10ms
+/i == 5/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d
new file mode 100644
index 000000000000..3a7d6a2c6413
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * This test confirms the orthogonality of associative arrays and thread-local
+ * variables by intentionally deriving a matching key signature (based on
+ * t_did).
+ */
+uint64_t b[uint64_t];
+
+BEGIN
+{
+ self->a = 0xbad;
+}
+
+BEGIN
+/b[curthread->td_flags] == 0/
+{
+ exit(0);
+}
+
+BEGIN
+{
+ printf("value should be 0; value is %x!", b[curthread->td_flags]);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.this.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.this.d
new file mode 100644
index 000000000000..c4d01fa35fae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.this.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * To test Clause Local Variables ' this'.
+ *
+ * SECTION: Variables/Associative Arrays
+ *
+ *
+ */
+
+#pragma D option quiet
+
+this int x;
+this char c;
+
+BEGIN
+{
+ this->x = 123;
+ this->c = 'D';
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.valassign.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.valassign.d.out
new file mode 100644
index 000000000000..948d82e9d61d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.valassign.d.out
@@ -0,0 +1,2 @@
+The value of i is 123
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.begin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.begin.d
new file mode 100644
index 000000000000..c2a60889218b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.begin.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Arguments to BEGIN provider not allowed.
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+BEGIN::read:entry
+{
+ printf("Begin fired first\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.tick.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.tick.d
new file mode 100644
index 000000000000..44a363f80401
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.tick.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * concat of providers not allowed with BEGIN
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+
+BEGIN:tick-1
+{
+ printf("Begin fired first\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.begin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.begin.d
new file mode 100644
index 000000000000..43e7744e6e76
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.begin.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Order of provider flow, Begin, tick profile, and END.
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+END
+{
+ printf("End fired after exit\n");
+}
+
+BEGIN
+{
+ printf("Begin fired first\n");
+}
+
+tick-1ms
+{
+ printf("tick fired second\n");
+ printf("Call exit\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.begin.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.begin.d.out
new file mode 100644
index 000000000000..a9d8ee1e7c3e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.begin.d.out
@@ -0,0 +1,5 @@
+Begin fired first
+tick fired second
+Call exit
+End fired after exit
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.multibegin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.multibegin.d
new file mode 100644
index 000000000000..3d5fd124f7fa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.multibegin.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Multiple BEGIN providers
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("Begin fired first\n");
+}
+BEGIN
+{
+ printf("Begin fired second\n");
+}
+BEGIN
+{
+ printf("Begin fired third\n");
+}
+BEGIN
+{
+ printf("Begin fired fourth\n");
+}
+BEGIN
+{
+ printf("Begin fired fifth\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.multibegin.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.multibegin.d.out
new file mode 100644
index 000000000000..e5bb99669906
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.multibegin.d.out
@@ -0,0 +1,6 @@
+Begin fired first
+Begin fired second
+Begin fired third
+Begin fired fourth
+Begin fired fifth
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_ADDROF_BITFIELD.BitfieldAddress.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_ADDROF_BITFIELD.BitfieldAddress.d
new file mode 100644
index 000000000000..9c5aca4c1948
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_ADDROF_BITFIELD.BitfieldAddress.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Cannot take the address of a bit-field member using the &
+ * operator.
+ *
+ * SECTION: Structs and Unions/Bit-Fields
+ */
+
+#pragma D option quiet
+
+struct bitRecord{
+ int a : 1;
+ int b : 3;
+ int c : 12;
+} var;
+
+BEGIN
+{
+ printf("address of a: %d\naddress of b: %d\naddress of c: %dn",
+ &var.a, &var.b, &var.c);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.NegBitField.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.NegBitField.d
new file mode 100644
index 000000000000..acb296f4cec0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.NegBitField.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Bit-field width must be positive.
+ *
+ * SECTION: Structs and Unions/Bit-Fields
+ */
+
+#pragma D option quiet
+
+struct bitRecord{
+ int a : 1;
+ int b : -3;
+ int c : 12;
+} var;
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.ZeroBitField.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.ZeroBitField.d
new file mode 100644
index 000000000000..dfe24c59537c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.ZeroBitField.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Bit-fields must be positive and non-zero.
+ *
+ * SECTION: Structs and Unions/Bit-Fields
+ */
+
+#pragma D option quiet
+
+struct bitRecord{
+ int a : 1;
+ int b : 0;
+ int c : 12;
+} var;
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.ExceedBaseType.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.ExceedBaseType.d
new file mode 100644
index 000000000000..d9abfd1330b9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.ExceedBaseType.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Bit-field width must be of a number of bits not larger than
+ * that of the corresponding base type.
+ *
+ * SECTION: Structs and Unions/Bit-Fields
+ */
+
+#pragma D option quiet
+
+struct bitRecord1{
+ char a : 10;
+} var1;
+
+struct bitRecord2{
+ short a : 33;
+} var2;
+
+struct bitRecord3{
+ long long a : 65;
+} var3;
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.GreaterThan64.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.GreaterThan64.d
new file mode 100644
index 000000000000..c1e359ed8efc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.GreaterThan64.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Bit-field width cannot be greater than 64 bits in D.
+ *
+ * SECTION: Structs and Unions/Bit-Fields
+ */
+
+#pragma D option quiet
+
+struct bitRecord{
+ int a : 1;
+ int b : 65;
+ int c : 12;
+} var;
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFTYPE.badtype.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFTYPE.badtype.d
new file mode 100644
index 000000000000..5e7b5233055b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFTYPE.badtype.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Non-integer types used for bitfields will result in a D_DECL_BFTYPE
+ * error.
+ *
+ * SECTION: Structs and Unions/Bit-Fields
+ */
+
+#pragma D option quiet
+
+struct bits {
+ float : 1;
+} xyz;
+
+BEGIN
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_OFFSETOF_BITFIELD.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_OFFSETOF_BITFIELD.d
new file mode 100644
index 000000000000..402a209d1e39
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_OFFSETOF_BITFIELD.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Cannot apply offsetof operator to a bit-field member.
+ *
+ * SECTION: Structs and Unions/Bit-Fields
+ *
+ */
+#pragma D option quiet
+
+struct bitRecord{
+ int a : 17;
+ int b : 3;
+ int c : 12;
+} var;
+
+BEGIN
+{
+ printf("offsetof(struct bitRecord, a): %d\n",
+ offsetof(struct bitRecord, a));
+ printf("offsetof(struct bitRecord, b): %d\n",
+ offsetof(struct bitRecord, b));
+ printf("offsetof(struct bitRecord, c): %d\n",
+ offsetof(struct bitRecord, c));
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_SIZEOF_BITFIELD.SizeofBitfield.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_SIZEOF_BITFIELD.SizeofBitfield.d
new file mode 100644
index 000000000000..70c28340d425
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_SIZEOF_BITFIELD.SizeofBitfield.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Cannot apply sizeof operator to a bit-field member.
+ *
+ * SECTION: Structs and Unions/Bit-Fields
+ */
+
+#pragma D option quiet
+
+struct bitRecord{
+ int a : 1;
+ int b : 3;
+ int c : 12;
+} var;
+
+BEGIN
+{
+ printf("sizeof (a): %d\nsizeof (b): %d\nsizeof (c): %n",
+ sizeof (var.a), sizeof (var.b), sizeof (var.c));
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/tst.BitFieldPromotion.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/tst.BitFieldPromotion.d
new file mode 100644
index 000000000000..07ec728bc500
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/tst.BitFieldPromotion.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Bit-field will be automatically promoted to the next largest
+ * integer type for use in any expression and then the value assigned will
+ * warp around the maximum number assignable to the data type.
+ *
+ * SECTION: Structs and Unions/Bit-Fields
+ */
+
+#pragma D option quiet
+
+struct bitRecord{
+ int a : 1;
+ int b : 15;
+ int c : 31;
+} var;
+
+BEGIN
+{
+ var.a = 256;
+ var.b = 65536;
+ var.c = 4294967296;
+
+ printf("bitRecord.a: %d\nbitRecord.b: %d\nbitRecord.c: %d\n",
+ var.a, var.b, var.c);
+ exit(0);
+}
+
+END
+/(0 != var.a) || (0 != var.b) || (0 != var.c)/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/tst.SizeofBitField.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/tst.SizeofBitField.d
new file mode 100644
index 000000000000..ce307de6194a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/tst.SizeofBitField.d
@@ -0,0 +1,109 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: C and D compilers try to pack bits as efficiently as possible.
+ *
+ * SECTION: Structs and Unions/Bit-Fields
+ */
+
+#pragma D option quiet
+
+struct bitRecord1 {
+ int a : 1;
+} var1;
+
+struct bitRecord2 {
+ int a : 1;
+ int b : 3;
+} var2;
+
+struct bitRecord3 {
+ int a : 1;
+ int b : 3;
+ int c : 3;
+} var3;
+
+struct bitRecord4 {
+ int a : 1;
+ int b : 3;
+ int c : 3;
+ int d : 3;
+} var4;
+
+struct bitRecord5 {
+ int c : 12;
+ int a : 10;
+ int b : 3;
+} var5;
+
+struct bitRecord6 {
+ int a : 20;
+ int b : 3;
+ int c : 12;
+} var6;
+
+struct bitRecord7 {
+ long c : 32;
+ long long d: 9;
+ int e: 1;
+} var7;
+
+struct bitRecord8 {
+ char a : 2;
+ short b : 12;
+ long c : 32;
+} var8;
+
+struct bitRecord12 {
+ int a : 30;
+ int b : 30;
+ int c : 32;
+} var12;
+
+BEGIN
+{
+ printf("sizeof (bitRecord1): %d\n", sizeof (var1));
+ printf("sizeof (bitRecord2): %d\n", sizeof (var2));
+ printf("sizeof (bitRecord3): %d\n", sizeof (var3));
+ printf("sizeof (bitRecord4): %d\n", sizeof (var4));
+ printf("sizeof (bitRecord5): %d\n", sizeof (var5));
+ printf("sizeof (bitRecord6): %d\n", sizeof (var6));
+ printf("sizeof (bitRecord7): %d\n", sizeof (var7));
+ printf("sizeof (bitRecord8): %d\n", sizeof (var8));
+ printf("sizeof (bitRecord12): %d\n", sizeof (var12));
+ exit(0);
+}
+
+END
+/(1 != sizeof (var1)) || (2 != sizeof (var2)) || (3 != sizeof (var3)) ||
+ (4 != sizeof (var4)) || (5 != sizeof (var5)) || (6 != sizeof (var6))
+ || (7 != sizeof (var7)) || (8 != sizeof (var8)) || (12 != sizeof (var12))/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.end.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.end.d
new file mode 100644
index 000000000000..a480d67a476d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.end.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Checks that buffer space for an END enabling is always reserved in a
+ * fill buffer. This will fail because the size of the END enabling
+ * (64 bytes) exceeds the size of the buffer (32 bytes).
+ *
+ * SECTION: Buffers and Buffering/fill Policy;
+ * Buffers and Buffering/Buffer Sizes;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/strsize
+ */
+
+#pragma D option bufpolicy=fill
+#pragma D option bufsize=32
+#pragma D option strsize=64
+
+BEGIN
+{
+ exit(0);
+}
+
+END
+{
+ trace(execname);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize1.d
new file mode 100644
index 000000000000..4731bd1ff8d2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize1.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Checks that setting "bufresize" to "manual" will cause buffer
+ * allocation to fail for large principal buffer sizes.
+ *
+ * SECTION: Buffers and Buffering/Buffer Resizing Policy;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufresize
+ *
+ */
+
+#pragma D option bufresize=manual
+#pragma D option bufsize=100t
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize2.d
new file mode 100644
index 000000000000..4dfe6b65c545
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize2.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Checks that setting "bufresize" to "manual" will cause buffer
+ * allocation to fail for large aggregation buffer sizes.
+ *
+ * SECTION: Buffers and Buffering/Buffer Resizing Policy;
+ * Options and Tunables/bufresize;
+ * Options and Tunables/aggsize
+ *
+ */
+
+#pragma D option bufresize=manual
+#pragma D option aggsize=100t
+
+BEGIN
+{
+ @a[probeprov] = count();
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize3.d
new file mode 100644
index 000000000000..866a56c6112d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize3.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Checks that setting "bufresize" to "manual" will cause buffer
+ * allocation to fail for large speculative buffer sizes.
+ *
+ * SECTION: Buffers and Buffering/Buffer Resizing Policy;
+ * Options and Tunables/bufresize;
+ * Options and Tunables/specsize
+ *
+ */
+
+#pragma D option bufresize=manual
+#pragma D option specsize=100t
+
+BEGIN
+{
+ spec = speculation();
+}
+
+BEGIN
+{
+ speculate(spec);
+ trace(epid);
+}
+
+BEGIN
+{
+ commit(spec);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.zerobuf.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.zerobuf.d
new file mode 100644
index 000000000000..a2e44350eeda
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.zerobuf.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test with a bufsize of 0 - should return an error.
+ *
+ * SECTION:
+ * Buffers and Buffering/Buffer Sizes;
+ * Options and Tunables/bufsize
+ */
+
+#pragma D option bufsize=0
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.alignring.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.alignring.d
new file mode 100644
index 000000000000..152acb61cd9c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.alignring.d
@@ -0,0 +1,81 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for ring buffer policy.
+ *
+ * SECTION: Buffers and Buffering/ring Policy;
+ * Buffers and Buffering/Buffer Sizes;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy
+ */
+
+#pragma D option bufpolicy=ring
+#pragma D option bufsize=4k
+
+profile:::profile-1009hz
+{
+ printf("%x %x\n", (int)0xaaaa, (int)0xbbbb);
+}
+
+profile:::profile-1237hz
+{
+ printf("%x %x %x %x %x %x\n",
+ (int)0xcccc,
+ (int)0xdddd,
+ (int)0xeeee,
+ (int)0xffff,
+ (int)0xabab,
+ (int)0xacac);
+ printf("%x %x\n",
+ (uint64_t)0xaabbaabbaabbaabb,
+ (int)0xadad);
+}
+
+profile:::profile-1789hz
+{
+ printf("%x %x %x %x %x\n",
+ (int)0xaeae,
+ (int)0xafaf,
+ (unsigned char)0xaa,
+ (int)0xbcbc,
+ (int)0xbdbd);
+}
+
+profile-1543hz
+{}
+
+profile-1361hz
+{}
+
+tick-1sec
+/i++ >= 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.cputime.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.cputime.ksh
new file mode 100644
index 000000000000..6ac0fa9e27a3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.cputime.ksh
@@ -0,0 +1,90 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -s /dev/stdin -x bufpolicy=$1 $1 <<EOF
+
+ #pragma D option quiet
+ #pragma D option statusrate=1hz
+
+ uint64_t total;
+ int thresh;
+
+ BEGIN
+ {
+ start = timestamp;
+ thresh = 10;
+ }
+
+ sched:::on-cpu
+ /pid == \$pid/
+ {
+ self->on = vtimestamp;
+ }
+
+ sched:::off-cpu
+ /self->on/
+ {
+ total += vtimestamp - self->on;
+ }
+
+ tick-1sec
+ /i++ == 10/
+ {
+ exit(0);
+ }
+
+ END
+ /((total * 100) / (timestamp - start)) > thresh/
+ {
+ printf("'%s' buffering policy took %d%% of CPU; ",
+ \$\$1, ((total * 100) / (timestamp - start)));
+ printf("expected no more than %d%%!\n", thresh);
+ exit(1);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+for policy in "fill ring switch"; do
+ script $policy
+
+ status=$?
+
+ if [ "$status" -ne 0 ]; then
+ exit $status
+ fi
+done
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.dynvarsize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.dynvarsize.d
new file mode 100644
index 000000000000..c8a074002d5d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.dynvarsize.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for dynamic variable size.
+ *
+ * SECTION: Buffers and Buffering/switch Policy;
+ * Buffers and Buffering/Buffer Sizes;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/switchrate
+ */
+
+#pragma D option dynvarsize=100
+#pragma D option quiet
+
+int n;
+
+tick-10ms
+/n++ < 100/
+{
+ a[n] = 1;
+}
+
+tick-10ms
+/n == 100/
+{
+ exit(2);
+}
+
+END
+/a[99]/
+{
+ exit(1);
+}
+
+END
+/!a[99]/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d
new file mode 100644
index 000000000000..fffc7e3d550c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d
@@ -0,0 +1,118 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ * Positive test for fill buffer policy.
+ *
+ * SECTION: Buffers and Buffering/fill Policy;
+ * Buffers and Buffering/Buffer Sizes;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+/*
+ * This is a brute-force way of testing fill buffers. We assume that
+ * each printf() stores 16 bytes (4x 32-bit words for EPID, timestamp
+ * lo, timestamp hi, and the variable i). Because each fill buffer is
+ * per-CPU, we must fill up our buffer in one series of enablings on a
+ * single CPU.
+ */
+#pragma D option bufpolicy=fill
+#pragma D option bufsize=128
+#pragma D option statusrate=10ms
+#pragma D option quiet
+
+int i;
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+{
+ printf("%d\n", i++);
+}
+
+tick-10ms
+/i >= 100/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d.out
new file mode 100644
index 000000000000..fd8abec1dfe6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d.out
@@ -0,0 +1,9 @@
+0
+1
+2
+3
+4
+5
+6
+7
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d
new file mode 100644
index 000000000000..396a80811629
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Checks that setting "bufresize" to "auto" will cause buffer
+ * allocation to succeed, even for large principal buffer sizes.
+ *
+ * SECTION: Buffers and Buffering/Buffer Resizing Policy;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufresize
+ *
+ * NOTES:
+ * We use the undocumented "preallocate" option to make sure dtrace(1M)
+ * has enough space in its heap to allocate a buffer as large as the
+ * kernel's trace buffer.
+ */
+
+#pragma D option preallocate=100t
+#pragma D option bufresize=auto
+#pragma D option bufsize=100t
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d
new file mode 100644
index 000000000000..50b814b1bfc1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Checks that setting "bufresize" to "auto" will cause buffer
+ * allocation to succeed, even for large aggregation buffer sizes.
+ *
+ * SECTION: Buffers and Buffering/Buffer Resizing Policy;
+ * Options and Tunables/aggsize;
+ * Options and Tunables/bufresize
+ *
+ * NOTES:
+ * We use the undocumented "preallocate" option to make sure dtrace(1M)
+ * has enough space in its heap to allocate a buffer as large as the
+ * kernel's trace buffer.
+ */
+
+#pragma D option preallocate=100t
+#pragma D option bufresize=auto
+#pragma D option aggsize=100t
+
+BEGIN
+{
+ @a[probeprov] = count();
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize3.d
new file mode 100644
index 000000000000..eb362fb31372
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize3.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Checks that setting "bufresize" to "auto" will cause buffer
+ * allocation to succeed, even for large speculative buffer sizes.
+ *
+ * SECTION: Buffers and Buffering/Buffer Resizing Policy;
+ * Options and Tunables/specsize;
+ * Options and Tunables/bufresize
+ *
+ * NOTES:
+ * On some small memory machines, this test may consume so much memory
+ * that it induces memory allocation failure in the dtrace library. This
+ * will manifest itself as an error like one of the following:
+ *
+ * dtrace: processing aborted: Memory allocation failure
+ * dtrace: could not enable tracing: Memory allocation failure
+ *
+ * These actually indicate that the test performed as expected; failures
+ * of the above nature should therefore be ignored.
+ *
+ */
+
+#pragma D option bufresize=auto
+#pragma D option specsize=100t
+
+BEGIN
+{
+ spec = speculation();
+}
+
+BEGIN
+{
+ speculate(spec);
+ trace(epid);
+}
+
+BEGIN
+{
+ commit(spec);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring1.d
new file mode 100644
index 000000000000..67e7b8755561
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring1.d
@@ -0,0 +1,75 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for ring buffer policy.
+ *
+ * SECTION: Buffers and Buffering/ring Policy;
+ * Buffers and Buffering/Buffer Sizes;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/switchrate
+ */
+
+/*
+ * We assume that a trace() of an integer stores at least 8 bytes. If ring
+ * buffering is not working properly, this trace() will induce a drop, and the
+ * counter won't be incremented. We set the switchrate to one second just to
+ * sure that a high switchrate doesn't mask broken ring buffers.
+ */
+#pragma D option bufpolicy=ring
+#pragma D option bufsize=50
+#pragma D option switchrate=1sec
+
+int n;
+int i;
+
+tick-10msec
+/n < 300/
+{
+ trace(i);
+ i++;
+}
+
+tick-10msec
+/n < 300/
+{
+ n++;
+}
+
+tick-10msec
+/n == 300/
+{
+ exit(2);
+}
+
+END
+{
+ exit(i == 300 ? 0 : 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring2.d
new file mode 100644
index 000000000000..cbf48f2b0103
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring2.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for ring buffer policy.
+ *
+ * SECTION: Buffers and Buffering/ring Policy;
+ * SECTION: Buffers and Buffering/Buffer Sizes;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy
+ */
+
+#pragma D option bufpolicy=ring
+#pragma D option bufsize=512k
+#pragma D option quiet
+
+tick-1sec
+/n < 5/
+{
+ printf("%d\n", n++);
+}
+
+tick-1sec
+/n == 5/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring2.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring2.d.out
new file mode 100644
index 000000000000..cc4d41aab2b2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring2.d.out
@@ -0,0 +1,6 @@
+0
+1
+2
+3
+4
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d
new file mode 100644
index 000000000000..68e35889eca0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for ring buffer policy.
+ *
+ * SECTION: Buffers and Buffering/ring Policy;
+ * Buffers and Buffering/Buffer Sizes;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy
+ */
+
+/*
+ * We make some regrettable assumptions about the implementation in this test.
+ * First, we assume that each entry for the printf() of an int takes _exactly_
+ * eight bytes (four bytes for the EPID, four bytes for the payload). Second,
+ * we assume that by allocating storage for n + 1 records, we will get exactly
+ * n. Here is why: the final predicate that evaluates to false will reserve
+ * space that it won't use. This act of reservation will advance the wrapped
+ * offset. That record won't be subsequently used, but the wrapped offset has
+ * advanced. (And in this case, that old record is clobbered by the exit()
+ * anyway.) Thirdly: we rely on t_cpu/cpu_id. Finally: we rely on being
+ * able to run on the CPU that we first ran on.
+ */
+#pragma D option bufpolicy=ring
+#pragma D option bufsize=40
+#pragma D option quiet
+
+int n;
+
+BEGIN
+{
+ cpuid = -1;
+}
+
+tick-10msec
+/cpuid == -1/
+{
+ cpuid = curthread->t_cpu->cpu_id;
+}
+
+tick-10msec
+/curthread->t_cpu->cpu_id == cpuid && n < 100/
+{
+ printf("%d\n", n++);
+}
+
+tick-10msec
+/n == 100/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d.out
new file mode 100644
index 000000000000..99fd231e65be
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d.out
@@ -0,0 +1,5 @@
+96
+97
+98
+99
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.smallring.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.smallring.d
new file mode 100644
index 000000000000..2134a0b726ae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.smallring.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for ring buffer policy.
+ *
+ * SECTION: Buffers and Buffering/ring Policy;
+ * Buffers and Buffering/Buffer Sizes;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy
+ */
+
+#pragma D option bufpolicy=ring
+#pragma D option bufsize=16
+
+tick-10ms
+{
+ trace(0xbadbaddefec8d);
+}
+
+tick-10ms
+/0/
+{
+ trace((int)1);
+}
+
+tick-100ms
+/i++ > 2/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.switch1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.switch1.d
new file mode 100644
index 000000000000..2840feeffd5d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.switch1.d
@@ -0,0 +1,69 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for switch buffer policy.
+ *
+ * SECTION: Buffers and Buffering/switch Policy;
+ * Buffers and Buffering/Buffer Sizes;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/switchrate
+ */
+
+/*
+ * We assume that a printf() of an integer stores at least 8 bytes, and no more
+ * than 16 bytes.
+ */
+#pragma D option bufpolicy=switch
+#pragma D option bufsize=32
+#pragma D option switchrate=500msec
+#pragma D option quiet
+
+int n;
+int i;
+
+tick-1sec
+/n < 10/
+{
+ printf("%d\n", i);
+ i++;
+}
+
+tick-1sec
+/n < 10/
+{
+ n++;
+}
+
+tick-1sec
+/n == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.switch1.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.switch1.d.out
new file mode 100644
index 000000000000..ce6c2bcb01fc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.switch1.d.out
@@ -0,0 +1,11 @@
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.cpuusage.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.cpuusage.d
new file mode 100644
index 000000000000..e1e0dd83792d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.cpuusage.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print non assigned value and make sure it fails.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("The cpuusage = %d\n", curlwpsinfo->pr_cpu);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.nice.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.nice.d
new file mode 100644
index 000000000000..c7a4ad21884e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.nice.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * print non assigned value and make sure it fails.
+ *
+ * SECTION: Variables/Built-in Variables
+ *
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("The nice for cpu usage %c\n", curlwpsinfo->pr_nice);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.priority.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.priority.d
new file mode 100644
index 000000000000..6ebb3dfa1cd2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.priority.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Print non assigned variables and make sure it fails.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("The low value is high priority field = %d\n",
+ curlwpsinfo->pr_nice);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.prsize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.prsize.d
new file mode 100644
index 000000000000..f467f1927ad8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.prsize.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print non assigned variables and make sure it fails.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("Size of process image in kbytes = %ld\n", curpsinfo->pr_size);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.rssize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.rssize.d
new file mode 100644
index 000000000000..48057e14c9d1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.rssize.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print non assigned variables and make sure it fails.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("Size of process image in kbytes = %ld\n", curpsinfo->pr_rssize);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg0.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg0.d
new file mode 100644
index 000000000000..ec3c277f9abc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg0.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print arg0 and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("The argument is %u\n", arg0);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg0clause.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg0clause.d
new file mode 100644
index 000000000000..4c782f835580
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg0clause.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print arg0 from a profile and make sure it succeeds
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("Call probe read\n");
+}
+
+syscall:::entry
+{
+ printf("The argument is %u", arg0);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1.d
new file mode 100644
index 000000000000..993a3765ffd4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print arg1 and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("The argument is %u\n", arg1);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8.d
new file mode 100644
index 000000000000..b696d7c22ca6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print arg1 to arg8 and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("The argument is %u %u %u %u %u %u %u %u\n", arg1, arg2,
+ arg3, arg4, arg5, arg6, arg7, arg8);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8clause.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8clause.d
new file mode 100644
index 000000000000..fa62b03b122e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8clause.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print arg1 to arg8 from a profile and make sure it succeeds
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+
+syscall:::entry
+{
+ printf("The argument is %u %u %u %u %u %u %u %u\n", arg1, arg2,
+ arg3, arg4, arg5, arg6, arg7, arg8);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.caller.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.caller.d
new file mode 100644
index 000000000000..db1eabce2f02
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.caller.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print 'caller' and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("The caller is %u\n", caller);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.caller1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.caller1.d
new file mode 100644
index 000000000000..f1bfeedfec6c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.caller1.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print caller form profile and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+
+tick-10ms
+{
+ printf("The caller is %u\n", caller);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.epid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.epid.d
new file mode 100644
index 000000000000..4f04c65679fa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.epid.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print 'epid'from profile and make sure it succeeds
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+
+tick-10ms
+{
+ printf("epid of this probe = %d\n", epid);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.epid1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.epid1.d
new file mode 100644
index 000000000000..4cba65e6da96
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.epid1.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * print epid and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("epid of this probe = %d\n", epid);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.errno.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.errno.d
new file mode 100644
index 000000000000..4d7a4ffcc5f1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.errno.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print errno from profile and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+
+tick-10ms
+{
+ printf("epid of this probe = %d\n", epid);
+ printf("the errno = %d\n", errno);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.errno1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.errno1.d
new file mode 100644
index 000000000000..ed233bf04d08
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.errno1.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print errno and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("epid of this probe = %d\n", epid);
+ printf("the errno = %d\n", errno);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.execname.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.execname.d
new file mode 100644
index 000000000000..b3007de38aee
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.execname.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print execname and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+/execname == "dtrace" || execname == "java"/
+{
+ trace("execname matched");
+ exit(0);
+}
+
+BEGIN
+{
+ trace("execname didn't match");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.hpriority.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.hpriority.d
new file mode 100644
index 000000000000..a0d8836780c8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.hpriority.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print hpriority and make sure it succeeds
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("The high priority = %d\n", curlwpsinfo->pr_pri);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.id.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.id.d
new file mode 100644
index 000000000000..291d91d96e1b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.id.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print 'id' from profile.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+
+tick-10ms
+{
+ printf("id of this probe = %d\n", id);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.id1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.id1.d
new file mode 100644
index 000000000000..068cff65ede7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.id1.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print id and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("id of this probe = %d\n", id);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.ipl.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.ipl.d
new file mode 100644
index 000000000000..2e6f349d79f9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.ipl.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print variable ipl
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+
+tick-10ms
+{
+ printf("The interrupt priority level = %u\n", ipl);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.ipl1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.ipl1.d
new file mode 100644
index 000000000000..ef9278d1c6e9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.ipl1.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print ipl and make sure it succeeds
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("The interrupt priority level = %u\n", ipl);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo.d
new file mode 100644
index 000000000000..f0e9d4605bf2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print lwpsinfo_t structure values.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+
+tick-10ms
+{
+ printf("The current thread's pr_flag is %d\n", curlwpsinfo->pr_flag);
+ printf("The current threads lwpid is %d\n", curlwpsinfo->pr_lwpid);
+ printf("The current thread's internal address is %u\n",
+ curlwpsinfo->pr_addr);
+ printf("The current thread's wait addr for sleeping lwp is %u\n",
+ curlwpsinfo->pr_wchan);
+ printf("The current lwp stat is %d\n", curlwpsinfo->pr_state);
+ printf("The printable character for pr_state %c\n",
+ curlwpsinfo->pr_sname);
+ printf("The syscall number = %d\n", curlwpsinfo->pr_syscall);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo1.d
new file mode 100644
index 000000000000..aa11b07d63a7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo1.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print lwpsinfo_t variables and make sure it succeeds
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("The current thread's pr_flag is %d\n", curlwpsinfo->pr_flag);
+ printf("The current threads lwpid is %d\n", curlwpsinfo->pr_lwpid);
+ printf("The current thread's internal address is %u\n",
+ curlwpsinfo->pr_addr);
+ printf("The current thread's wait addr for sleeping lwp is %u\n",
+ curlwpsinfo->pr_wchan);
+ printf("The current lwp stat is %d\n", curlwpsinfo->pr_state);
+ printf("The printable character for pr_state %c\n",
+ curlwpsinfo->pr_sname);
+ printf("The syscall number = %d\n", curlwpsinfo->pr_syscall);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.pid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.pid.d
new file mode 100644
index 000000000000..2dd80d71cd19
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.pid.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print 'pid' from profile.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+
+tick-10ms
+{
+ printf("process id = %d \n", pid);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.pid1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.pid1.d
new file mode 100644
index 000000000000..5cee07c5fbfb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.pid1.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print 'pid' and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("process id = %d \n", pid);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.d
new file mode 100644
index 000000000000..6961a0d58055
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print psinfo structure values from profile.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+
+tick-10ms
+{
+ printf("number of lwps in process = %d\n", curpsinfo->pr_nlwp);
+ printf("unique process id = %d\n", curpsinfo->pr_pid);
+ printf("process id of parent = %d\n", curpsinfo->pr_ppid);
+ printf("pid of process group leader = %d\n", curpsinfo->pr_pgid);
+ printf("session id = %d\n", curpsinfo->pr_sid);
+ printf("real user id = %d\n", curpsinfo->pr_uid);
+ printf("effective user id = %d\n", curpsinfo->pr_euid);
+ printf("real group id = %d\n", curpsinfo->pr_gid);
+ printf("effective group id = %d\n", curpsinfo->pr_egid);
+ printf("address of process = %u\n", curpsinfo->pr_addr);
+ exit (0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.d
new file mode 100644
index 000000000000..b805e2754502
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print psinfo structure values.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("number of lwps in process = %d\n", curpsinfo->pr_nlwp);
+ printf("unique process id = %d\n", curpsinfo->pr_pid);
+ printf("process id of parent = %d\n", curpsinfo->pr_ppid);
+ printf("pid of process group leader = %d\n", curpsinfo->pr_pgid);
+ printf("session id = %d\n", curpsinfo->pr_sid);
+ printf("real user id = %d\n", curpsinfo->pr_uid);
+ printf("effective user id = %d\n", curpsinfo->pr_euid);
+ printf("real group id = %d\n", curpsinfo->pr_gid);
+ printf("effective group id = %d\n", curpsinfo->pr_egid);
+ printf("address of process = %u\n", curpsinfo->pr_addr);
+ exit (0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.tid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.tid.d
new file mode 100644
index 000000000000..1b16c8bb53da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.tid.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print tid from profile
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+
+tick-10ms
+{
+ printf("Thread id = %d \n", tid);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.tid1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.tid1.d
new file mode 100644
index 000000000000..a0567e7094dc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.tid1.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * To print tid and make sure it succeeds.
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("Thread id = %d \n", tid);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.timestamp.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.timestamp.d
new file mode 100644
index 000000000000..cd94eac842f2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.timestamp.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print build-in variable 'timestamp'
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ self->t = timestamp;
+ printf("The difftime = %d\n", timestamp - self->t);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.vtimestamp.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.vtimestamp.d
new file mode 100644
index 000000000000..cdbecfc7a134
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.vtimestamp.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To print build-in variable 'vtimestamp'
+ *
+ * SECTION: Variables/Built-in Variables
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ self->t = vtimestamp;
+ printf("The difftime = %d\n", vtimestamp - self->t);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d
new file mode 100644
index 000000000000..636e5686433d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * Compile some code that requires exactly 9 registers. This should run out
+ * of registers.
+ *
+ * Changes to the code generator might cause this test to succeeed in which
+ * case the code should be changed to another sequence that exhausts the
+ * available internal registers.
+ *
+ * Note that this and err.baddif.d should be kept in sync.
+ */
+
+BEGIN
+{
+ a = 4;
+ trace((a + a) * ((a + a) * ((a + a) * ((a + a) * ((a + a) *
+ ((a + a) * (a + a)))))));
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.baddif.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.baddif.d
new file mode 100644
index 000000000000..d84934823354
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/err.baddif.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * Compile some code that requires exactly 9 registers. This should generate
+ * invalid DIF because the kernel will flag the fact that we're using more
+ * registers than are available internally.
+ *
+ * Changes to the code generator might cause this test to succeeed in which
+ * case the code should be changed to another sequence that exhausts the
+ * available internal registers.
+ *
+ * Note that this and err.D_NOREG.noreg.d should be kept in sync.
+ */
+
+#pragma D option iregs=9
+
+BEGIN
+{
+ a = 4;
+ trace((a + a) * ((a + a) * ((a + a) * ((a + a) * ((a + a) *
+ ((a + a) * (a + a)))))));
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggfun.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggfun.d
new file mode 100644
index 000000000000..f687717431da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggfun.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test a clause where an unknown identifier appears in a predicated
+ * clause inside an aggregating function.
+ * SECTION: Program Structure / Probe Clauses and Declarations
+ *
+ */
+
+BEGIN
+/1/
+{
+ @a = max(x);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggtup.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggtup.d
new file mode 100644
index 000000000000..1fa49747f2a7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggtup.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test a clause where an unknown identifier appears in a predicated
+ * clause inside an aggregation tuple.
+ * SECTION: Program Structure / Probe Clauses and Declarations
+ *
+ */
+
+BEGIN
+/1/
+{
+ @a[x] = count();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.arrtup.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.arrtup.d
new file mode 100644
index 000000000000..6c1cdffbd37a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.arrtup.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test a clause where an unknown identifier appears in a predicated
+ * clause inside an associate array tuple.
+ * SECTION: Program Structure / Probe Clauses and Declarations
+ *
+ */
+
+BEGIN
+/1/
+{
+ a[x]++;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.body.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.body.d
new file mode 100644
index 000000000000..da499cb570cd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.body.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test a clause where an unknown identifier appears in a clause.
+ * SECTION: Program Structure / Probe Clauses and Declarations
+ *
+ */
+
+BEGIN
+{
+ exit(x);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.both.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.both.d
new file mode 100644
index 000000000000..007082730c30
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.both.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test a clause where an unknown identifier appears in a predicate
+ * and in a clause body.
+ *
+ * SECTION: Program Structure / Probe Clauses and Declarations
+ *
+ */
+
+BEGIN
+/x != 0/
+{
+ exit(x);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.pred.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.pred.d
new file mode 100644
index 000000000000..0bfc86f4cb87
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.pred.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test a clause where an unknown identifier appears in a predicate.
+ * SECTION: Program Structure / Probe Clauses and Declarations
+ *
+ */
+
+BEGIN
+/x != 0/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.nopred.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.nopred.d
new file mode 100644
index 000000000000..44d11675f5b2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.nopred.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test a clause that has a body but no predicate.
+ * SECTION: Program Structure / Probe Clauses and Declarations
+ *
+ */
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.pred.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.pred.d
new file mode 100644
index 000000000000..43bfedd8edce
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.pred.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test a clause that has a body and a predicate.
+ * SECTION: Program Structure / Probe Clauses and Declarations
+ *
+ */
+
+BEGIN
+/$pid != 0/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.predfirst.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.predfirst.d
new file mode 100644
index 000000000000..c7f0b4eb2b75
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.predfirst.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test a clause that has a body and a predicate where the
+ * predicate must be cooked first because it creates a variable.
+ *
+ * SECTION: Program Structure / Probe Clauses and Declarations
+ *
+ */
+
+BEGIN
+/x++ == 0/
+{
+ exit(x - 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.predlast.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.predlast.d
new file mode 100644
index 000000000000..9ed904f765c6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.predlast.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test a clause that has a body and a predicate where the
+ * predicate must be cooked last because the clause creates
+ * a variable which is referenced in the predicate.
+ *
+ * SECTION: Program Structure / Probe Clauses and Declarations
+ *
+ */
+
+BEGIN
+/x == 0/
+{
+ exit(x++);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d
new file mode 100644
index 000000000000..1015a251cfeb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Test to check that attempting to enable a valid event with a frequency
+ * lower than the default platform limit will fail.
+ *
+ * This test will fail if:
+ * 1) The system under test does not define the 'PAPI_tot_ins' event.
+ * 2) The 'dcpc-min-overflow' variable in dcpc.conf has been modified.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ exit(0);
+}
+
+cpc:::PAPI_tot_ins-all-100
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.malformedoverflow.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.malformedoverflow.d
new file mode 100644
index 000000000000..f9b780942fab
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.malformedoverflow.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Tests that specifying an overflow value containing extraneous characters
+ * (only digits are allowed) will fail.
+ */
+
+BEGIN
+{
+ exit(0);
+}
+
+cpc:::PAPI_tot_ins-all-10000bonehead
+{
+ @[probename] = count();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.nonexistentevent.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.nonexistentevent.d
new file mode 100644
index 000000000000..73f9575fbe6b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.nonexistentevent.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Tests that attempting to enable a probe containing a non existent event
+ * will fail.
+ */
+
+BEGIN
+{
+ exit(0);
+}
+
+cpc:::PAPI_cpc_bad-all-10000
+{
+ @[probename] = count();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart1.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart1.ksh
new file mode 100644
index 000000000000..767d493a76b7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart1.ksh
@@ -0,0 +1,78 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+
+#
+# This tests that cpustat(1) should fail to start if the cpc provider
+# is already calling the shots.
+#
+# This script will fail if:
+# 1) The system under test does not define the 'PAPI_tot_ins'
+# generic event.
+
+script()
+{
+ $dtrace -o $dtraceout -s /dev/stdin <<EOF
+ #pragma D option bufsize=128k
+
+ cpc:::PAPI_tot_ins-all-10000
+ {
+ @[probename] = count();
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+dtraceout=/tmp/dtrace.out.$$
+script 2>/dev/null &
+timeout=15
+
+#
+# Sleep while the above script fires into life. To guard against dtrace dying
+# and us sleeping forever we allow 15 secs for this to happen. This should be
+# enough for even the slowest systems.
+#
+while [ ! -f $dtraceout ]; do
+ sleep 1
+ timeout=$(($timeout-1))
+ if [ $timeout -eq 0 ]; then
+ echo "dtrace failed to start. Exiting."
+ exit 1
+ fi
+done
+
+cpustat -c PAPI_tot_ins 1 5
+status=$?
+
+rm $dtraceout
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart2.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart2.ksh
new file mode 100644
index 000000000000..584469c3fe9c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart2.ksh
@@ -0,0 +1,70 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+
+#
+# This tests that enablings from the cpc provider will fail if cpustat(1) is
+# already master of the universe.
+#
+# This script will fail if:
+# 1) The system under test does not define the 'PAPI_tot_ins'
+# generic event.
+
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ #pragma D option bufsize=128k
+
+ BEGIN
+ {
+ exit(0);
+ }
+
+ cpc:::PAPI_tot_ins-all-10000
+ {
+ @[probename] = count();
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+dtraceout=/tmp/dtrace.out.$$
+
+cpustat -c PAPI_tot_ins 1 20 &
+pid=$!
+sleep 5
+script 2>/dev/null
+
+status=$?
+
+kill $pid
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cputrackfailtostart.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cputrackfailtostart.ksh
new file mode 100644
index 000000000000..f62b83d5714b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cputrackfailtostart.ksh
@@ -0,0 +1,77 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+
+#
+# This script ensures that cputrack(1M) will fail to start when the cpc
+# provider has active enablings.
+#
+# The script will fail if:
+# 1) The system under test does not define the 'PAPI_tot_ins' event.
+#
+
+script()
+{
+ $dtrace -o $dtraceout -s /dev/stdin <<EOF
+ #pragma D option bufsize=128k
+
+ cpc:::PAPI_tot_ins-all-10000
+ {
+ @[probename] = count();
+ }
+EOF
+}
+
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+dtraceout=/tmp/dtrace.out.$$
+script 2>/dev/null &
+timeout=15
+
+#
+# Sleep while the above script fires into life. To guard against dtrace dying
+# and us sleeping forever we allow 15 secs for this to happen. This should be
+# enough for even the slowest systems.
+#
+while [ ! -f $dtraceout ]; do
+ sleep 1
+ timeout=$(($timeout-1))
+ if [ $timeout -eq 0 ]; then
+ echo "dtrace failed to start. Exiting."
+ exit 1
+ fi
+done
+
+cputrack -c PAPI_tot_ins sleep 10
+status=$?
+
+rm $dtraceout
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cputrackterminates.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cputrackterminates.ksh
new file mode 100644
index 000000000000..58d1e798f10e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.cputrackterminates.ksh
@@ -0,0 +1,70 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+
+#
+# This script ensures that cputrack(1) will terminate when the cpc provider
+# kicks into life.
+#
+# The script will fail if:
+# 1) The system under test does not define the 'PAPI_tot_ins' event.
+#
+
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ #pragma D option bufsize=128k
+
+ cpc:::PAPI_tot_ins-all-10000
+ {
+ @[probename] = count();
+ }
+
+ tick-1s
+ /n++ > 10/
+ {
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+cputrack -c PAPI_tot_ins sleep 20 &
+cputrack_pid=$!
+sleep 5
+script 2>/dev/null &
+
+wait $cputrack_pid
+status=$?
+
+rm $dtraceout
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.toomanyenablings.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.toomanyenablings.d
new file mode 100644
index 000000000000..a50bd71ae6ae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/err.toomanyenablings.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Test to check that attempting to enable too many probes will fail.
+ *
+ * This test will fail if:
+ * 1) We ever execute on a platform which is capable of programming 10
+ * 'PAPI_tot_ins' events simultaneously (which no current platforms are
+ * capable of doing).
+ * 2) The system under test does not define the 'PAPI_tot_ins' event.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ exit(0);
+}
+
+cpc:::PAPI_tot_ins-all-10000,
+cpc:::PAPI_tot_ins-all-10001,
+cpc:::PAPI_tot_ins-all-10002,
+cpc:::PAPI_tot_ins-all-10003,
+cpc:::PAPI_tot_ins-all-10004,
+cpc:::PAPI_tot_ins-all-10005,
+cpc:::PAPI_tot_ins-all-10006,
+cpc:::PAPI_tot_ins-all-10007,
+cpc:::PAPI_tot_ins-all-10008,
+cpc:::PAPI_tot_ins-all-10009
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.allcpus.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.allcpus.ksh
new file mode 100644
index 000000000000..7f026c9ebca7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.allcpus.ksh
@@ -0,0 +1,107 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This script verifies that we can fire a probe on each CPU that is in
+# an online state.
+#
+# The script will fail if:
+# 1) The system under test does not define the 'PAPI_tot_ins' event.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+numproc=`psrinfo | tail -1 | cut -f1`
+cpu=0
+dtraceout=/var/tmp/dtrace.out.$$
+scriptout=/var/tmp/script.out.$$
+
+spin()
+{
+ while [ 1 ]; do
+ :
+ done
+}
+
+script()
+{
+ $dtrace -o $dtraceout -s /dev/stdin <<EOF
+ #pragma D option bufsize=128k
+ #pragma D option quiet
+
+ cpc:::PAPI_tot_ins-user-10000
+ /cpus[cpu] != 1/
+ {
+ cpus[cpu] = 1;
+ @a[cpu] = count();
+ }
+
+ tick-1s
+ /n++ > 10/
+ {
+ printa(@a);
+ exit(0);
+ }
+EOF
+}
+
+echo "" > $scriptout
+while [ $cpu -le $numproc ]
+do
+ if [ "`psrinfo -s $cpu 2> /dev/null`" -eq 1 ]; then
+ printf "%9d %16d\n" $cpu 1 >> $scriptout
+ spin &
+ allpids[$cpu]=$!
+ pbind -b $cpu $!
+ fi
+ cpu=$(($cpu+1))
+done
+echo "" >> $scriptout
+
+script
+
+diff $dtraceout $scriptout >/dev/null 2>&1
+status=$?
+
+# kill off the spinner processes
+cpu=0
+while [ $cpu -le $numproc ]
+do
+ if [ "`psrinfo -s $cpu 2> /dev/null`" -eq 1 ]; then
+ kill ${allpids[$cpu]}
+ fi
+ cpu=$(($cpu+1))
+done
+
+rm $dtraceout
+rm $scriptout
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.genericevent.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.genericevent.d
new file mode 100644
index 000000000000..7ebf844e9cbe
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.genericevent.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Test that we can successfully enable a probe using a generic event.
+ * Currently, all platforms implement 'PAPI_tot_ins' so we'll use that.
+ * Note that this test will fail if the system under test does not
+ * implement that event.
+ *
+ * This test will fail if:
+ * 1) The system under test does not define the 'PAPI_tot_ins' event.
+ */
+
+#pragma D option quiet
+#pragma D option bufsize=128k
+
+cpc:::PAPI_tot_ins-all-10000
+{
+ @[probename] = count();
+}
+
+tick-1s
+/n++ > 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.platformevent.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.platformevent.ksh
new file mode 100644
index 000000000000..96d1ab8c6a71
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/tst.platformevent.ksh
@@ -0,0 +1,81 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This script ensures that we can enable a probe which specifies a platform
+# specific event.
+#
+
+if [ $# != 1 ]; then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+
+get_event()
+{
+ perl /dev/stdin /dev/stdout << EOF
+ open CPUSTAT, '/usr/sbin/cpustat -h |'
+ or die "Couldn't run cpustat: \$!\n";
+ while (<CPUSTAT>) {
+ if (/(\s+)event\[*[0-9]-*[0-9]*\]*:/ && !/PAPI/) {
+ @a = split(/ /, \$_);
+ \$event = \$a[\$#a-1];
+ }
+ }
+
+ close CPUSTAT;
+ print "\$event\n";
+EOF
+}
+
+script()
+{
+ $dtrace -s /dev/stdin << EOD
+ #pragma D option quiet
+ #pragma D option bufsize=128k
+
+ cpc:::$1-all-10000
+ {
+ @[probename] = count();
+ }
+
+ tick-1s
+ /n++ > 5/
+ {
+ exit(0);
+ }
+EOD
+}
+
+event=$(get_event)
+script $event
+
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_LOCASSC.NonLocalAssoc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_LOCASSC.NonLocalAssoc.d
new file mode 100644
index 000000000000..4c8ee508c682
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_LOCASSC.NonLocalAssoc.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * associative arrays may not be declared as local variables
+ *
+ * SECTION: Errtags/D_DECL_LOCASSC
+ *
+ */
+
+#pragma D option quiet
+
+this int a[int];
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_LONGINT.LongStruct.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_LONGINT.LongStruct.d
new file mode 100644
index 000000000000..2c92bfdbaac3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_LONGINT.LongStruct.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * long and long long may only be used with integer or floating-point type
+ *
+ * SECTION: Errtags/D_DECL_LONGINT
+ *
+ */
+
+#pragma D option quiet
+
+long struct mystruct
+{
+ int i;
+};
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PARMCLASS.BadStorageClass.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PARMCLASS.BadStorageClass.d
new file mode 100644
index 000000000000..8278747ed6ec
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PARMCLASS.BadStorageClass.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * inappropriate storage class for function or associative array parameter
+ * throws a D_DECL_PARMCLASS
+ *
+ * SECTION: Errtags/D_DECL_PARMCLASS
+ *
+ */
+
+#pragma D option quiet
+
+
+int foo(static int);
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_NAME.VoidName.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_NAME.VoidName.d
new file mode 100644
index 000000000000..3676c21cb713
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_NAME.VoidName.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * Assert that a void parameter in a declaration where void is permitted
+ * may not have a parameter formal name associated with it.
+ */
+
+int a(void v);
+
+BEGIN,
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_TYPE.Dyn.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_TYPE.Dyn.d
new file mode 100644
index 000000000000..aecf54999970
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_TYPE.Dyn.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * Assert that a function parameter in a declaration may not use a dynamic
+ * DTrace type such as an associative array type.
+ */
+
+int a(int a[int]);
+
+BEGIN,
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VARARGS.VarLenArgs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VARARGS.VarLenArgs.d
new file mode 100644
index 000000000000..22dbbe9b82c0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VARARGS.VarLenArgs.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * array tuples may not use variable-length argument lists
+ *
+ * SECTION: Errtags/ D_DECL_ARRVA
+ *
+ */
+
+#pragma D option quiet
+
+
+int a[...];
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VOID.NonSoleVoid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VOID.NonSoleVoid.d
new file mode 100644
index 000000000000..620f0d7cca76
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VOID.NonSoleVoid.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * void must be sole parameter in a function declaration.
+ *
+ * SECTION: Errtags/D_DECL_FUNCVOID
+ *
+ */
+
+#pragma D option quiet
+
+int foo(int, void);
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_SIGNINT.UnsignedStruct.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_SIGNINT.UnsignedStruct.d
new file mode 100644
index 000000000000..db2e4510db30
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_SIGNINT.UnsignedStruct.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * signed and unsigned may only be used with integer type
+ *
+ * SECTION: Errtags/D_DECL_SIGNINT
+ *
+ */
+
+#pragma D option quiet
+
+/*DSTYLED*/
+unsigned struct mystruct {
+ int i;
+};
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_VOIDATTR.ShortVoidDecl.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_VOIDATTR.ShortVoidDecl.d
new file mode 100644
index 000000000000..81f90814bc8f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_VOIDATTR.ShortVoidDecl.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Attributes may not be used with void type.
+ *
+ * SECTION: Errtags/D_DECL_VOIDATTR
+ *
+ */
+
+#pragma D option quiet
+
+short void ptr;
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.arrays.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.arrays.d
new file mode 100644
index 000000000000..34ddd5fcad66
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.arrays.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Test various kinds of array declarations.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+extern int a1[];
+
+extern int a2[1];
+
+extern int a3[123][456];
+
+extern int a4[123][456][789];
+
+extern int a5[5], a6[6][6], a7[7][7][7];
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.basics.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.basics.d
new file mode 100644
index 000000000000..4c1483e2381e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.basics.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Test a variety of extern declarations that exercise the different
+ * kinds of declarations that we can process.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+extern void *e1;
+extern char e2;
+extern signed char e3;
+extern unsigned char e4;
+extern short e5;
+extern signed short e6;
+extern unsigned short e7;
+extern int e8;
+extern e9;
+extern signed int e10;
+extern unsigned int e11;
+extern long e12;
+extern signed long e13;
+extern unsigned long e14;
+extern long long e15;
+extern signed long long e16;
+extern unsigned long long e17;
+extern float e18;
+extern double e19;
+extern long double e20;
+extern vnode_t e21;
+extern struct vnode e22;
+extern union sigval e23;
+extern enum uio_rw e24;
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.funcs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.funcs.d
new file mode 100644
index 000000000000..3b691eb2873c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.funcs.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Test various kinds of function declarations.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ */
+
+extern int getint(void);
+extern int *getptr(void);
+extern int *(*funcptr)(void);
+extern int **(**funcptrptr)(void);
+
+extern int noparms();
+extern int oneparm(int);
+extern int twoparms(int, int);
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.pointers.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.pointers.d
new file mode 100644
index 000000000000..d0ab6087a00f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.pointers.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Test multiple extern declarations in a single list which build
+ * up a chain of pointers to pointers to pointers ...
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ */
+
+extern int e0, *e1, **e2, ***e3, ****e4, *****e5;
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.varargsfuncs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.varargsfuncs.d
new file mode 100644
index 000000000000..c12363fb9595
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.varargsfuncs.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Test functions declarations with varargs
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ */
+
+#pragma D option quiet
+
+extern int varargs1(...);
+extern int varargs2(int, ...);
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/badptr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/badptr.d
new file mode 100644
index 000000000000..c48c7294b102
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/badptr.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example 5-1
+ *
+ * SECTION:
+ * DocExamples/badptr
+ */
+
+BEGIN
+{
+ x = (int *)NULL;
+ y = *x;
+ trace(y);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/countdown.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/countdown.d
new file mode 100644
index 000000000000..56b988154f6c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/countdown.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example
+ *
+ * SECTION:
+ * DocExamples/other
+ */
+
+dtrace:::BEGIN
+{
+ i = 10;
+}
+
+profile:::tick-1sec
+/i > 0/
+{
+ trace(i--);
+}
+
+profile:::tick-1000
+/i == 0/
+{
+ trace("blastoff!");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/counter.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/counter.d
new file mode 100644
index 000000000000..8b7b1b3b19b0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/counter.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc
+ *
+ * SECTION:
+ * DocExamples/other
+ */
+
+
+dtrace:::BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+{
+ i = i + 1;
+ trace(i);
+}
+
+dtrace:::END
+{
+ trace(i);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/errorpath.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/errorpath.d
new file mode 100644
index 000000000000..76fd07c2068b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/errorpath.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example 17-1
+ *
+ * SECTION:
+ * DocExamples/errorpath
+ */
+
+
+BEGIN
+{
+ *(char *)NULL;
+}
+
+ERROR
+{
+ printf("Hit an error!");
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/hello.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/hello.d
new file mode 100644
index 000000000000..8e1ef8f79f30
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/hello.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example 1-1
+ *
+ * SECTION:
+ * DocExamples/hello
+ */
+
+
+BEGIN
+{
+ trace("hello, world");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/kstat.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/kstat.d
new file mode 100644
index 000000000000..49871497baea
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/kstat.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example 7-3
+ *
+ * SECTION:
+ * DocExamples/kstat
+ */
+
+
+#pragma D option quiet
+
+pid$1:libkstat:kstat_data_lookup:entry
+{
+ self->ksname = arg1;
+}
+
+pid$1:libkstat:kstat_data_lookup:return
+/self->ksname != NULL && arg1 != NULL/
+{
+ this->str = copyinstr(self->ksname);
+ this->ksp = (kstat_named_t *)copyin(arg1, sizeof (kstat_named_t));
+ printf("%s has ui64 value %u\n", this->str, this->ksp->value.ui64);
+}
+
+pid$1:libkstat:kstat_data_lookup:return
+/self->ksname != NULL && arg1 == NULL/
+{
+ self->ksname = NULL;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/ksyms.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/ksyms.d
new file mode 100644
index 000000000000..932262b0b913
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/ksyms.d
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example 7-2
+ *
+ * SECTION:
+ * DocExamples/ksyms
+ */
+
+
+/* Must run "strings -a /dev/ksyms in another shell on the system */
+
+
+#pragma D option quiet
+
+syscall::read:entry
+/curpsinfo->pr_psargs == "strings -a /dev/ksyms"/
+{
+ printf("read %u bytes to user address %x\n", arg2, arg1);
+ self->watched = 1;
+}
+
+syscall::read:return
+/self->watched/
+{
+ self->watched = 0;
+}
+
+fbt::uiomove:entry
+/self->watched/
+{
+ this->iov = args[3]->uio_iov;
+
+ printf("uiomove %u bytes to %p in pid %d\n", this->iov->iov_len,
+ this->iov->iov_base, pid);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/renormalize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/renormalize.d
new file mode 100644
index 000000000000..7d2c6af76f46
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/renormalize.d
@@ -0,0 +1,55 @@
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Verify doc example 9-1
+ *
+ * SECTION:
+ * DocExamples/renormalize
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ start = timestamp;
+}
+
+syscall:::entry
+{
+ @func[execname] = count();
+}
+
+tick-10sec
+{
+ normalize(@func, (timestamp - start) / 1000000000);
+ printa(@func);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rtime.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rtime.d
new file mode 100644
index 000000000000..087e819314f0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rtime.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example 3-1
+ *
+ * SECTION:
+ * DocExamples/rtime
+ */
+
+
+#pragma D option quiet
+
+syscall::read:entry
+{
+ self->t = timestamp;
+}
+
+syscall::read:return
+/self->t != 0/
+{
+ printf("%d/%d spent %d nsecs in read(2)\n", pid,
+ tid, timestamp - self->t);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rw.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rw.d
new file mode 100644
index 000000000000..6358a7dc0078
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rw.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example
+ *
+ * SECTION:
+ * DocExamples/other
+ */
+
+
+syscall::read:entry,
+syscall::write:entry
+/pid == 102429/
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rwinfo.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rwinfo.d
new file mode 100644
index 000000000000..60f2b12a971e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rwinfo.d
@@ -0,0 +1,74 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example 7-1
+ *
+ * SECTION:
+ * DocExamples/rwinfo
+ */
+
+
+#pragma D option quiet
+
+struct callinfo {
+ uint64_t ts;
+ uint64_t elapsed;
+ uint64_t calls;
+ size_t maxbytes;
+};
+
+struct callinfo i[string];
+
+syscall::read:entry,
+syscall::write:entry
+/pid == 100551/
+{
+ i[probefunc].ts = timestamp;
+ i[probefunc].calls++;
+ i[probefunc].maxbytes = arg2 > i[probefunc].maxbytes ?
+ arg2 : i[probefunc].maxbytes;
+}
+
+syscall::read:return,
+syscall::write:return
+/i[probefunc].ts != 0 && pid == 100551/
+{
+ i[probefunc].elapsed += timestamp - i[probefunc].ts;
+}
+
+END
+{
+ printf(" calls max bytes elapsed nsecs\n");
+ printf("----- ----- --------- -------------\n");
+ printf(" read %5d %9d %d\n", i["read"].calls,
+ i["read"].maxbytes, i["read"].elapsed);
+ printf(" write %5d %9d %d\n", i["write"].calls,
+ i["write"].maxbytes, i["write"].elapsed);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rwtime.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rwtime.d
new file mode 100644
index 000000000000..2edffb907398
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rwtime.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example 7-1
+ *
+ * SECTION:
+ * DocExamples/rwinfo
+ */
+
+
+syscall::read:entry,
+syscall::write:entry
+/pid == 100551/
+{
+ ts[probefunc] = timestamp;
+}
+
+syscall::read:return,
+syscall::write:return
+/(ts[probefunc] != 0) && (pid == 100551)/
+{
+ printf("%d nsecs\n", timestamp - ts[probefunc]);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/specopen.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/specopen.d
new file mode 100644
index 000000000000..dff3e6227b1b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/specopen.d
@@ -0,0 +1,79 @@
+#!/usr/sbin/dtrace -Fs
+
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example 13-1
+ *
+ * SECTION:
+ * DocExamples/specopen
+ */
+
+syscall::open:entry,
+syscall::open64:entry
+{
+ self->spec = speculation();
+ speculate(self->spec);
+
+ printf("%s", stringof(copyinstr(arg0)));
+}
+
+fbt:::
+/self->spec/
+{
+ speculate(self->spec);
+}
+
+syscall::open:return,
+syscall::open64:return
+/self->spec/
+{
+ speculate(self->spec);
+ trace(errno);
+}
+
+syscall::open:return,
+syscall::open64:return
+/self->spec && errno != 0/
+{
+ commit(self->spec);
+ self->spec = 0;
+}
+
+syscall::open:return,
+syscall::open64:return
+/self->spec && errno == 0/
+{
+ discard(self->spec);
+ self->spec = 0;
+}
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/truss.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/truss.d
new file mode 100644
index 000000000000..b79252051ac7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/truss.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc
+ *
+ * SECTION:
+ * DocExamples/truss
+ */
+
+
+
+dtrace:::BEGIN
+{
+ var = 30;
+ self->vaa = 24;
+}
+
+syscall::read:entry
+/pid == 102473/
+{
+ printf("var: %d, self->vaa: %d", var++, self->vaa++);
+}
+
+syscall::write:entry
+/pid == 102473/
+{
+ printf("var: %d, self->vaa: %d", var++, self->vaa++);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/trussrw.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/trussrw.d
new file mode 100644
index 000000000000..9eb9bceda935
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/trussrw.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify doc example 1-2
+ *
+ * SECTION:
+ * DocExamples/trussrw
+ */
+
+
+#pragma D option quiet
+
+syscall::read:entry,
+syscall::write:entry
+/pid == 100551/
+{
+ printf("%s(%d, 0x%x, %4d)", probefunc, arg0, arg1, arg2);
+}
+
+syscall::read:return,
+syscall::write:return
+/pid == 100551/
+{
+ printf("\t\t = %d\n", arg1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/userfunc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/userfunc.d
new file mode 100644
index 000000000000..0d83465d0ae0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/userfunc.d
@@ -0,0 +1,61 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verifying doc example 21-1
+ *
+ * SECTION:
+ * DocExamples/userfunc
+ *
+ */
+
+pid$1::$2:entry
+{
+ self->trace = 1;
+}
+
+pid$1::$2:return
+/self->trace/
+{
+ self->trace = 0;
+}
+
+pid$1:::entry,
+pid$1:::return
+/self->trace/
+{
+}
+
+
+
+
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_AGGREGATION.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_AGGREGATION.d
new file mode 100644
index 000000000000..02b32438a560
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_AGGREGATION.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+#pragma D option strsize=1024
+#pragma D option aggsize=512
+
+BEGIN
+{
+ @["Harding"] = count();
+ @["Hoover"] = count();
+ @["Nixon"] = count();
+ @["Bush"] = count();
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DBLERROR.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DBLERROR.d
new file mode 100644
index 000000000000..face4c8c0948
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DBLERROR.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ trace(*(int *)NULL);
+}
+
+ERROR
+{
+ trace(*(int *)NULL);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DYNAMIC.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DYNAMIC.d
new file mode 100644
index 000000000000..f8a90f068f6b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DYNAMIC.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option strsize=1024
+#pragma D option dynvarsize=512
+
+BEGIN
+{
+ a["Harding"] = 1;
+ a["Hoover"] = 1;
+ a["Nixon"] = 1;
+ a["Bush"] = 1;
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.d
new file mode 100644
index 000000000000..8389ce02d2cb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option strsize=1024
+#pragma D option bufsize=512
+
+BEGIN
+{
+ trace("Harding");
+ trace("Hoover");
+ trace("Nixon");
+ trace("Bush");
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.end.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.end.d
new file mode 100644
index 000000000000..a723019f96a5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.end.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option strsize=1024
+#pragma D option bufsize=512
+
+BEGIN
+{
+ exit(0);
+}
+
+END
+{
+ trace("Harding");
+ trace("Hoover");
+ trace("Nixon");
+ trace("Bush");
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPEC.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPEC.d
new file mode 100644
index 000000000000..8f6df3c0a520
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPEC.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option nspec=1
+#pragma D option specsize=32
+#pragma D option strsize=512
+
+BEGIN
+{
+ spec = speculation();
+ speculate(spec);
+ trace("The, SystemTap, The.");
+}
+
+BEGIN
+{
+ commit(spec);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPECUNAVAIL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPECUNAVAIL.d
new file mode 100644
index 000000000000..1fd39748d3d7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPECUNAVAIL.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option nspec=1
+
+BEGIN,
+BEGIN,
+BEGIN,
+BEGIN
+{
+ spec = speculation();
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d
new file mode 100644
index 000000000000..f5d6416bce8f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option destructive
+#pragma D option jstackstrsize=1
+#pragma D option quiet
+
+BEGIN
+{
+ system("java -version");
+}
+
+syscall:::entry
+{
+ @[jstack()] = count();
+}
+
+proc:::exit
+/progenyof($pid) && execname == "java"/
+{
+ exit(0);
+}
+
+END
+{
+ printa("\r", @);
+ printf("\n");
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/err.D_PDESC_ZERO.InvalidDescription1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/err.D_PDESC_ZERO.InvalidDescription1.d
new file mode 100644
index 000000000000..a0d17676140f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/err.D_PDESC_ZERO.InvalidDescription1.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: An invalid probe description throws a D_PDESC_ZERO error.
+ *
+ * SECTION: Errtags/D_PDESC_ZERO
+ *
+ */
+
+#pragma D option quiet
+
+fbt:bippity:boppity:boo
+{
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.APIVersion.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.APIVersion.d
new file mode 100644
index 000000000000..21564897f120
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.APIVersion.d
@@ -0,0 +1,37 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/* Assertion:
+ * Use the -V option to printout API version.
+ *
+ * SECTION:
+ * dtrace Utility/-V Option
+ *
+ * NOTES:
+ * Use /usr/sbin/dtrace -V on command line.
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.AddSearchPath.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.AddSearchPath.d
new file mode 100644
index 000000000000..53fe67af7b70
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.AddSearchPath.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * The -I option can be used to search path for #include files when used
+ * in conjunction with the -C option. The specified directory is inserted into
+ * the search path adhead of the default directory list.
+ *
+ * SECTION: dtrace Utility/-C Option;
+ * dtrace Utility/-I Option
+ *
+ * NOTES:
+ * Create a file <filename> and define the variable VALUE in it. Move it a
+ * directory <dirname> different from the current directory. Change the value
+ * of <filename> appropriately in the code below.
+ * Invoke: dtrace -C -I <dirname> -s man.AddSearchPath.d
+ * Verify VALUE.
+ */
+
+
+#pragma D option quiet
+
+#include "filename"
+
+BEGIN
+{
+ printf("Value of VALUE: %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d
new file mode 100644
index 000000000000..3cd9d02a1e18
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d
@@ -0,0 +1,67 @@
+#!/bin/ksh -p
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ *
+ * ASSERTION:
+ * Testing -F option with several probes.
+ *
+ * SECTION: dtrace Utility/-F Option
+ *
+ * NOTES: Manually verify using:
+ * "/usr/sbin/dtrace -F -s man.CoalesceTrace.d" on command line.
+ *
+ * Verify that the for the indent characters are -> <- for non-syscall
+ * entry/return pairs (e.g. fbt ones) and => <= for syscall ones and
+ * | for profile ones.
+ *
+ */
+
+BEGIN
+{
+ i = 0;
+ j = 0;
+ k = 0;
+}
+
+syscall::read:
+{
+ printf("syscall: %d\n", i++);
+}
+
+fbt:genunix:read:
+{
+ printf("fbt: %d\n", j++);
+}
+
+profile:::tick-10sec
+{
+ printf("profile: %d\n", k++);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ELFGeneration.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ELFGeneration.d
new file mode 100644
index 000000000000..a30a140e501a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ELFGeneration.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -G option with dtrace utility produces an ELF file containing a
+ * DTrace program. If the filename used with the -s option does ends
+ * with .d, and the -o option is not used, then the output ELF file is
+ * in filename.o
+ *
+ * SECTION: dtrace Utility/-G Option
+ *
+ * NOTES: Use this file as
+ * /usr/sbin/dtrace -G -s man.ELFGeneration.d
+ * Delete the file man.ELFGeneration.d.o
+ *
+ */
+
+BEGIN
+{
+ printf("This test should compile.\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.IncludedFilePath.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.IncludedFilePath.d
new file mode 100644
index 000000000000..f4e4e4e1c51f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.IncludedFilePath.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using the -CH option with dtrace invocation displays the list of
+ * pathnames of included files one per line to the stderr.
+ *
+ * SECTION: dtrace Utility/-C Option;
+ * dtrace Utility/-H Option
+ *
+ * NOTES: Use this file as
+ * /usr/sbin/dtrace -qCH -s man.IncludedFilePath.d
+ *
+ */
+
+#include "stdio.h"
+
+BEGIN
+{
+ printf("This test should compile.\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithFunctions b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithFunctions
new file mode 100644
index 000000000000..e3db1270abbd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithFunctions
@@ -0,0 +1,99 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -l option with -f option.
+ *
+ * SECTION: dtrace Utility/-l Option;
+ * dtrace Utility/-f Option
+ *
+ * NOTES: Manually check:
+ *
+ * 1)
+ * /usr/sbin/dtrace -lf profile
+ * RESULT: Silent output without any probes listed.
+ *
+ * 2)
+ * /usr/sbin/dtrace -lf genunix
+ * RESULT: Silent output without any probes listed.
+ *
+ * 3)
+ * /usr/sbin/dtrace -lf read
+ * RESULT: matching list of probes with function read.
+ *
+ * 4)
+ * /usr/sbin/dtrace -lf genunix:read
+ * RESULT: matching list of probes with module genunix and
+ * function read.
+ *
+ * 5)
+ * /usr/sbin/dtrace -lf sysinfo:genunix:read
+ * RESULT: matching list of probes with provider sysinfo, module
+ * genunix and function read.
+ *
+ * 6)
+ * /usr/sbin/dtrace -lf :genunix::
+ * RESULT: Silent output without any probes listed.
+ *
+ * 7)
+ * /usr/sbin/dtrace -lf ::read:
+ * RESULT: Silent output without any probes listed.
+ *
+ * 8)
+ * /usr/sbin/dtrace -lf profile:::profile-97
+ * RESULT: not a valid probe description.
+ *
+ * 9)
+ * /usr/sbin/dtrace -lf read -lf write
+ * RESULT: matching list of both read and write probes.
+ *
+ * 10)
+ * /usr/sbin/dtrace -lf read -lm fight
+ * RESULT: List of only read probes.
+ *
+ * 11)
+ * /usr/sbin/dtrace -lf fight -lf write
+ * RESULT: List of only write probes.
+ *
+ * 12) Has been automated.
+ * /usr/sbin/dtrace -lf fbt:des:des3_crunch_block:return
+ * RESULT: not a valid probe description.
+ *
+ * 13)
+ * /usr/sbin/dtrace -lf read'{printf("FOUND");}'
+ * RESULT: Silent output without any probes listed.
+ *
+ * 14)
+ * /usr/sbin/dtrace -lf read '{printf("FOUND");}'
+ * RESULT: List of only read probes.
+ *
+ * 15)
+ * /usr/sbin/dtrace -lf read'/probename == "entry"/{printf("FOUND");}'
+ * RESULT: Silent output without any probes listed.
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithIDs b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithIDs
new file mode 100644
index 000000000000..2b46ce34091b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithIDs
@@ -0,0 +1,77 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -l option with -i option.
+ *
+ * SECTION: dtrace Utility/-l Option;
+ * dtrace Utility/-i Option
+ *
+ * NOTES: Manually check:
+ *
+ * 1)
+ * /usr/sbin/dtrace -l
+ * RESULT: List of all available probes.
+ *
+ * 2)
+ * /usr/sbin/dtrace -li 0
+ * RESULT: invalid probe identifier 0.
+ *
+ * 3) automated in tst.InvalidId1.d.ksh
+ * /usr/sbin/dtrace -li -3
+ * RESULT: not a valid id range
+ *
+ * 4)
+ * /usr/sbin/dtrace -li 0-2
+ * RESULT: List of probes including 1 and 2 or error.
+ *
+ * 5) automated in tst.InvalidId2.d.ksh
+ * /usr/sbin/dtrace -li 4-2
+ * RESULT: not a valid id range
+ *
+ * 6) automated in tst.InvalidId3.d.ksh
+ * /usr/sbin/dtrace -li 2-2
+ * RESULT: not a valid id range
+ *
+ * 7)
+ * /usr/sbin/dtrace -li 1 2 3 4
+ * RESULT: only the first probe id is listed and other extraneous
+ * charaters are not considered.
+ *
+ * 8)
+ * /usr/sbin/dtrace -li 0 - 2
+ * RESULT: only the first probe id is listed and other extraneous
+ * charaters are not considered.
+ *
+ * 9)
+ * /usr/sbin/dtrace -li 1 -li 2-4 -li 4 -li 5
+ * RESULT: Probe descriptions listed for all ids specified. Once
+ * for each specification on the command line.
+ *
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithModules b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithModules
new file mode 100644
index 000000000000..167c72a02160
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithModules
@@ -0,0 +1,91 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -l option with -m option.
+ *
+ * SECTION: dtrace Utility/-l Option;
+ * dtrace Utility/-m Option
+ *
+ * NOTES: Manually check:
+ *
+ * 1)
+ * /usr/sbin/dtrace -lm profile
+ * RESULT: Silent output without any probes listed.
+ *
+ * 2)
+ * /usr/sbin/dtrace -lm genunix
+ * RESULT: matching list of probes with module name genunix.
+ *
+ * 3)
+ * /usr/sbin/dtrace -lm vtrace:genunix
+ * RESULT: matching list of probes with provider vtrace and module
+ * genunix.
+ *
+ * 4) automated in tst.InvalidModule1.d.ksh
+ * /usr/sbin/dtrace -lm :genunix::
+ * RESULT: not a valid probe description
+ *
+ * 5) automated in tst.InvalidModule2.d.ksh
+ * /usr/sbin/dtrace -lm profile:::profile-97
+ * RESULT: not a valid probe description.
+ *
+ * 6)
+ * /usr/sbin/dtrace -lm genunix -lm unix
+ * RESULT: matching list of both genunix and unix probes.
+ *
+ * 7)
+ * /usr/sbin/dtrace -lm genunix -lm foounix
+ * RESULT: List of only genunix probes.
+ *
+ * 8)
+ * /usr/sbin/dtrace -lm foounix -lm unix
+ * RESULT: List of only unix probes.
+ *
+ * 9) automated in tst.InvalidModule3.d.ksh
+ * /usr/sbin/dtrace -lm fbt:des:des3_crunch_block:return
+ * RESULT: not a valid probe description.
+ *
+ * 10)
+ * /usr/sbin/dtrace -lm fbt:genunix'{printf("FOUND");}'
+ * RESULT: Silent output without any probes listed.
+ *
+ * 11)
+ * /usr/sbin/dtrace -lm genunix'{printf("FOUND");}'
+ * RESULT: Silent output without any probes listed.
+ *
+ * 12)
+ * /usr/sbin/dtrace -lm unix '{printf("FOUND");}'
+ * RESULT: List of only unix probes.
+ *
+ * 13) automated in tst.InvalidModule4.d.ksh
+ * /usr/sbin/dtrace -lm
+ * unix'/probefunc == "preempt"/{printf("FOUND");}'
+ * RESULT: not a valid probe description.
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithNames b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithNames
new file mode 100644
index 000000000000..aabf1b2dfff6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithNames
@@ -0,0 +1,128 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -l option with -n option.
+ *
+ * SECTION: dtrace Utility/-l Option;
+ * dtrace Utility/-n Option
+ *
+ * NOTES: Manually check:
+ *
+ * 1)
+ * /usr/sbin/dtrace -ln profile
+ * RESULT: Silent output without any probes listed.
+ *
+ * 2)
+ * /usr/sbin/dtrace -ln genunix
+ * RESULT: Silent output without any probes listed.
+ *
+ * 3)
+ * /usr/sbin/dtrace -ln read
+ * RESULT: Silent output without any probes listed.
+ *
+ * 4)
+ * /usr/sbin/dtrace -ln BEGIN
+ * RESULT: list of one probe with name BEGIN.
+ *
+ * 5)
+ * /usr/sbin/dtrace -ln begin
+ * RESULT: Silent output without any probes listed.
+ *
+ * 6)
+ * /usr/sbin/dtrace -ln genunix:read
+ * RESULT: Silent output without any probes listed.
+ *
+ * 7)
+ * /usr/sbin/dtrace -ln genunix:read:
+ * RESULT: matching list of probes with module genunix and
+ * function read.
+ *
+ * 8)
+ * /usr/sbin/dtrace -ln sysinfo:genunix:read
+ * RESULT: Silent output without any probes listed.
+ *
+ * 9)
+ * /usr/sbin/dtrace -ln sysinfo:genunix:read:
+ * RESULT: matching list of probes with provider sysinfo, module
+ * genunix and function read.
+ *
+ * 10) /usr/sbin/dtrace -ln :genunix::
+ * RESULT: matching list of probes with module genunix
+ *
+ * 11)
+ * /usr/sbin/dtrace -ln :genunix:
+ * RESULT: Silent output without any probes listed.
+ *
+ * 12)
+ * /usr/sbin/dtrace -ln ::read:
+ * RESULT: matching list of probes with and function read.
+ *
+ * 13)
+ * /usr/sbin/dtrace -ln profile:::profile-97
+ * RESULT: matching list of probes with provider profile and function
+ * profile-97
+ *
+ * 14)
+ * /usr/sbin/dtrace -ln read: -ln write:
+ * RESULT: matching list of both read and write probes.
+ *
+ * 15)
+ * /usr/sbin/dtrace -ln read: -ln fight:
+ * RESULT: List of only read probes.
+ *
+ * 16)
+ * /usr/sbin/dtrace -ln fight: -ln write:
+ * RESULT: List of only write probes.
+ *
+ * 17)
+ * /usr/sbin/dtrace -ln fbt:des:des3_crunch_block:return
+ * RESULT: Silent output of only the header.
+ *
+ * 18)
+ * /usr/sbin/dtrace -ln read:'{printf("FOUND");}'
+ * RESULT: Silent output without any probes listed.
+ *
+ * 19)
+ * /usr/sbin/dtrace -ln read:entry'{printf("FOUND");}'
+ * RESULT: Silent output without any probes listed.
+ *
+ * 20)
+ * /usr/sbin/dtrace -ln BEGIN'{Printf("FOUND");}'
+ * RESULT: Silent output without any probes listed.
+ *
+ * 21)
+ * /usr/sbin/dtrace -ln BEGIN '{printf("FOUND");}'
+ * RESULT: List of only BEGIN probe.
+ *
+ * 22)
+ * /usr/sbin/dtrace -ln
+ * BEGIN'/probename == "entry"/{printf("FOUND");}'
+ * RESULT: Silent output without any probes listed.
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithProviders b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithProviders
new file mode 100644
index 000000000000..961d409640d7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithProviders
@@ -0,0 +1,82 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -l option with -P option.
+ *
+ * SECTION: dtrace Utility/-l Option;
+ * dtrace Utility/-P Option
+ *
+ * NOTES: Manually check:
+ *
+ * 1)
+ * /usr/sbin/dtrace -lP profile
+ * RESULT: List of only profile probes.
+ *
+ * 2)
+ * /usr/sbin/dtrace -lP foofile
+ * RESULT: Silent output without any probes listed.
+ *
+ * 3) automated in tst.InvalidProvider2.d.ksh
+ * /usr/sbin/dtrace -lP profile:::
+ * RESULT: not a valid probe description
+ *
+ * 4) automated in tst.InvalidProvider1.d.ksh
+ * /usr/sbin/dtrace -lP profile:::profile-97
+ * RESULT: not a valid probe description.
+ *
+ * 5)
+ * /usr/sbin/dtrace -lP profile -lP syscall
+ * RESULT: matching list of both profile and syscall probes.
+ *
+ * 6)
+ * /usr/sbin/dtrace -lP profile -lP foofile
+ * RESULT: List of only profile probes.
+ *
+ * 7)
+ * /usr/sbin/dtrace -lP foofile -lP profile
+ * RESULT: List of only profile probes.
+ *
+ * 8) authomated in tst.InvalidProvider3.d.ksh
+ * /usr/sbin/dtrace -lP fbt:des:des3_crunch_block:return
+ * RESULT: not a valid probe description.
+ *
+ * 9)
+ * /usr/sbin/dtrace -lP profile'{printf("FOUND");}'
+ * RESULT: Silent output without any probes listed.
+ *
+ * 10)
+ * /usr/sbin/dtrace -lP profile '{printf("FOUND");}'
+ * RESULT: List of only profile probes.
+ *
+ * 11) automated in tst.InvalidProvider4.d.ksh
+ * /usr/sbin/dtrace -lP
+ * profile'/probename == "profile-199"/{printf("FOUND");}'
+ * RESULT: not a valid probe description.
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ShowCompilerCode.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ShowCompilerCode.d
new file mode 100644
index 000000000000..556811d2db7c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ShowCompilerCode.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -S option with dtrace utility shows the intermediate compiler code.
+ *
+ * SECTION: dtrace Utility/-S Option
+ *
+ * NOTES: Use this file as
+ * /usr/sbin/dtrace -qSs man.ShowCompilerCode.d
+ *
+ */
+
+BEGIN
+{
+ printf("This test should compile %d\n", 1);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceFunctions b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceFunctions
new file mode 100644
index 000000000000..4c9c1c5696a3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceFunctions
@@ -0,0 +1,115 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -f option.
+ *
+ * SECTION: dtrace Utility/-f Option
+ *
+ * NOTES: Manually check:
+ *
+ * 1) automated in tst.InvalidTraceFunc1.d.ksh
+ * /usr/sbin/dtrace -f profile
+ * RESULT: invalid probe specifier
+ *
+ * 2) automated in tst.InvalidTraceFunc2.d.ksh
+ * /usr/sbin/dtrace -f genunix
+ * RESULT: invalid probe specifier
+ *
+ * 3)
+ * /usr/sbin/dtrace -f read
+ * RESULT: tracing of matching list of probes with function read.
+ *
+ * 4) automated in tst.InvalidTraceFunc3.d.ksh
+ * /usr/sbin/dtrace -f read:
+ * RESULT: invalid probe specifier
+ *
+ * 5)
+ * /usr/sbin/dtrace -f ::read
+ * RESULT: tracing of matching list of probes with function read.
+ *
+ * 6) automated in tst.InvalidTraceFunc4.d.ksh
+ * /usr/sbin/dtrace -f ::read:
+ * RESULT: invalid probe specifier
+ *
+ * 7)
+ * /usr/sbin/dtrace -f genunix:read
+ * RESULT: tracing of probes with module genunix and function read.
+ *
+ * 8)
+ * /usr/sbin/dtrace -f sysinfo:genunix:read
+ * RESULT: tracing of probes with provider sysinfo, module genunix
+ * and function read.
+ *
+ * 9)
+ * /usr/sbin/dtrace -f sysinfo::read
+ * RESULT: tracing of probes with provider sysinfo and function read.
+ *
+ * 10) automated in tst.InvalidTraceFunc5.d.ksh
+ * /usr/sbin/dtrace -f :genunix::
+ * RESULT: invalid probe specifier
+ *
+ * 11) automated in tst.InvalidTraceFunc6.d.ksh
+ * /usr/sbin/dtrace -f profile:::profile-97
+ * RESULT: invalid probe specifier.
+ *
+ * 12)
+ * /usr/sbin/dtrace -f read -f write
+ * RESULT: tracing of both read and write probes.
+ *
+ * 13)
+ * /usr/sbin/dtrace -f read -f fight
+ * RESULT: Count of matching read probes and invalid probe specifier
+ * for fight
+ *
+ * 14) automated in tst.InvalidTraceFunc8.d.ksh
+ * /usr/sbin/dtrace -f fight -f write
+ * RESULT: invalid probe specifier.
+ *
+ * 15) automated in tst.InvalidTraceFunc7.d.ksh
+ * /usr/sbin/dtrace -f fbt:des:des3_crunch_block:return
+ * RESULT: invalid probe specifier.
+ *
+ * 16)
+ * /usr/sbin/dtrace -f read'{printf("FOUND");}'
+ * RESULT: tracing of probes with function read and with message FOUND
+ *
+ * 17)
+ * /usr/sbin/dtrace -f ::read'{printf("FOUND");}'
+ * RESULT: tracing of probes with function read and with message FOUND
+ *
+ * 18) automated in tst.InvalidTraceFunc9.d.ksh
+ * /usr/sbin/dtrace -f read '{printf("FOUND");}'
+ * RESULT: invalid probe specifier.
+ *
+ * 19)
+ * /usr/sbin/dtrace -f read'/probename == "entry"/{printf("FOUND");}'
+ * RESULT: tracing of probes with function read, name entry and with
+ * message FOUND
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceIDs b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceIDs
new file mode 100644
index 000000000000..d9615b5aadb8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceIDs
@@ -0,0 +1,70 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -l option with -i option.
+ *
+ * SECTION: dtrace Utility/-l Option;
+ * dtrace Utility/-i Option
+ *
+ * NOTES: Manually check:
+ *
+ * 1) automated in tst.InvalidTraceID1.d.ksh
+ * /usr/sbin/dtrace -i 0
+ * RESULT: invalid probe specifier.
+ *
+ * 2) automated in tst.InvalidTraceID2.d.ksh
+ * /usr/sbin/dtrace -i -3
+ * RESULT: not a valid id range
+ *
+ * 3) automated in tst.InvalidTraceID3.d.ksh
+ * /usr/sbin/dtrace -i 0-2
+ * RESULT: not a valid id range
+ *
+ * 4) automated in tst.InvalidTraceID4.d.ksh
+ * /usr/sbin/dtrace -i 4-2
+ * RESULT: not a valid id range
+ *
+ * 5) automated in tst.InvalidTraceID5.d.ksh
+ * /usr/sbin/dtrace -i 2-2
+ * RESULT: not a valid id range
+ *
+ * 6) automated in tst.InvalidTraceID6.d.ksh
+ * /usr/sbin/dtrace -i 1 2 3 4
+ * RESULT: invalid probe specifier.
+ *
+ * 7) automated in tst.InvalidTraceID7.d.ksh
+ * /usr/sbin/dtrace -i 0 - 2
+ * RESULT: invalid probe specifier.
+ *
+ * 8)
+ * /usr/sbin/dtrace -i 1 -i 2-4 -i 4 -i 5
+ * RESULT: Only the BEGIN probe is traced and the others are not.
+ *
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceModule b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceModule
new file mode 100644
index 000000000000..9c4401ead040
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceModule
@@ -0,0 +1,114 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Tracing a module using the -m option.
+ *
+ * SECTION: dtrace Utility/-m Option
+ *
+ * NOTES: Manually check:
+ *
+ * 1) automated in tst.InvalidTraceModule1.d.ksh
+ * /usr/sbin/dtrace -m profile
+ * RESULT: invalid probe specifier
+ *
+ * 2)
+ * /usr/sbin/dtrace -m genunix
+ * RESULT: trace of all probes with module genunix.
+ *
+ * 3)
+ * /usr/sbin/dtrace -m vtrace:genunix
+ * RESULT: trace of probes with provider vtrace and module genunix.
+ *
+ * 4) automated in tst.InvalidTraceModule2.d.ksh
+ * /usr/sbin/dtrace -m :genunix::
+ * RESULT: invalid probe specifier
+ *
+ * 5)
+ * /usr/sbin/dtrace -m :genunix
+ * RESULT: trace of all probes with module genunix.
+ *
+ * 6) automated in tst.InvalidTraceModule3.d.ksh
+ * /usr/sbin/dtrace -m genunix::
+ * RESULT: invalid probe specifier
+ *
+ * 7) automated in tst.InvalidTraceModule4.d.ksh
+ * /usr/sbin/dtrace -m profile:::profile-97
+ * RESULT: not a valid probe description.
+ *
+ * 8)
+ * /usr/sbin/dtrace -m genunix -m unix
+ * RESULT: tracing of both genunix and unix probes.
+ *
+ * 9)
+ * /usr/sbin/dtrace -m genunix -m foounix
+ * RESULT: Number of probes matching the description genunix
+ * and an invalid probe specifier for foounix.
+ *
+ * 10) automated in tst.InvalidTraceModule5.d.ksh
+ * /usr/sbin/dtrace -m foounix -m unix
+ * RESULT: invalid probe specifier for foounix.
+ *
+ * 11) automated in tst.InvalidTraceModule6.d.ksh
+ * /usr/sbin/dtrace -m fbt:des:des3_crunch_block:return
+ * RESULT: invalid probe description.
+ *
+ * 12)
+ * /usr/sbin/dtrace -m fbt:genunix'{printf("FOUND");}'
+ * RESULT: tracing of all the probes matching provider fbt and module
+ * genunix.
+ *
+ * 13)
+ * /usr/sbin/dtrace -m genunix'{printf("FOUND");}'
+ * RESULT: tracing of all the probes matching module genunix with
+ * message FOUND
+ *
+ * 14)
+ * /usr/sbin/dtrace -m :genunix'{printf("FOUND");}'
+ * RESULT: tracing of all the probes matching module genunix with
+ * message FOUND
+ *
+ * 15) automated in tst.InvalidTraceModule7.d.ksh
+ * /usr/sbin/dtrace -m genunix::'{printf("FOUND");}'
+ * RESULT: invalid probe specifier.
+ *
+ * 16) automated in tst.InvalidTraceModule8.d.ksh
+ * /usr/sbin/dtrace -m genunix:'{printf("FOUND");}'
+ * RESULT: invalid probe specifier.
+ *
+ * 17)
+ * /usr/sbin/dtrace -m unix '{printf("FOUND");}'
+ * RESULT: invalid probe specifier.
+ *
+ * 18)
+ * /usr/sbin/dtrace -m
+ * unix'/probefunc == "preempt"/{printf("FOUND");}'
+ * RESULT: tracing of all the probes matching module genunix,
+ * probe function preempt with message FOUND.
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceNames b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceNames
new file mode 100644
index 000000000000..c3e75554e025
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceNames
@@ -0,0 +1,129 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -n option.
+ *
+ * SECTION: dtrace Utility/-n Option
+ *
+ * NOTES: Manually check:
+ *
+ * 1) automated in tst.InvalidTraceName1.d.ksh
+ * /usr/sbin/dtrace -n profile
+ * RESULT: invalid probe specifier
+ *
+ * 2) automated in tst.InvalidTraceName2.d.ksh
+ * /usr/sbin/dtrace -n genunix
+ * RESULT: invalid probe specifier
+ *
+ * 3) automated in tst.InvalidTraceName3.d.ksh
+ * /usr/sbin/dtrace -n read
+ * RESULT: invalid probe specifier
+ *
+ * 4)
+ * /usr/sbin/dtrace -n BEGIN
+ * RESULT: trace of one probe with name BEGIN.
+ *
+ * 5) automated in tst.InvalidTraceName4.d.ksh
+ * /usr/sbin/dtrace -n begin
+ * RESULT: invalid probe specifier
+ *
+ * 6) automated in tst.InvalidTraceName5.d.ksh
+ * /usr/sbin/dtrace -n genunix:read
+ * RESULT: invalid probe specifier
+ *
+ * 7)
+ * /usr/sbin/dtrace -n genunix:read:
+ * RESULT: trace of probes with module genunix and function read.
+ *
+ * 8) automated in tst.InvalidTraceName6.d.ksh
+ * /usr/sbin/dtrace -n sysinfo:genunix:read
+ * RESULT: invalid probe specifier
+ *
+ * 9)
+ * /usr/sbin/dtrace -n sysinfo:genunix:read:
+ * RESULT: tracing of probes with provider sysinfo, module genunix
+ * and function read.
+ *
+ * 10)
+ * /usr/sbin/dtrace -n :genunix::
+ * RESULT: tracing of probes with module genunix
+ *
+ * 11) automated in tst.InvalidTraceName7.d.ksh
+ * /usr/sbin/dtrace -n :genunix:
+ * RESULT: invalid probe specifier
+ *
+ * 12)
+ * /usr/sbin/dtrace -n ::read:
+ * RESULT: tracing of probes with function read.
+ *
+ * 13)
+ * /usr/sbin/dtrace -n profile:::profile-97
+ * RESULT: tracing of probes with provider profile and name
+ * profile-97
+ *
+ * 14)
+ * /usr/sbin/dtrace -n read: -n write:
+ * RESULT: tracing of both read and write probes.
+ *
+ * 15)
+ * /usr/sbin/dtrace -n read: -n fight:
+ * RESULT: Count of mathching read probes and invalid probe specifier
+ * for fight:
+ *
+ * 16) automated in tst.InvalidTraceName8.d.ksh
+ * /usr/sbin/dtrace -n fight: -n write:
+ * RESULT: invalid probe specifier
+ *
+ * 17)
+ * /usr/sbin/dtrace -n fbt:des:des3_crunch_block:return
+ * RESULT: trace of the specified probe.
+ *
+ * 18)
+ * /usr/sbin/dtrace -n read:'{printf("FOUND");}'
+ * RESULT: Trace of all the probes with module read and a message
+ * saying FOUND.
+ *
+ * 19)
+ * /usr/sbin/dtrace -n read:entry'{printf("FOUND");}'
+ * RESULT: Trace of all the probes with module read, name entry.Output
+ * of a message saying FOUND.
+ *
+ * 20)
+ * /usr/sbin/dtrace -n BEGIN'{printf("FOUND");}'
+ * RESULT: Trace of the BEGIN probe with the message FOUND.
+ *
+ * 21) automated in tst.InvalidTraceName9.d.ksh
+ * /usr/sbin/dtrace -n BEGIN '{printf("FOUND");}'
+ * RESULT: invalid probe specifier
+ *
+ * 22)
+ * /usr/sbin/dtrace -n BEGIN'/probename == "entry"/{printf("FOUND");}'
+ * RESULT: Tracing of BEGIN function but no message FOUND.
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceProvider b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceProvider
new file mode 100644
index 000000000000..f52f395c41fe
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceProvider
@@ -0,0 +1,83 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -P option to trace all the probes provided by the particular
+ * provider.
+ *
+ * SECTION: dtrace Utility/-P Option
+ *
+ * NOTES: Manually check:
+ *
+ * 1)
+ * /usr/sbin/dtrace -P profile
+ * RESULT: Trace of all profile probes.
+ *
+ * 2) automated in tst.InvalidTraceProvider1.d.ksh
+ * /usr/sbin/dtrace -P foofile
+ * RESULT: invalid probe specifier
+ *
+ * 3) automated in tst.InvalidTraceProvider2.d.ksh
+ * /usr/sbin/dtrace -P profile:::
+ * RESULT: invalid probe specifier
+ *
+ * 4) automated in tst.InvalidTraceProvider3.d.ksh
+ * /usr/sbin/dtrace -P profile:::profile-97
+ * RESULT: invalid probe specifier
+ *
+ * 5)
+ * /usr/sbin/dtrace -P profile -P syscall
+ * RESULT: matching traces of both profile and syscall probes.
+ *
+ * 6)
+ * /usr/sbin/dtrace -P profile -P foofile
+ * RESULT: Count of profile probes that matched and invalid
+ * probe specifier for foofile and no tracing.
+ *
+ * 7) automated in tst.InvalidTraceProvider4.d.ksh
+ * /usr/sbin/dtrace -P fbt:des:des3_crunch_block:return
+ * RESULT: invalid probe specifier
+ *
+ * 8)
+ * /usr/sbin/dtrace -P profile'{printf("FOUND");}'
+ * RESULT: Traces of all the matching profile probes with the
+ * FOUND message.
+ *
+ * 9) automated in tst.InvalidTraceProvider5.d.ksh
+ * /usr/sbin/dtrace -P profile '{printf("FOUND");}'
+ * RESULT: invalid probe specifier
+ *
+ * 10)
+ * /usr/sbin/dtrace -P
+ * profile'/probename == "profile-199"/{printf("FOUND");}'
+ * RESULT: Traces of the matching profile probe with the
+ * FOUND message.
+ *
+ *
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.VerboseStabilityReport.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.VerboseStabilityReport.d
new file mode 100644
index 000000000000..23742284cb98
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.VerboseStabilityReport.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using -v option with dtrace utility produces a program stability report
+ * showing the minimum interface stability and dependency level for
+ * the specified D programs.
+ *
+ * SECTION: dtrace Utility/-s Option;
+ * dtrace Utility/-v Option
+ *
+ * NOTES: Use this file as
+ * /usr/sbin/dtrace -vs man.VerboseStabilityReport.d
+ *
+ */
+
+BEGIN
+{
+ printf("This test should compile: %d\n", 2);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh
new file mode 100644
index 000000000000..b36f1e4c181d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh
@@ -0,0 +1,82 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -I option can be used to search path for #include files when used
+# in conjunction with the -C option. The specified directory is inserted into
+# the search path adhead of the default directory list.
+#
+# SECTION: dtrace Utility/-C Option
+# SECTION: dtrace Utility/-I Option
+#
+##
+
+script()
+{
+ $dtrace -C -I /tmp -s /dev/stdin <<EOF
+ #pragma D option quiet
+#include "test.h"
+
+ BEGIN
+ /1520 != VALUE/
+ {
+ printf("VALUE: %d, Test should fail\n", VALUE);
+ exit(1);
+ }
+
+ BEGIN
+ /1520 == VALUE/
+ {
+ printf("VALUE: %d, Test should pass\n", VALUE);
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+tempfile=/tmp/test.h
+echo "#define VALUE 1520" > $tempfile
+
+dtrace=$1
+script
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+ exit $status
+fi
+
+/bin/rm -f $tempfile
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeGiga.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeGiga.d.ksh
new file mode 100644
index 000000000000..2f0c56739426
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeGiga.d.ksh
@@ -0,0 +1,45 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# ASSERTION:
+# The trace buffer size can include any of the size suffixes k, m, g or t
+#
+# SECTION: dtrace Utility/-b Option
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -b 1g -b 2g -e
+
+exit $?
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeKilo.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeKilo.d.ksh
new file mode 100644
index 000000000000..d969b481d33f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeKilo.d.ksh
@@ -0,0 +1,45 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# ASSERTION:
+# The trace buffer size can include any of the size suffixes k, m, g or t
+#
+# SECTION: dtrace Utility/-b Option
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -b 1k -b 2k -e
+
+exit $?
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeMega.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeMega.d.ksh
new file mode 100644
index 000000000000..a08327a30a51
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeMega.d.ksh
@@ -0,0 +1,45 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# ASSERTION:
+# The trace buffer size can include any of the size suffixes k, m, g or t
+#
+# SECTION: dtrace Utility/-b Option
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -b 1m -b 2m -e
+
+exit $?
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeTera.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeTera.d.ksh
new file mode 100644
index 000000000000..00f2c6622f3d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeTera.d.ksh
@@ -0,0 +1,45 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# ASSERTION:
+# The trace buffer size can include any of the size suffixes k, m, g or t
+#
+# SECTION: dtrace Utility/-b Option
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -b 1t -b 2t -e
+
+exit $?
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel32.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel32.d.ksh
new file mode 100644
index 000000000000..e4ef38db431e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel32.d.ksh
@@ -0,0 +1,73 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# If the -32 option is specified, dtrace will force the D compiler to
+# compile a program using the 32-bit data model.
+#
+# SECTION: dtrace Utility/-32 Option
+#
+##
+
+script()
+{
+ $dtrace -32 -s /dev/stdin <<EOF
+ BEGIN
+ /4 != sizeof(long)/
+ {
+ printf("Not targeted for 32 bit machine\n");
+ exit(1);
+ }
+
+ BEGIN
+ /4 == sizeof(long)/
+ {
+ printf("Targeted for 32 bit machine\n");
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+script
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel64.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel64.d.ksh
new file mode 100644
index 000000000000..8a9de0c87c73
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel64.d.ksh
@@ -0,0 +1,74 @@
+#!/bin/ksh
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# If the -64 option is specified, dtrace will force the D compiler to
+# compile a program using the 64-bit data model.
+#
+# SECTION: dtrace Utility/-64 Option
+#
+##
+
+script()
+{
+ $dtrace -64 -s /dev/stdin <<EOF
+ BEGIN
+ /8 != sizeof(long)/
+ {
+ printf("Not targeted for 64 bit machine\n");
+ exit(1);
+ }
+
+ BEGIN
+ /8 == sizeof(long)/
+ {
+ printf("Targeted for 64 bit machine\n");
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+script
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh
new file mode 100644
index 000000000000..9be2b291d43f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh
@@ -0,0 +1,68 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -D option can be used to define a name when used in conjunction
+# with the -C option.
+#
+# SECTION: dtrace Utility/-C Option;
+# dtrace Utility/-D Option
+#
+##
+
+script()
+{
+ $dtrace -C -D VALUE=40 -s /dev/stdin <<EOF
+ #pragma D option quiet
+
+ BEGIN
+ {
+ printf("Value of VALUE: %d\n", VALUE);
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+script
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh.out
new file mode 100644
index 000000000000..5f91ad16d56b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh.out
@@ -0,0 +1,2 @@
+Value of VALUE: 40
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh
new file mode 100644
index 000000000000..0259db367e94
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh
@@ -0,0 +1,56 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -w option can be used to permit destructive actions in D programs.
+#
+# SECTION: dtrace Utility/-w Option;
+# dtrace Utility/-f Option
+#
+##
+
+
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qwf read'{chill(15); printf("Done chilling"); exit(0);}'
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh.out
new file mode 100644
index 000000000000..8975980fdc0b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh.out
@@ -0,0 +1 @@
+Done chilling
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh
new file mode 100644
index 000000000000..6d3913f852a9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh
@@ -0,0 +1,54 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -w option can be used to permit destructive actions in D programs.
+#
+# SECTION: dtrace Utility/-w Option;
+# dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qwi 1'{chill(15); printf("Done chilling"); exit(0);}'
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh.out
new file mode 100644
index 000000000000..8975980fdc0b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh.out
@@ -0,0 +1 @@
+Done chilling
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh
new file mode 100644
index 000000000000..8ab32fdb40ee
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh
@@ -0,0 +1,54 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -w option can be used to permit destructive actions in D programs.
+#
+# SECTION: dtrace Utility/-w Option;
+# dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qwm kernel'{chill(15); printf("Done chilling"); exit(0);}'
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh.out
new file mode 100644
index 000000000000..8975980fdc0b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh.out
@@ -0,0 +1 @@
+Done chilling
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh
new file mode 100644
index 000000000000..b21903fb5734
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh
@@ -0,0 +1,54 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -w option can be used to permit destructive actions in D programs.
+#
+# SECTION: dtrace Utility/-w Option;
+# dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qwn BEGIN'{chill(15); printf("Done chilling"); exit(0);}'
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh.out
new file mode 100644
index 000000000000..8975980fdc0b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh.out
@@ -0,0 +1 @@
+Done chilling
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh
new file mode 100644
index 000000000000..09dafecb9c90
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh
@@ -0,0 +1,54 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -w option can be used to permit destructive actions in D programs.
+#
+# SECTION: dtrace Utility/-w Option;
+# dtrace Utility/-P Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qwP syscall'{chill(15); printf("Done chilling"); exit(0);}'
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh.out
new file mode 100644
index 000000000000..8975980fdc0b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh.out
@@ -0,0 +1 @@
+Done chilling
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithoutW.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithoutW.d.ksh
new file mode 100644
index 000000000000..9f051b4cbd41
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithoutW.d.ksh
@@ -0,0 +1,55 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Destructive actions will not compile or are not enabled without the
+# -w option in D programs.
+#
+# SECTION: dtrace Utility/-w Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qP syscall'{chill(15); printf("Done chilling"); exit(0);}'
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh
new file mode 100644
index 000000000000..a4f4670c02ce
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh
@@ -0,0 +1,73 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Using -G option with dtrace utility produces an ELF file containing a
+# DTrace program. If the filename used with the -s option does not end
+# with .d, and the -o option is not used, then the output ELF file is
+# in d.out.
+#
+# SECTION: dtrace Utility/-G Option
+#
+##
+
+script()
+{
+ $dtrace -G -s /dev/stdin <<EOF
+ BEGIN
+ {
+ printf("This test should compile.\n");
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+script
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+ exit $status
+fi
+
+if [ ! -a "d.out" ]; then
+ echo $tst: file not generated
+ exit 1
+fi
+
+/bin/rm -f "d.out"
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh
new file mode 100644
index 000000000000..503dd50e0891
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh
@@ -0,0 +1,74 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Using -G option with dtrace utility produces an ELF file containing a
+# DTrace program. The output file can be named as required using the
+# -o option in conjunction with the -G option.
+#
+# SECTION: dtrace Utility/-G Option;
+# dtrace Utility/-o Option
+#
+##
+
+script()
+{
+ $dtrace -G -o outputFile -s /dev/stdin <<EOF
+ BEGIN
+ {
+ printf("This test should compile.\n");
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+script
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+ exit $status
+fi
+
+if [ ! -a "outputFile" ]; then
+ echo $tst: file not generated
+ exit 1
+fi
+
+/bin/rm -f "outputFile"
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus1.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus1.d.ksh
new file mode 100644
index 000000000000..70a9f498fc5e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus1.d.ksh
@@ -0,0 +1,56 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# When a fatal error occurs such that the program compilation fails or the
+# specified request cannot be satisfied, an exit status of 1 is returned.
+#
+#
+# SECTION: dtrace Utility/Exit Status
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -s wassup
+status=$?
+
+if [ "$status" -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus2.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus2.d.ksh
new file mode 100644
index 000000000000..a058d3a35b52
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus2.d.ksh
@@ -0,0 +1,55 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# When invalid command line options or arguments are specified an exit status
+# of 2 is returned.
+#
+# SECTION: dtrace Utility/Exit Status
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -9
+status=$?
+
+if [ "$status" -ne 2 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExtraneousProbeIds.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExtraneousProbeIds.d.ksh
new file mode 100644
index 000000000000..090fc4a069a4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExtraneousProbeIds.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -i option with extraneous probe identifiers.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i 12 10 -i 23
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName1.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName1.d.ksh
new file mode 100644
index 000000000000..c28c782374b2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName1.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f BEGIN
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName2.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName2.d.ksh
new file mode 100644
index 000000000000..d431579db6c5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName2.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f 4.56
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId1.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId1.d.ksh
new file mode 100644
index 000000000000..814b88dd8188
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId1.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -li option can be used to list the probes from their ids. An id of
+# negative integer is invalid
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -li -3
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId2.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId2.d.ksh
new file mode 100644
index 000000000000..f9f440786669
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId2.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -li option can be used to list the probes from their ids. A
+# non-increasing range will not list any probes.
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -li 4-2
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId3.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId3.d.ksh
new file mode 100644
index 000000000000..efb03ae2f5d5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId3.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -li option can be used to list the probes from their ids. A
+# non-increasing range will not list any probes.
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -li 2-2
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule1.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule1.d.ksh
new file mode 100644
index 000000000000..a896ff3d1539
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule1.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -lm option can be used to list the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -lm :genunix::
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule2.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule2.d.ksh
new file mode 100644
index 000000000000..820cc64dfbef
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule2.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -lm option can be used to list the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -lm profile:::profile-97
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule3.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule3.d.ksh
new file mode 100644
index 000000000000..b56e6c376fd3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule3.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -lm option can be used to list the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -lm fbt:des:des3_crunch_block:return
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule4.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule4.d.ksh
new file mode 100644
index 000000000000..0ef9d9563fdb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule4.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -lm option can be used to list the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -lm unix'/probefunc == "preempt"/{printf("FOUND");}'
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProbeIdentifier.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProbeIdentifier.d.ksh
new file mode 100644
index 000000000000..66e0e1a514ea
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProbeIdentifier.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -i option with invalid probe identifier.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i i23
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider1.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider1.d.ksh
new file mode 100644
index 000000000000..327e2d01bc04
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider1.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -lP option can be used to list the probes from their provider names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-P Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -lP profile:::profile-97
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider2.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider2.d.ksh
new file mode 100644
index 000000000000..22624495c699
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider2.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -lP option can be used to list the probes from their provider names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-P Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -lP profile:::
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider3.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider3.d.ksh
new file mode 100644
index 000000000000..775b327c469d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider3.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -lP option can be used to list the probes from their provider names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-P Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -lP fbt:des:des3_crunch_block:return
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider4.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider4.d.ksh
new file mode 100644
index 000000000000..04343f3e5425
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider4.d.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -lP option can be used to list the probes from their provider names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-l Option;
+# dtrace Utility/-P Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -lP profile'/probename == "profile-199"/{printf("FOUND");}'
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc1.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc1.d.ksh
new file mode 100644
index 000000000000..1395f3be807f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc1.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f profile
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc2.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc2.d.ksh
new file mode 100644
index 000000000000..4231e5c7057f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc2.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f genunix
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc3.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc3.d.ksh
new file mode 100644
index 000000000000..3c5b17831eb0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc3.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f read:
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc4.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc4.d.ksh
new file mode 100644
index 000000000000..bb8460d06181
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc4.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f ::read:
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc5.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc5.d.ksh
new file mode 100644
index 000000000000..544667618726
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc5.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f :genunix::
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc6.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc6.d.ksh
new file mode 100644
index 000000000000..645e6d9f3f05
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc6.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f profile:::profile-97
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh
new file mode 100644
index 000000000000..a93d5c4b0772
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f fbt:des:des3_crunch_block:return
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc8.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc8.d.ksh
new file mode 100644
index 000000000000..22ab3b16bc46
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc8.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f fight -f write
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc9.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc9.d.ksh
new file mode 100644
index 000000000000..2af27a325aa4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc9.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -f option with an invalid function name.
+#
+# SECTION: dtrace Utility/-f Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -f read '{printf("FOUND");}'
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID1.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID1.d.ksh
new file mode 100644
index 000000000000..46096d216b6b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID1.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -i option can be used to enable the trace of probes from their ids. A
+# non-increasing range will not list any probes.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i 0
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID2.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID2.d.ksh
new file mode 100644
index 000000000000..f406ce005948
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID2.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -i option can be used to enable the trace of probes from their ids. A
+# non-increasing range will not list any probes.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i -3
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID3.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID3.d.ksh
new file mode 100644
index 000000000000..fc2a24d57051
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID3.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -i option can be used to enable the trace of probes from their ids. A
+# non-increasing range will not list any probes.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i 0-2
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID4.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID4.d.ksh
new file mode 100644
index 000000000000..5fd6fd6c52b4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID4.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -i option can be used to enable the trace of probes from their ids. A
+# non-increasing range will not list any probes.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i 4-2
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID5.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID5.d.ksh
new file mode 100644
index 000000000000..0ac46dbbad01
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID5.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -i option can be used to enable the trace of probes from their ids. A
+# non-increasing range will not list any probes.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i 2-2
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID6.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID6.d.ksh
new file mode 100644
index 000000000000..778d485ad21d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID6.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -i option can be used to enable the trace of probes from their ids. A
+# non-increasing range will not list any probes.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i 1 2 3 4
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID7.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID7.d.ksh
new file mode 100644
index 000000000000..8a0f2d4e5394
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID7.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -i option can be used to enable the trace of probes from their ids. A
+# non-increasing range will not list any probes.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i 0 - 2
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule1.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule1.d.ksh
new file mode 100644
index 000000000000..56dee0dd30af
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule1.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -m option can be used to enable the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -m profile
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule2.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule2.d.ksh
new file mode 100644
index 000000000000..a508fe1030e2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule2.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -m option can be used to enable the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -m :genunix::
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule3.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule3.d.ksh
new file mode 100644
index 000000000000..599ce93e1d6d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule3.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -m option can be used to enable the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -m genunix::
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule4.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule4.d.ksh
new file mode 100644
index 000000000000..e0e87861f732
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule4.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -m option can be used to enable the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -m profile:::profile-97
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule5.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule5.d.ksh
new file mode 100644
index 000000000000..858306021cc9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule5.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -m option can be used to enable the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -m foounix -m unix
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule6.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule6.d.ksh
new file mode 100644
index 000000000000..6125fb0f309f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule6.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -m option can be used to enable the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -m fbt:des:des3_crunch_block:return
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule7.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule7.d.ksh
new file mode 100644
index 000000000000..e689627b8c81
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule7.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -m option can be used to enable the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -m genunix::'{printf("FOUND");}'
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule8.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule8.d.ksh
new file mode 100644
index 000000000000..692821b56159
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule8.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -m option can be used to enable the probes from their module names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -m genunix:'{printf("FOUND");}'
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName1.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName1.d.ksh
new file mode 100644
index 000000000000..43c61af3e359
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName1.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -n option can be used to enable the trace of probes from their names.
+#
+# SECTION: dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -n profile
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName2.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName2.d.ksh
new file mode 100644
index 000000000000..70a52188021c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName2.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -n option can be used to enable the trace of probes from their names.
+#
+# SECTION: dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -n genunix
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName3.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName3.d.ksh
new file mode 100644
index 000000000000..efb5ad088cf1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName3.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -n option can be used to enable the trace of probes from their names.
+#
+# SECTION: dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -n not_a_valid_probe
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName4.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName4.d.ksh
new file mode 100644
index 000000000000..04845b997117
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName4.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -n option can be used to enable the trace of probes from their names.
+#
+# SECTION: dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -n begin
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName5.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName5.d.ksh
new file mode 100644
index 000000000000..df17231fc2de
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName5.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -n option can be used to enable the trace of probes from their names.
+#
+# SECTION: dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -n genunix:read
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName6.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName6.d.ksh
new file mode 100644
index 000000000000..10f13cb3188b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName6.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -n option can be used to enable the trace of probes from their names.
+#
+# SECTION: dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -n sysinfo:genunix:read
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName7.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName7.d.ksh
new file mode 100644
index 000000000000..b22561fa0e19
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName7.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -n option can be used to enable the trace of probes from their names.
+#
+# SECTION: dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -n :genunix:
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName8.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName8.d.ksh
new file mode 100644
index 000000000000..f66055e242fe
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName8.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -n option can be used to enable the trace of probes from their names.
+#
+# SECTION: dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -n fight: -n write:
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName9.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName9.d.ksh
new file mode 100644
index 000000000000..a4239ff90375
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName9.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -n option can be used to enable the trace of probes from their names.
+#
+# SECTION: dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -n BEGIN '{printf("FOUND");}'
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider1.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider1.d.ksh
new file mode 100644
index 000000000000..0a792c595b15
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider1.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -P option can be used to list the probes from their provider names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-P Option;
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -P foofile
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider2.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider2.d.ksh
new file mode 100644
index 000000000000..1763142b7a8b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider2.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -P option can be used to list the probes from their provider names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-P Option;
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -P profile:::
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider3.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider3.d.ksh
new file mode 100644
index 000000000000..a8549329cdca
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider3.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -P option can be used to list the probes from their provider names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-P Option;
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -P profile:::profile-97
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider4.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider4.d.ksh
new file mode 100644
index 000000000000..f8a1359c5458
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider4.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -P option can be used to list the probes from their provider names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-P Option;
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -P fbt:des:des3_crunch_block:return
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider5.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider5.d.ksh
new file mode 100644
index 000000000000..cec4297c0328
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider5.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -P option can be used to list the probes from their provider names.
+# Invalid module names result in error.
+#
+# SECTION: dtrace Utility/-P Option;
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -P profile '{printf("FOUND");}'
+
+status=$?
+
+echo $status
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.MultipleInvalidProbeId.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.MultipleInvalidProbeId.d.ksh
new file mode 100644
index 000000000000..8f2ceefd9211
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.MultipleInvalidProbeId.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -i option with multiple valid and invalid probe identifiers.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i 12 -i 10 -i 0
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh
new file mode 100644
index 000000000000..e4d093e4fc22
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh
@@ -0,0 +1,69 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -C option is used to run the C preprocessor over D programs before
+# compiling them. The -H option used in conjuction with the -C option
+# lists the pathnames of the included files to STDERR.
+#
+# SECTION: dtrace Utility/-C Option;
+# dtrace Utility/-H Option
+#
+##
+
+script()
+{
+ $dtrace -CH -s /dev/stdin <<EOF
+
+
+ BEGIN
+ {
+ printf("This test should compile\n");
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+script
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh
new file mode 100644
index 000000000000..4bfbf767d677
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh
@@ -0,0 +1,65 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Using the -q option suppresses the dtrace messages and prints only the
+# data traced by trace() and printf() to stdout.
+#
+# SECTION: dtrace Utility/-q Option
+#
+##
+
+script()
+{
+ $dtrace -q -s /dev/stdin <<EOF
+
+ BEGIN
+ {
+ printf("I am the only one.");
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+script
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh.out
new file mode 100644
index 000000000000..20e31b50ec48
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh.out
@@ -0,0 +1 @@
+I am the only one.
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh
new file mode 100644
index 000000000000..16cd05f95b4c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh
@@ -0,0 +1,67 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Using the -e option exits after compiling any requests but before
+# enabling probes.
+#
+# SECTION: dtrace Utility/-e Option
+#
+##
+
+script()
+{
+ $dtrace -e -s /dev/stdin <<EOF
+ #pragma D option quiet
+ BEGIN
+ {
+ i = 100;
+ printf("Value of i: %d\n", i);
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+script
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh.out
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh.out
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.UnDefineNameWithCPP.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.UnDefineNameWithCPP.d.ksh
new file mode 100644
index 000000000000..4c1eb507d5eb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.UnDefineNameWithCPP.d.ksh
@@ -0,0 +1,71 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -D option can be used to define a name when used in conjunction
+# with the -C option. The -U option can be used to undefine a name in
+# conjunction with the -C option.
+#
+# SECTION: dtrace Utility/-C Option;
+# dtrace Utility/-D Option;
+# dtrace Utility/-U Option
+#
+##
+
+script()
+{
+ $dtrace -C -D VALUE=40 -U VALUE -s /dev/stdin <<EOF
+ #pragma D option quiet
+
+ BEGIN
+ {
+ printf("Value of VALUE: %d\n", VALUE);
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+script
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh
new file mode 100644
index 000000000000..5e61f053636f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh
@@ -0,0 +1,58 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -Z option can be used to permit descriptions that match
+# zero probes.
+#
+# SECTION: dtrace Utility/-Z Option;
+# dtrace Utility/-f Option
+#
+##
+
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qZf wassup'{printf("Iamkool");}' \
+-qf read'{printf("I am done"); exit(0);}'
+
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh.out
new file mode 100644
index 000000000000..0f2e1aacd09e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh.out
@@ -0,0 +1 @@
+I am done
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh
new file mode 100644
index 000000000000..c34a4aabddfc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -Z option can be used to permit descriptions that match
+# zero probes.
+#
+# SECTION: dtrace Utility/-Z Option;
+# dtrace Utility/-m Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qZm wassup'{printf("Iamkool");}' \
+-qm BEGIN'{printf("I am done"); exit(0);}'
+
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh.out
new file mode 100644
index 000000000000..0f2e1aacd09e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh.out
@@ -0,0 +1 @@
+I am done
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh
new file mode 100644
index 000000000000..90175a50b7b0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh
@@ -0,0 +1,56 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -Z option can be used to permit descriptions that match
+# zero probes.
+#
+# SECTION: dtrace Utility/-Z Option;
+# dtrace Utility/-n Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qZn wassup'{printf("Iamkool");}' \
+-qn BEGIN'{printf("I am done"); exit(0);}'
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh.out
new file mode 100644
index 000000000000..0f2e1aacd09e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh.out
@@ -0,0 +1 @@
+I am done
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbeIdentfier.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbeIdentfier.d.ksh
new file mode 100644
index 000000000000..9af4d2b8c836
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbeIdentfier.d.ksh
@@ -0,0 +1,53 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Testing -i option with zero probe identifier.
+#
+# SECTION: dtrace Utility/-i Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -i 0
+
+if [ $? -ne 1 ]; then
+ echo $tst: dtrace failed
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbesWithoutZ.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbesWithoutZ.d.ksh
new file mode 100644
index 000000000000..afc7d76d22bb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbesWithoutZ.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# Without the -Z option probe descriptions that do not match any known
+# probes will cause an error or will not be enabled.
+#
+# SECTION: dtrace Utility/-Z Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qP wassup'{printf("Iamkool");}' \
+-qP profile'{printf("I am done"); exit(0);}'
+
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo $tst: dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh
new file mode 100644
index 000000000000..f2646bd53401
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+##
+#
+# ASSERTION:
+# The -Z option can be used to permit descriptions that match
+# zero probes.
+#
+# SECTION: dtrace Utility/-Z Option;
+# dtrace Utility/-P Option
+#
+##
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qZP wassup'{printf("Iamkool");}' \
+-qP profile'{printf("I am done"); exit(0);}'
+
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh.out
new file mode 100644
index 000000000000..0f2e1aacd09e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh.out
@@ -0,0 +1 @@
+I am done
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/err.D_IDENT_UNDEF.timespent.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/err.D_IDENT_UNDEF.timespent.d
new file mode 100644
index 000000000000..04ccb7266816
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/err.D_IDENT_UNDEF.timespent.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Calculate timestamp between BEGIN and END.
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+END
+{
+ total = timestamp - start;
+}
+
+BEGIN
+{
+ start = timestamp;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.end.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.end.d
new file mode 100644
index 000000000000..56c1a4c42617
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.end.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Sequence flow of END profile.
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+END
+{
+ printf("End fired after exit\n");
+}
+
+BEGIN
+{
+ printf("Begin fired first\n");
+}
+
+tick-1
+{
+ printf("tick fired second\n");
+ printf("Call exit\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.endwithoutbegin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.endwithoutbegin.d
new file mode 100644
index 000000000000..6291960701cc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.endwithoutbegin.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * END without BEGIN profile
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+END
+{
+ printf("End fired after exit\n");
+}
+
+tick-1
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.multibeginend.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.multibeginend.d
new file mode 100644
index 000000000000..4f6ec9210beb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.multibeginend.d
@@ -0,0 +1,77 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Tests multiple END profile.
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+END
+{
+ printf("End1 fired after exit\n");
+}
+END
+{
+ printf("End2 fired after exit\n");
+}
+END
+{
+ printf("End3 fired after exit\n");
+}
+END
+{
+ printf("End4 fired after exit\n");
+}
+
+BEGIN
+{
+ printf("Begin fired first\n");
+}
+BEGIN
+{
+ printf("Begin fired second\n");
+}
+BEGIN
+{
+ printf("Begin fired third\n");
+}
+BEGIN
+{
+ printf("Begin fired fourth\n");
+}
+BEGIN
+{
+ printf("Begin fired fifth\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.multiend.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.multiend.d
new file mode 100644
index 000000000000..e6629fb5cb31
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.multiend.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Tests Multiple END and single BEGIN
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+END
+{
+ printf("End1 fired after exit\n");
+}
+END
+{
+ printf("End2 fired after exit\n");
+}
+END
+{
+ printf("End3 fired after exit\n");
+}
+END
+{
+ printf("End4 fired after exit\n");
+}
+
+BEGIN
+{
+ printf("Begin fired first\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d
new file mode 100644
index 000000000000..7e5427a51085
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Enumerations assigning same or different values to the same identifier in
+ * different enumerations should throw a compiler error.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ *
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+enum colors {
+ RED,
+ GREEN,
+ BLUE
+};
+
+enum shades {
+ RED,
+ ORANGE,
+ GREEN,
+ WHITE
+};
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d
new file mode 100644
index 000000000000..2b4266d5c015
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Repeating the same identifier in the same enumeration will throw a compiler
+ * error.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ *
+ * NOTES:
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+enum colors {
+ RED,
+ GREEN,
+ GREEN = 2,
+ BLUE
+};
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d
new file mode 100644
index 000000000000..cbf9369a8a6a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the identifiers in different D enumerations at same position for
+ * equality.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ */
+
+#pragma D option quiet
+
+enum colors {
+ RED,
+ GREEN,
+ BLUE
+};
+
+enum shades {
+ WHITE,
+ BLACK,
+ YELLOW
+};
+
+
+profile:::tick-1sec
+/(WHITE == RED) && (YELLOW == BLUE) && (GREEN == BLACK)/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d
new file mode 100644
index 000000000000..26a4d504dcc4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Enumerations assigning the same value to different identifiers in the same
+ * enumeration should work okay.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ *
+ * NOTES:
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+enum colors {
+ RED = 2,
+ GREEN = 2,
+ BLUE = 2
+};
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d
new file mode 100644
index 000000000000..f721c50a3941
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Test the D enumerations with and without initilialization of the identifiers.
+ * Also test for values with negative integer assignments, expressions and
+ * fractions.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+enum colors {
+ RED,
+ ORANGE = 5 + 5,
+ YELLOW = 2,
+ GREEN,
+ BLUE = GREEN + ORANGE,
+ PINK = 5/4,
+ INDIGO = -2,
+ VIOLET
+};
+
+profile:::tick-1sec
+/(0 == RED) && (10 == ORANGE) && (2 == YELLOW) && (3 == GREEN) &&
+ (13 == BLUE) && (1 == PINK) && (-2 == INDIGO) && (-1 == VIOLET)/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_BADADDR.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_BADADDR.d
new file mode 100644
index 000000000000..5eb3e94c2e38
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_BADADDR.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To test DTRACEFLT_BADADDR error
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+ERROR
+{
+ printf("The arguments are %u %u %u %u %u\n",
+ arg1, arg2, arg3, arg4, arg5);
+ printf("The value of arg4 = %u\n", DTRACEFLT_BADADDR);
+ exit(0);
+}
+
+BEGIN
+{
+ *(char *)NULL;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_DIVZERO.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_DIVZERO.d
new file mode 100644
index 000000000000..5b93168a127d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_DIVZERO.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To test DTRACEFLT_DIVZERO error
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+ERROR
+{
+ printf("The arguments are %u %u %u %d %u\n",
+ arg1, arg2, arg3, arg4, arg5);
+ exit(0);
+}
+
+char *s;
+
+BEGIN
+{
+ i = 1;
+ j = 2;
+ j = i/(j-2);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_UNKNOWN.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_UNKNOWN.d
new file mode 100644
index 000000000000..6de75bbcce79
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_UNKNOWN.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To test DTRACEFLT_UNKNOWN error
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+ERROR
+{
+ printf("The arguments are %u %u %u %u %u\n",
+ arg1, arg2, arg3, arg4, arg5);
+ printf("The value of arg4 = %u\n", DTRACEFLT_UNKNOWN);
+ exit(0);
+}
+
+BEGIN
+{
+ x = (int *) 64;
+ y = *x;
+ trace(y);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.error.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.error.d
new file mode 100644
index 000000000000..3b1d65399db6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.error.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To fire ERROR probe
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+ERROR
+{
+ printf("Error fired\n");
+ exit(0);
+}
+
+BEGIN
+{
+ *(char *)NULL;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.errorend.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.errorend.d
new file mode 100644
index 000000000000..0bb4a6efce5b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.errorend.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Flow of ERROR probe
+ *
+ * SECTION: dtrace Provider
+ *
+ */
+
+
+#pragma D option quiet
+
+ERROR
+{
+ printf("Error fired\n");
+ exit(0);
+}
+
+END
+{
+ printf("End fired after exit\n");
+}
+
+BEGIN
+{
+ *(char *)NULL;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/err.D_PROTO_LEN.noarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/err.D_PROTO_LEN.noarg.d
new file mode 100644
index 000000000000..9a9a8f934c18
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/err.D_PROTO_LEN.noarg.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Call exit() without arguments.
+ *
+ * SECTION: Actions and Subroutines/exit()
+ */
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ exit()
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/err.exitarg1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/err.exitarg1.d
new file mode 100644
index 000000000000..d3067d126977
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/err.exitarg1.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Basic test - call with 1
+ *
+ * SECTION: Actions and Subroutines/exit()
+ */
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/tst.basic1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/tst.basic1.d
new file mode 100644
index 000000000000..24f841c3478c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/tst.basic1.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test
+ *
+ * SECTION: Actions and Subroutines/exit()
+ */
+
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/err.D_PDESC_ZERO.notreturn.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/err.D_PDESC_ZERO.notreturn.d
new file mode 100644
index 000000000000..5e3d5fa7eb06
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/err.D_PDESC_ZERO.notreturn.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION: Call fbt provider over non existent function and make
+ * sure it results in compilation error.
+ *
+ * SECTION: FBT Provider/Probes
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ self->traceme = 1;
+}
+
+void bar();
+
+fbt::bar:entry
+{
+ printf("Entering the function\n");
+}
+
+fbt::bar:return
+{
+ printf("Returning the function\n");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.basic.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.basic.d
new file mode 100644
index 000000000000..ff6da26f318c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.basic.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION: simple fbt arguments test.
+ *
+ * SECTION: FBT Provider/Probes
+ */
+
+#pragma D option quiet
+
+tick-1
+{
+ self->traceme = 1;
+}
+
+fbt:::
+/self->traceme/
+{
+ printf("The arguments are %u %u %u %u %u %u %u %u\n", arg0, arg1,
+ arg3, arg4, arg5, arg6, arg7, arg8);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d
new file mode 100644
index 000000000000..e625cd9996d4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION: FBT provider function entry and exit test.
+ *
+ * SECTION: FBT Provider/Probe arguments
+ */
+
+#pragma D option quiet
+#pragma D option statusrate=10ms
+
+fbt::kern_ioctl:entry
+{
+ printf("Entering the ioctl function\n");
+}
+
+fbt::kern_ioctl:return
+{
+ printf("Returning from ioctl function\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d
new file mode 100644
index 000000000000..f0338ec57133
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION: Fbt provider return value verify test.
+ *
+ * SECTION: FBT Provider/Probe arguments
+ */
+
+#pragma D option quiet
+#pragma D option statusrate=10ms
+
+fbt::kern_ioctl:return
+{
+ printf("The function return value is stored in %u\n", arg1);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d
new file mode 100644
index 000000000000..5a26459a2eef
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION: FBT provider arguments scan test.
+ *
+ * SECTION: FBT Provider/Probe arguments
+ */
+
+#pragma D option quiet
+#pragma D option statusrate=10ms
+
+fbt::kern_ioctl:entry
+{
+ printf("Entering the ioctl function\n");
+ printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
+}
+
+fbt::kern_ioctl:return
+{
+ printf("Returning from ioctl function\n");
+ printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d
new file mode 100644
index 000000000000..2ee8080305ba
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION: FBT provider return value offset verification test.
+ *
+ * SECTION: FBT Provider/Probe arguments
+ */
+
+#pragma D option quiet
+#pragma D option statusrate=10ms
+
+BEGIN
+{
+ self->traceme = 1;
+}
+
+fbt::kern_ioctl:entry
+{
+ printf("Entering the function\n");
+}
+
+fbt::kern_ioctl:return
+{
+ printf("The offset = %u\n", arg0);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d
new file mode 100644
index 000000000000..1e8ae16e0970
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION: FBT provider argument 0 test
+ *
+ * SECTION: FBT Provider/Probe arguments
+ */
+
+#pragma D option quiet
+#pragma D option statusrate=10ms
+
+fbt::kern_ioctl:entry
+{
+ printf("Entering the ioctl function\n");
+ printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
+ exit(0);
+}
+
+fbt::kern_ioctl:return
+{
+ printf("Returning from ioctl function\n");
+ printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return.d
new file mode 100644
index 000000000000..b269710ec844
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION: simple fbt provider return test.
+ *
+ * SECTION: FBT Provider/Probe arguments
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ self->traceme = 1;
+}
+
+fbt:::entry
+{
+ printf("Entering the function\n");
+}
+
+fbt:::return
+{
+ printf("Returning the function\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d
new file mode 100644
index 000000000000..3fb54227b050
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION: simple fbt provider arg0 and probfunc print test.
+ *
+ * SECTION: FBT Provider/Probe arguments
+ */
+
+#pragma D option quiet
+#pragma D option statusrate=10ms
+
+fbt::kern_ioctl:return
+/arg1 == 0/
+{
+ printf("%s %x returned 0", probefunc, arg0);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d
new file mode 100644
index 000000000000..8dbb0abe39c0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION: simple fbt provider tailcall test.
+ *
+ * SECTION: FBT Provider/Probe arguments
+ */
+
+#pragma D option quiet
+#pragma D option statusrate=10ms
+
+fbt::kern_ioctl:entry
+{
+ self->traceme = 1;
+}
+
+fbt:::entry
+/self->traceme/
+{
+ printf("called %s\n", probefunc);
+}
+
+fbt::kern_ioctl:return
+/self->traceme/
+{
+ self->traceme = 0;
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_FUNC_UNDEF.progenyofbad1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_FUNC_UNDEF.progenyofbad1.d
new file mode 100644
index 000000000000..bfd1eedf83c0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_FUNC_UNDEF.progenyofbad1.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * progenyof() should accept one argument - a pid
+ *
+ * SECTION: Actions and Subroutines/progenyof()
+ *
+ */
+
+
+BEGIN
+{
+ progencyof(1, 2);
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_OP_VFPTR.badop.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_OP_VFPTR.badop.d
new file mode 100644
index 000000000000..d219bb1fe9e2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_OP_VFPTR.badop.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * +=, -= must handle invalid variables.
+ *
+ * SECTION: Types, Operators, and Expressions/Assignment Operators
+ *
+ */
+
+
+int p;
+
+BEGIN
+{
+ p = 1;
+ p -= alloca(10);
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.chillbadarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.chillbadarg.d
new file mode 100644
index 000000000000..08bd98191f95
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.chillbadarg.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * chill() should handle a bad argument.
+ *
+ * SECTION: Actions and Subroutines/chill()
+ *
+ */
+
+
+BEGIN
+{
+ chill("badarg");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.copyoutbadarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.copyoutbadarg.d
new file mode 100644
index 000000000000..5c02378fb28c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.copyoutbadarg.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * copyout() must handle invalid argument types.
+ *
+ * SECTION: Actions and Subroutines/copyout()
+ *
+ */
+
+
+BEGIN
+{
+ copyout("not_void_*", "not_uinptr_t", "not_size_t");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.mobadarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.mobadarg.d
new file mode 100644
index 000000000000..4df8d1868cf8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.mobadarg.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * mutex_owned() should handle an invalid argument passed.
+ *
+ * SECTION: Actions and Subroutines/mutex_owned()
+ *
+ */
+
+BEGIN
+{
+ mutex_owned("badarg");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.raisebadarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.raisebadarg.d
new file mode 100644
index 000000000000..a3336efe8a98
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.raisebadarg.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * raise() should generate an error if any arguments are sent.
+ *
+ * SECTION: Actions and Subroutines/raise()
+ *
+ */
+
+
+BEGIN
+{
+ raise("badarg");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d
new file mode 100644
index 000000000000..9d4e40b4dbde
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ trace(tolower(2152006));
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d
new file mode 100644
index 000000000000..2c1389bdeb48
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ trace(toupper(timestamp));
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.allocanoarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.allocanoarg.d
new file mode 100644
index 000000000000..a2af00f9ea54
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.allocanoarg.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * alloca() should handle no arguments as an error
+ *
+ * SECTION: Actions and Subroutines/alloca()
+ *
+ */
+
+#pragma D option quiet
+
+
+
+BEGIN
+{
+ ptr = alloca();
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.badbreakpoint.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.badbreakpoint.d
new file mode 100644
index 000000000000..0cb567a51b67
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.badbreakpoint.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * breakpoint() should handle arguments passed as an error.
+ *
+ * SECTION: Actions and Subroutines/breakpoint()
+ *
+ */
+
+
+BEGIN
+{
+ breakpoint(1, 2);
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoofew.d
new file mode 100644
index 000000000000..a0018fa85c4e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoofew.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * chill() should handle no arguments.
+ *
+ * SECTION: Actions and Subroutines/chill()
+ *
+ */
+
+
+BEGIN
+{
+ chill();
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoomany.d
new file mode 100644
index 000000000000..f24e9ef1d284
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoomany.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * chill() should handle too many arguments.
+ *
+ * SECTION: Actions and Subroutines/chill()
+ *
+ */
+
+BEGIN
+{
+ chill(1000, 1000, 1000);
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrbadarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrbadarg.d
new file mode 100644
index 000000000000..1f07814b6789
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrbadarg.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * copyoutstr() must handle invalid argument types.
+ *
+ * SECTION: Actions and Subroutines/copyoutstr()
+ *
+ */
+
+
+BEGIN
+{
+ copyoutstr("string", "not_uintptr_t");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrtoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrtoofew.d
new file mode 100644
index 000000000000..e01868c030ca
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrtoofew.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Calling copyoutstr() with less than 2 arguments will generate an error
+ *
+ * SECTION: Actions and Subroutines/copyoutstr()
+ *
+ */
+
+
+BEGIN
+{
+ copyoutstr("string");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoofew.d
new file mode 100644
index 000000000000..f3706f622805
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoofew.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Calling copyout() with less than 3 arguments will generate an error
+ *
+ * SECTION: Actions and Subroutines/copyout()
+ *
+ */
+
+
+BEGIN
+{
+ copyout(0, 20);
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoomany.d
new file mode 100644
index 000000000000..6fab90d8fc53
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoomany.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * copyout() should handle too many arguments passed.
+ *
+ * SECTION: Actions and Subroutines/copyin();
+ * Actions and Subroutines/copyinstr()
+ *
+ */
+
+
+BEGIN
+{
+ copyout((void *)3, (uintptr_t)1000, (size_t)1000, "toomany");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d
new file mode 100644
index 000000000000..cf4dd5e0e550
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * mutex_owned() should handle too few args passed
+ *
+ * SECTION: Actions and Subroutines/mutex_owned()
+ *
+ */
+
+lockstat:kernel:mtx_lock:adaptive-acquire
+{
+ mutex_owned();
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d
new file mode 100644
index 000000000000..6cc4be03fa30
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * mutex_owned() should handle too many args passed
+ *
+ * SECTION: Actions and Subroutines/mutex_owned()
+ *
+ */
+
+lockstat:kernel:mtx_lock:adaptive-acquire
+{
+ mutex_owned((kmutex_t *)arg0, 99);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d
new file mode 100644
index 000000000000..6ad1e47b434c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * mutex_type_adaptive() should handle an invalid argument passed.
+ *
+ * SECTION: Actions and Subroutines/mutex_type_adaptive()
+ *
+ */
+
+
+BEGIN
+{
+ mutex_type_adaptive(trace());
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d
new file mode 100644
index 000000000000..61d967a5b470
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * mutex_type_adaptive() should handle too few args passed
+ *
+ * SECTION: Actions and Subroutines/mutex_type_adaptive()
+ *
+ */
+
+
+lockstat:kernel:mtx_lock:adaptive-acquire
+{
+ mutex_type_adaptive();
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d
new file mode 100644
index 000000000000..f2c3178e31c6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * mutex_type_adaptive() should handle too many args passed
+ *
+ * SECTION: Actions and Subroutines/mutex_type_adaptive()
+ *
+ */
+
+
+lockstat:kernel:mtx_lock:adaptive-acquire
+{
+ mutex_type_adaptive((kmutex_t *)arg0, 99);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.panicbadarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.panicbadarg.d
new file mode 100644
index 000000000000..87589b48491c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.panicbadarg.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * panic() should handle any argument passed as an error.
+ *
+ * SECTION: Actions and Subroutines/panic()
+ *
+ */
+
+
+BEGIN
+{
+ panic("badarg");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.progenyofbad2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.progenyofbad2.d
new file mode 100644
index 000000000000..51c8674defe6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.progenyofbad2.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * progenyof() should return an error if the argument is an
+ * incorrect type.
+ *
+ * SECTION: Actions and Subroutines/progenyof()
+ *
+ */
+
+
+BEGIN
+{
+ progenyof(trace());
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.stopbadarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.stopbadarg.d
new file mode 100644
index 000000000000..8b6050715878
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.stopbadarg.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * stop() should generate an error if any arguments are sent.
+ *
+ * SECTION: Actions and Subroutines/stop()
+ *
+ */
+
+
+BEGIN
+{
+ stop("badarg");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d
new file mode 100644
index 000000000000..7d9c27f902d9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ trace(tolower());
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d
new file mode 100644
index 000000000000..afaa7f976ed6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolowertoomany.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ trace(tolower("dory", "eel", "roughy"));
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d
new file mode 100644
index 000000000000..9658f6a75441
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ trace(toupper());
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d
new file mode 100644
index 000000000000..bee8697fb2c4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.touppertoomany.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ trace(tolower("haino", "tylo"));
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_STRINGOF_TYPE.badstringof.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_STRINGOF_TYPE.badstringof.d
new file mode 100644
index 000000000000..fec5649b5d30
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_STRINGOF_TYPE.badstringof.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * stringof() accepts a scalar, pointer, or string
+ *
+ * SECTION: Types, Operators, and Expressions/Precedence
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("%s", stringof (trace(0)));
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_VAR_UNDEF.badvar.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_VAR_UNDEF.badvar.d
new file mode 100644
index 000000000000..bb4fd2d18e97
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_VAR_UNDEF.badvar.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * +=, -= must handle invalid variables.
+ *
+ * SECTION: Types, Operators, and Expressions/Assignment Operators
+ *
+ */
+
+
+BEGIN
+{
+ p -= trace(0);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badalloca.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badalloca.d
new file mode 100644
index 000000000000..572daa39fec0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badalloca.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * memory allocated by alloca() is only valid within the clause
+ * it is allocated.
+ *
+ * SECTION: Actions and Subroutines/alloca()
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ ptr = alloca(sizeof (int));
+}
+
+tick-1
+{
+ bcopy((void *)&`kmem_flags, ptr, sizeof (int));
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badalloca2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badalloca2.d
new file mode 100644
index 000000000000..fbbf8e2e0503
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badalloca2.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * alloca() cannot be used to "unconsume" scratch space memory by
+ * accepting a negative offset.
+ *
+ * SECTION: Actions and Subroutines/alloca()
+ *
+ */
+
+BEGIN
+{
+ ptr = alloca(10);
+ ptr = alloca(0xffffffffffffffff);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy.d
new file mode 100644
index 000000000000..d7184b0f42b4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * bcopy should not allow a copy to memory that is not scratch memory.
+ *
+ * SECTION: Actions and Subroutines/alloca();
+ * Actions and Subroutines/bcopy()
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ ptr = alloca(sizeof (int));
+
+ /* Attempt a copy from scratch memory to a kernel address */
+
+ bcopy(ptr, (void *)&`kmem_flags, sizeof (int));
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy1.d
new file mode 100644
index 000000000000..c29eb2bb8139
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy1.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * bcopy should not copy from one memory location to another
+ * if the memory is not properly allocated
+ *
+ * SECTION: Actions and Subroutines/alloca();
+ * Actions and Subroutines/bcopy()
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ ptr = alloca(0);
+
+ /* Attempt to bcopy to scratch memory that isn't allocated */
+ bcopy((void *)&`kmem_flags, ptr, sizeof (int));
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy2.d
new file mode 100644
index 000000000000..6d49e6ec5ff6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy2.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * bcopy should not copy from one memory location to another
+ * if the memory is not properly allocated
+ *
+ * SECTION: Actions and Subroutines/bcopy()
+ *
+ */
+
+#pragma D option quiet
+
+int *ptr;
+
+BEGIN
+{
+ /* Attempt to copy to non-scratch memory */
+
+ bcopy((void *)&`kmem_flags, ptr, sizeof (int));
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy3.d
new file mode 100644
index 000000000000..c362caad574c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy3.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * bcopy should not copy from one memory location to another
+ * if the memory is not properly allocated
+ *
+ * SECTION: Actions and Subroutines/bcopy()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ /* Attempt to copy to a NULL address */
+ bcopy((void *)&`kmem_flags, (void *)NULL, sizeof (int));
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy4.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy4.d
new file mode 100644
index 000000000000..4148ae7bf311
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy4.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * bcopy should not copy from one memory location to another
+ * if the source memory location is not valid.
+ *
+ * SECTION: Actions and Subroutines/alloca();
+ * Actions and Subroutines/bcopy()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ ptr = alloca(sizeof (int));
+
+ /* Attempt to copy from a NULL address */
+ bcopy((void *)NULL, ptr, sizeof (int));
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy5.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy5.d
new file mode 100644
index 000000000000..a0cbd5d4a1f3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy5.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * bcopy should not copy from one memory location to another
+ * if the source memory location is not valid.
+ *
+ * SECTION: Actions and Subroutines/alloca();
+ * Actions and Subroutines/bcopy()
+ *
+ */
+
+#pragma D option quiet
+
+int *badptr;
+
+BEGIN
+{
+ ptr = alloca(sizeof (int));
+
+ /* Attempt to copy from a invalid address */
+ bcopy(badptr, ptr, sizeof (int));
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy6.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy6.d
new file mode 100644
index 000000000000..32770145ad6c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy6.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ bcopy("bad news", alloca(1), -1);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badchill.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badchill.d
new file mode 100644
index 000000000000..b394a88b4ca1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badchill.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ chill(200);
+ chill(((hrtime_t)1 << 63) - 1);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.chillbadarg.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.chillbadarg.ksh
new file mode 100644
index 000000000000..98f04dd20ce1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.chillbadarg.ksh
@@ -0,0 +1,69 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+# ident "%Z%%M% %I% %E% SMI"
+
+dtrace_script()
+{
+
+ $dtrace -w -s /dev/stdin <<EOF
+
+ /*
+ * ASSERTION:
+ * Verify that chill() refuses args greater than
+ * 500 milliseconds.
+ *
+ * SECTION: Actions and Subroutines/chill()
+ *
+ */
+
+ BEGIN
+ {
+ chill(500000001);
+ exit(1);
+ }
+
+ ERROR
+ {
+ exit(1)
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+dtrace_script &
+child=$!
+
+wait $child
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyout.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyout.d
new file mode 100644
index 000000000000..6b9db3b811a7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyout.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * copyout() should handle invalid args.
+ *
+ * SECTION: Actions and Subroutines/copyout()
+ *
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ i = 3;
+ copyout((void *)i, 0, 5);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyoutbadaddr.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyoutbadaddr.ksh
new file mode 100644
index 000000000000..de5c47d5c043
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyoutbadaddr.ksh
@@ -0,0 +1,71 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+# ident "%Z%%M% %I% %E% SMI"
+
+
+dtrace_script()
+{
+
+ $dtrace -w -s /dev/stdin <<EOF
+
+ /*
+ * ASSERTION:
+ * Verify that copyout() handles bad addresses.
+ *
+ * SECTION: Actions and Subroutines/copyout()
+ *
+ */
+
+ BEGIN
+ {
+ ptr = alloca(sizeof (char *));
+ copyinto(curpsinfo->pr_envp, sizeof (char *), ptr);
+ copyout(ptr, 0, sizeof (char *));
+ }
+
+ ERROR
+ {
+ exit(1)
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+dtrace_script &
+child=$!
+
+wait $child
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyoutstrbadaddr.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyoutstrbadaddr.ksh
new file mode 100644
index 000000000000..181702b8ecf0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyoutstrbadaddr.ksh
@@ -0,0 +1,70 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+# ident "%Z%%M% %I% %E% SMI"
+
+
+dtrace_script()
+{
+
+ $dtrace -w -s /dev/stdin <<EOF
+
+ /*
+ * ASSERTION:
+ * Verify that copyout() handles bad addresses.
+ *
+ * SECTION: Actions and Subroutines/copyout()
+ *
+ */
+
+ BEGIN
+ {
+ ptr = alloca(sizeof (char *));
+ copyinto(curpsinfo->pr_envp, sizeof (char *), ptr);
+ copyout(ptr, 0, sizeof (char *));
+ }
+
+ ERROR
+ {
+ exit(1)
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+dtrace_script &
+child=$!
+
+wait $child
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntoa6badaddr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntoa6badaddr.d
new file mode 100644
index 000000000000..81ce643f6b0b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntoa6badaddr.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+struct in6_addr *ip6a;
+
+BEGIN
+{
+ ip6a = 0;
+
+ printf("%s\n", inet_ntop(AF_INET6, ip6a));
+
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntoabadaddr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntoabadaddr.d
new file mode 100644
index 000000000000..3f0d8e45ff8b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntoabadaddr.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+ipaddr_t *ip4a;
+
+BEGIN
+{
+ ip4a = 0;
+
+ printf("%s\n", inet_ntoa(ip4a));
+
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadaddr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadaddr.d
new file mode 100644
index 000000000000..74ce760d8b66
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadaddr.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+ipaddr_t *ip4a;
+
+BEGIN
+{
+ ip4a = 0;
+
+ printf("%s\n", inet_ntop(AF_INET, ip4a));
+
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadarg.d
new file mode 100644
index 000000000000..2731385d2db4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadarg.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+ipaddr_t *ip4a;
+
+BEGIN
+{
+ this->buf4a = alloca(sizeof (ipaddr_t));
+ ip4a = this->buf4a;
+ *ip4a = htonl(0xc0a80117);
+
+ printf("%s\n", inet_ntop(-1, ip4a));
+
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh
new file mode 100644
index 000000000000..72f6b87f8115
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh
@@ -0,0 +1,102 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -wq -o $tmpfile -s /dev/stdin 2> $errfile <<EOF
+ BEGIN
+ {
+ /*
+ * All of these should fail...
+ */
+ freopen("..");
+ freopen("%s", ".");
+ freopen("%c%c", '.', '.');
+ freopen("%c", '.');
+
+ /*
+ * ...so stdout should still be open here.
+ */
+ printf("%d", ++i);
+
+ freopen("%s%s", ".", ".");
+ freopen("%s%s", ".", ".");
+
+ printf("%d", ++i);
+ }
+
+ BEGIN
+ /i == 2/
+ {
+ /*
+ * ...and here.
+ */
+ printf("%d\n", ++i);
+ exit(0);
+ }
+
+ BEGIN
+ {
+ exit(1);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+tmpfile=/tmp/tst.badfreopen.$$
+errfile=/tmp/tst.badfreopen.$$.stderr
+
+script
+status=$?
+
+if [ "$status" -eq 0 ]; then
+ i=`cat $tmpfile`
+
+ if [[ $i != "123" ]]; then
+ echo "$0: unexpected contents in $tmpfile: " \
+ "expected 123, found $i"
+ status=100
+ fi
+
+ i=`wc -l $errfile | nawk '{ print $1 }'`
+
+ if [ "$i" -lt 6 ]; then
+ echo "$0: expected at least 6 lines of stderr, found $i lines"
+ status=101
+ fi
+else
+ cat $errfile > /dev/fd/2
+fi
+
+rm $tmpfile $errfile
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d
new file mode 100644
index 000000000000..6fb996c96181
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d
@@ -0,0 +1,87 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+/*
+ * This test verifies that the basename() and dirname() functions are working
+ * properly. Note that the output of this is a ksh script. When run,
+ * it will give no output if the output is correct.
+ */
+BEGIN
+{
+ dir[i++] = "/foo/bar/baz";
+ dir[i++] = "/foo/bar///baz/";
+ dir[i++] = "/foo/bar/baz/";
+ dir[i++] = "/foo/bar/baz//";
+ dir[i++] = "/foo/bar/baz/.";
+ dir[i++] = "/foo/bar/baz/./";
+ dir[i++] = "/foo/bar/baz/.//";
+ dir[i++] = "foo/bar/baz/";
+ dir[i++] = "/";
+ dir[i++] = "./";
+ dir[i++] = "//";
+ dir[i++] = "/.";
+ dir[i++] = "/./";
+ dir[i++] = "/./.";
+ dir[i++] = "/.//";
+ dir[i++] = ".";
+ dir[i++] = "f";
+ dir[i++] = "f/";
+ dir[i++] = "/////";
+ dir[i++] = "";
+
+ end = i;
+ i = 0;
+
+ printf("#!/usr/bin/ksh\n\n");
+}
+
+tick-1ms
+/i < end/
+{
+ printf("if [ `basename \"%s\"` != \"%s\" ]; then\n",
+ dir[i], basename(dir[i]));
+ printf(" echo \"basename(\\\"%s\\\") is \\\"%s\\\"; ",
+ dir[i], basename(dir[i]));
+ printf("expected \\\"`basename \"%s\"`\"\\\"\n", dir[i]);
+ printf("fi\n\n");
+ printf("if [ `dirname \"%s\"` != \"%s\" ]; then\n",
+ dir[i], dirname(dir[i]));
+ printf(" echo \"dirname(\\\"%s\\\") is \\\"%s\\\"; ",
+ dir[i], dirname(dir[i]));
+ printf("expected \\\"`dirname \"%s\"`\"\\\"\n", dir[i]);
+ printf("fi\n\n");
+ i++;
+}
+
+tick-1ms
+/i == end/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out
new file mode 100644
index 000000000000..e16541adbb03
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out
@@ -0,0 +1,163 @@
+#!/usr/bin/ksh
+
+if [ `basename "/foo/bar/baz"` != "baz" ]; then
+ echo "basename(\"/foo/bar/baz\") is \"baz\"; expected \"`basename "/foo/bar/baz"`"\"
+fi
+
+if [ `dirname "/foo/bar/baz"` != "/foo/bar" ]; then
+ echo "dirname(\"/foo/bar/baz\") is \"/foo/bar\"; expected \"`dirname "/foo/bar/baz"`"\"
+fi
+
+if [ `basename "/foo/bar///baz/"` != "baz" ]; then
+ echo "basename(\"/foo/bar///baz/\") is \"baz\"; expected \"`basename "/foo/bar///baz/"`"\"
+fi
+
+if [ `dirname "/foo/bar///baz/"` != "/foo/bar" ]; then
+ echo "dirname(\"/foo/bar///baz/\") is \"/foo/bar\"; expected \"`dirname "/foo/bar///baz/"`"\"
+fi
+
+if [ `basename "/foo/bar/baz/"` != "baz" ]; then
+ echo "basename(\"/foo/bar/baz/\") is \"baz\"; expected \"`basename "/foo/bar/baz/"`"\"
+fi
+
+if [ `dirname "/foo/bar/baz/"` != "/foo/bar" ]; then
+ echo "dirname(\"/foo/bar/baz/\") is \"/foo/bar\"; expected \"`dirname "/foo/bar/baz/"`"\"
+fi
+
+if [ `basename "/foo/bar/baz//"` != "baz" ]; then
+ echo "basename(\"/foo/bar/baz//\") is \"baz\"; expected \"`basename "/foo/bar/baz//"`"\"
+fi
+
+if [ `dirname "/foo/bar/baz//"` != "/foo/bar" ]; then
+ echo "dirname(\"/foo/bar/baz//\") is \"/foo/bar\"; expected \"`dirname "/foo/bar/baz//"`"\"
+fi
+
+if [ `basename "/foo/bar/baz/."` != "." ]; then
+ echo "basename(\"/foo/bar/baz/.\") is \".\"; expected \"`basename "/foo/bar/baz/."`"\"
+fi
+
+if [ `dirname "/foo/bar/baz/."` != "/foo/bar/baz" ]; then
+ echo "dirname(\"/foo/bar/baz/.\") is \"/foo/bar/baz\"; expected \"`dirname "/foo/bar/baz/."`"\"
+fi
+
+if [ `basename "/foo/bar/baz/./"` != "." ]; then
+ echo "basename(\"/foo/bar/baz/./\") is \".\"; expected \"`basename "/foo/bar/baz/./"`"\"
+fi
+
+if [ `dirname "/foo/bar/baz/./"` != "/foo/bar/baz" ]; then
+ echo "dirname(\"/foo/bar/baz/./\") is \"/foo/bar/baz\"; expected \"`dirname "/foo/bar/baz/./"`"\"
+fi
+
+if [ `basename "/foo/bar/baz/.//"` != "." ]; then
+ echo "basename(\"/foo/bar/baz/.//\") is \".\"; expected \"`basename "/foo/bar/baz/.//"`"\"
+fi
+
+if [ `dirname "/foo/bar/baz/.//"` != "/foo/bar/baz" ]; then
+ echo "dirname(\"/foo/bar/baz/.//\") is \"/foo/bar/baz\"; expected \"`dirname "/foo/bar/baz/.//"`"\"
+fi
+
+if [ `basename "foo/bar/baz/"` != "baz" ]; then
+ echo "basename(\"foo/bar/baz/\") is \"baz\"; expected \"`basename "foo/bar/baz/"`"\"
+fi
+
+if [ `dirname "foo/bar/baz/"` != "foo/bar" ]; then
+ echo "dirname(\"foo/bar/baz/\") is \"foo/bar\"; expected \"`dirname "foo/bar/baz/"`"\"
+fi
+
+if [ `basename "/"` != "/" ]; then
+ echo "basename(\"/\") is \"/\"; expected \"`basename "/"`"\"
+fi
+
+if [ `dirname "/"` != "/" ]; then
+ echo "dirname(\"/\") is \"/\"; expected \"`dirname "/"`"\"
+fi
+
+if [ `basename "./"` != "." ]; then
+ echo "basename(\"./\") is \".\"; expected \"`basename "./"`"\"
+fi
+
+if [ `dirname "./"` != "." ]; then
+ echo "dirname(\"./\") is \".\"; expected \"`dirname "./"`"\"
+fi
+
+if [ `basename "//"` != "/" ]; then
+ echo "basename(\"//\") is \"/\"; expected \"`basename "//"`"\"
+fi
+
+if [ `dirname "//"` != "/" ]; then
+ echo "dirname(\"//\") is \"/\"; expected \"`dirname "//"`"\"
+fi
+
+if [ `basename "/."` != "." ]; then
+ echo "basename(\"/.\") is \".\"; expected \"`basename "/."`"\"
+fi
+
+if [ `dirname "/."` != "/" ]; then
+ echo "dirname(\"/.\") is \"/\"; expected \"`dirname "/."`"\"
+fi
+
+if [ `basename "/./"` != "." ]; then
+ echo "basename(\"/./\") is \".\"; expected \"`basename "/./"`"\"
+fi
+
+if [ `dirname "/./"` != "/" ]; then
+ echo "dirname(\"/./\") is \"/\"; expected \"`dirname "/./"`"\"
+fi
+
+if [ `basename "/./."` != "." ]; then
+ echo "basename(\"/./.\") is \".\"; expected \"`basename "/./."`"\"
+fi
+
+if [ `dirname "/./."` != "/." ]; then
+ echo "dirname(\"/./.\") is \"/.\"; expected \"`dirname "/./."`"\"
+fi
+
+if [ `basename "/.//"` != "." ]; then
+ echo "basename(\"/.//\") is \".\"; expected \"`basename "/.//"`"\"
+fi
+
+if [ `dirname "/.//"` != "/" ]; then
+ echo "dirname(\"/.//\") is \"/\"; expected \"`dirname "/.//"`"\"
+fi
+
+if [ `basename "."` != "." ]; then
+ echo "basename(\".\") is \".\"; expected \"`basename "."`"\"
+fi
+
+if [ `dirname "."` != "." ]; then
+ echo "dirname(\".\") is \".\"; expected \"`dirname "."`"\"
+fi
+
+if [ `basename "f"` != "f" ]; then
+ echo "basename(\"f\") is \"f\"; expected \"`basename "f"`"\"
+fi
+
+if [ `dirname "f"` != "." ]; then
+ echo "dirname(\"f\") is \".\"; expected \"`dirname "f"`"\"
+fi
+
+if [ `basename "f/"` != "f" ]; then
+ echo "basename(\"f/\") is \"f\"; expected \"`basename "f/"`"\"
+fi
+
+if [ `dirname "f/"` != "." ]; then
+ echo "dirname(\"f/\") is \".\"; expected \"`dirname "f/"`"\"
+fi
+
+if [ `basename "/////"` != "/" ]; then
+ echo "basename(\"/////\") is \"/\"; expected \"`basename "/////"`"\"
+fi
+
+if [ `dirname "/////"` != "/" ]; then
+ echo "dirname(\"/////\") is \"/\"; expected \"`dirname "/////"`"\"
+fi
+
+if [ `basename ""` != "." ]; then
+ echo "basename(\"\") is \".\"; expected \"`basename ""`"\"
+fi
+
+if [ `dirname ""` != "." ]; then
+ echo "dirname(\"\") is \".\"; expected \"`dirname ""`"\"
+fi
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.bcopy.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.bcopy.d
new file mode 100644
index 000000000000..8501ff441fc7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.bcopy.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * bcopy should copy from one memory location to another
+ *
+ * SECTION: Actions and Subroutines/alloca();
+ * Actions and Subroutines/bcopy()
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ ptr = alloca(sizeof (int));
+ bcopy((void *)&`kmem_flags, ptr, sizeof (int));
+ intp = (int *)ptr;
+ ret = (`kmem_flags == *intp) ? 0 : 1;
+}
+
+tick-1
+/ret == 0/
+{
+ exit(0);
+}
+
+tick-1
+/ret == 1/
+{
+ printf("memory address contained 0x%x, expected 0x%x\n",
+ *intp, `kmem_flags);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.chill.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.chill.ksh
new file mode 100644
index 000000000000..aae1c6881b4d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.chill.ksh
@@ -0,0 +1,77 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+dtrace_script()
+{
+
+ $dtrace -w -s /dev/stdin <<EOF
+
+ /*
+ * ASSERTION:
+ * Positive test of chill()
+ *
+ * SECTION: Actions and Subroutines/chill()
+ *
+ * NOTES: This test does no verification - it's not possible. So,
+ * we just run this and make sure it runs.
+ */
+
+ BEGIN
+ {
+ i = 0;
+ }
+
+ syscall:::entry
+ /i <= 5/
+ {
+ chill(100000000);
+ i++;
+ }
+
+ syscall:::entry
+ /i > 5/
+ {
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+dtrace_script &
+child=$!
+
+wait $child
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d
new file mode 100644
index 000000000000..2f0541853a53
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d
@@ -0,0 +1,70 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ path[i++] = "/foo/bar/baz";
+ path[i++] = "/foo/bar///baz/";
+ path[i++] = "/foo/bar/baz/";
+ path[i++] = "/foo/bar/baz//";
+ path[i++] = "/foo/bar/baz/.";
+ path[i++] = "/foo/bar/baz/./";
+ path[i++] = "/foo/bar/../../baz/.//";
+ path[i++] = "foo/bar/./././././baz/";
+ path[i++] = "/foo/bar/baz/../../../../../../";
+ path[i++] = "/../../../../../../";
+ path[i++] = "/./";
+ path[i++] = "/foo/bar/baz/../../bop/bang/../../bar/baz/";
+ path[i++] = "./";
+ path[i++] = "//";
+ path[i++] = "/.";
+ path[i++] = "/./";
+ path[i++] = "/./.";
+ path[i++] = "/.//";
+ path[i++] = ".";
+ path[i++] = "/////";
+ path[i++] = "";
+
+ end = i;
+ i = 0;
+}
+
+tick-1ms
+/i < end/
+{
+ printf("cleanpath(\"%s\") = \"%s\"\n", path[i], cleanpath(path[i]));
+ i++;
+}
+
+tick-1ms
+/i == end/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d.out
new file mode 100644
index 000000000000..b8bdc0991e27
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d.out
@@ -0,0 +1,22 @@
+cleanpath("/foo/bar/baz") = "/foo/bar/baz"
+cleanpath("/foo/bar///baz/") = "/foo/bar/baz/"
+cleanpath("/foo/bar/baz/") = "/foo/bar/baz/"
+cleanpath("/foo/bar/baz//") = "/foo/bar/baz/"
+cleanpath("/foo/bar/baz/.") = "/foo/bar/baz/."
+cleanpath("/foo/bar/baz/./") = "/foo/bar/baz/"
+cleanpath("/foo/bar/../../baz/.//") = "/baz/"
+cleanpath("foo/bar/./././././baz/") = "foo/bar/baz/"
+cleanpath("/foo/bar/baz/../../../../../../") = "/"
+cleanpath("/../../../../../../") = "/"
+cleanpath("/./") = "/"
+cleanpath("/foo/bar/baz/../../bop/bang/../../bar/baz/") = "/foo/bar/baz/"
+cleanpath("./") = "./"
+cleanpath("//") = "/"
+cleanpath("/.") = "/."
+cleanpath("/./") = "/"
+cleanpath("/./.") = "/."
+cleanpath("/.//") = "/"
+cleanpath(".") = "."
+cleanpath("/////") = "/"
+cleanpath("") = ""
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.copyin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.copyin.d
new file mode 100644
index 000000000000..186b97419e82
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.copyin.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * This D ditty tests the ability to perform both copyin and copyinstr. We
+ * grab the value or pr_envp, read the first pointer from the user stack,
+ * and then copyinstr the first environment variable and print it.
+ *
+ * SECTION: Actions and Subroutines/copyin();
+ * Actions and Subroutines/copyinstr();
+ * User Process Tracing/copyin() and copyinstr()
+ */
+
+BEGIN
+/curpsinfo->pr_dmodel == PR_MODEL_ILP32/
+{
+ envp = *(uint32_t *)copyin(curpsinfo->pr_envp, sizeof (uint32_t));
+ printf("envp[0] = \"%s\"", copyinstr(envp));
+ exit(0);
+}
+
+BEGIN
+/curpsinfo->pr_dmodel == PR_MODEL_LP64/
+{
+ envp = *(uint64_t *)copyin(curpsinfo->pr_envp, sizeof (uint64_t));
+ printf("envp[0] = \"%s\"", copyinstr(envp));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.copyinto.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.copyinto.d
new file mode 100644
index 000000000000..c282e61dec47
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.copyinto.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * test copyinto by copying the first string of the user's
+ * environment.
+ *
+ * SECTION: Actions and Subroutines/copyinto()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+/curpsinfo->pr_dmodel == PR_MODEL_ILP32/
+{
+ envp = alloca(sizeof (uint32_t));
+ copyinto(curpsinfo->pr_envp, sizeof (uint32_t), envp);
+ printf("envp[0] = \"%s\"", copyinstr(*(uint32_t *)envp));
+ exit(0);
+}
+
+BEGIN
+/curpsinfo->pr_dmodel == PR_MODEL_LP64/
+{
+ envp = alloca(sizeof (uint64_t));
+ copyinto(curpsinfo->pr_envp, sizeof (uint64_t), envp);
+ printf("envp[0] = \"%s\"", copyinstr(*(uint64_t *)envp));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ddi_pathname.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ddi_pathname.d
new file mode 100644
index 000000000000..3716d0cef3ea
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ddi_pathname.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ this->dev = (struct dev_info *)alloca(sizeof (struct dev_info));
+ this->minor1 =
+ (struct ddi_minor_data *)alloca(sizeof (struct ddi_minor_data));
+ this->minor2 =
+ (struct ddi_minor_data *)alloca(sizeof (struct ddi_minor_data));
+ this->minor3 =
+ (struct ddi_minor_data *)alloca(sizeof (struct ddi_minor_data));
+
+ this->minor1->d_minor.dev = 0;
+ this->minor1->next = this->minor2;
+
+ this->minor2->d_minor.dev = 0;
+ this->minor2->next = this->minor3;
+
+ this->minor3->d_minor.dev = 0;
+ this->minor3->next = this->minor1;
+
+ this->dev->devi_minor = this->minor1;
+ trace(ddi_pathname(this->dev, 1));
+}
+
+ERROR
+/arg4 == DTRACEFLT_ILLOP/
+{
+ exit(0);
+}
+
+ERROR
+/arg4 != DTRACEFLT_ILLOP/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.default.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.default.d
new file mode 100644
index 000000000000..c4a4e4f3b343
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.default.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Verify that empty clauses are OK.
+ *
+ * SECTION: Actions and Subroutines/Default Action
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 1;
+
+}
+
+syscall:::entry
+{
+
+
+}
+
+tick-1
+/i != 0/
+{
+ exit(0);
+}
+
+
+END
+{
+
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.freopen.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.freopen.ksh
new file mode 100644
index 000000000000..f87d6e18fae5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.freopen.ksh
@@ -0,0 +1,111 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -wq -o $tmpfile -s /dev/stdin $tmpfile <<EOF
+ BEGIN
+ {
+ i = 0;
+ }
+
+ tick-10ms
+ {
+ freopen("%s.%d", \$\$1, i);
+ printf("%d\n", i)
+ }
+
+ tick-10ms
+ /++i == $iter/
+ {
+ freopen("");
+ printf("%d\n", i);
+ exit(0);
+ }
+EOF
+}
+
+cleanup()
+{
+ let i=0
+
+ if [ -f $tmpfile ]; then
+ rm $tmpfile
+ fi
+
+ while [ "$i" -lt "$iter" ]; do
+ if [ -f $tmpfile.$i ]; then
+ rm $tmpfile.$i
+ fi
+ let i=i+1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+tmpfile=/tmp/tst.freopen.$$
+iter=20
+
+script
+status=$?
+
+let i=0
+
+if [ -f $tmpfile.$iter ]; then
+ echo "$0: did not expect to find file: $tmpfile.$iter"
+ cleanup
+ exit 100
+fi
+
+mv $tmpfile $tmpfile.$iter
+let iter=iter+1
+
+while [ "$i" -lt "$iter" ]; do
+ if [ ! -f $tmpfile.$i ]; then
+ echo "$0: did not find expected file: $tmpfile.$i"
+ cleanup
+ exit 101
+ fi
+
+ j=`cat $tmpfile.$i`
+
+ if [ "$i" -ne "$j" ]; then
+ echo "$0: unexpected contents in $tmpfile.$i: " \
+ "expected $i, found $j"
+ cleanup
+ exit 102
+ fi
+
+ rm $tmpfile.$i
+ let i=i+1
+done
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh
new file mode 100644
index 000000000000..b02af07b4a69
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh
@@ -0,0 +1,64 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -q -o $tmpfile -s /dev/stdin <<EOF
+ tick-10ms
+ {
+ printf("%d\n", i++);
+ }
+
+ tick-10ms
+ /i == 10/
+ {
+ ftruncate();
+ }
+
+ tick-10ms
+ /i == 20/
+ {
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+tmpfile=/tmp/tst.ftruncate.$$
+
+script
+status=$?
+
+cat $tmpfile
+rm $tmpfile
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh.out
new file mode 100644
index 000000000000..3360fd26d24b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh.out
@@ -0,0 +1,11 @@
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.hton.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.hton.d
new file mode 100644
index 000000000000..4908251a68e0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.hton.d
@@ -0,0 +1,99 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test network byte-ordering routines.
+ */
+
+#if defined(__amd64__) || defined(__i386__)
+#define _LITTLE_ENDIAN
+#endif
+
+BEGIN
+{
+ before[0] = 0x1122LL;
+ before[1] = 0x11223344LL;
+ before[2] = 0x1122334455667788LL;
+
+#ifdef _LITTLE_ENDIAN
+ after[0] = 0x2211LL;
+ after[1] = 0x44332211LL;
+ after[2] = 0x8877665544332211LL;
+#else
+ after[0] = 0x1122LL;
+ after[1] = 0x11223344LL;
+ after[2] = 0x1122334455667788LL;
+#endif
+}
+
+BEGIN
+/after[0] != htons(before[0])/
+{
+ printf("%x rather than %x", htons(before[0]), after[0]);
+ exit(1);
+}
+
+BEGIN
+/after[0] != ntohs(before[0])/
+{
+ printf("%x rather than %x", ntohs(before[0]), after[0]);
+ exit(1);
+}
+
+BEGIN
+/after[1] != htonl(before[1])/
+{
+ printf("%x rather than %x", htonl(before[1]), after[1]);
+ exit(1);
+}
+
+BEGIN
+/after[1] != ntohl(before[1])/
+{
+ printf("%x rather than %x", ntohl(before[1]), after[1]);
+ exit(1);
+}
+
+BEGIN
+/after[2] != htonll(before[2])/
+{
+ printf("%x rather than %x", htonll(before[2]), after[2]);
+ exit(1);
+}
+
+BEGIN
+/after[2] != ntohll(before[2])/
+{
+ printf("%x rather than %x", ntohll(before[2]), after[2]);
+ exit(1);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d
new file mode 100644
index 000000000000..1ec96978ab18
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d
@@ -0,0 +1,226 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+struct {
+ string str;
+ string substr;
+ int haspos;
+ int position;
+} command[int];
+
+int i;
+
+BEGIN
+{
+ command[i].str = "foobarbaz";
+ command[i].substr = "barbaz";
+ i++;
+
+ command[i].str = "foofoofoo";
+ command[i].substr = "foo";
+ i++;
+
+ command[i].str = "boofoofoo";
+ command[i].substr = "foo";
+ i++;
+
+ command[i].str = "foobarbaz";
+ command[i].substr = "barbazzy";
+ i++;
+
+ command[i].str = "foobar";
+ command[i].substr = "foobar";
+ i++;
+
+ command[i].str = "foobar";
+ command[i].substr = "foobarbaz";
+ i++;
+
+ command[i].str = "";
+ command[i].substr = "foobar";
+ i++;
+
+ command[i].str = "foobar";
+ command[i].substr = "";
+ i++;
+
+ command[i].str = "";
+ command[i].substr = "";
+ i++;
+
+ command[i].str = "foo";
+ command[i].substr = "";
+ i++;
+
+ end = j = k = 0;
+ printf("#!/usr/bin/perl\n\nBEGIN {\n");
+}
+
+tick-1ms
+/j < i && end == 0/
+{
+ command[i + k].str = command[j].str;
+ command[i + k].substr = command[j].substr;
+ command[i + k].haspos = 1;
+ command[i + k].position = -400;
+ k++;
+
+ command[i + k].str = command[j].str;
+ command[i + k].substr = command[j].substr;
+ command[i + k].haspos = 1;
+ command[i + k].position = -1;
+ k++;
+
+ command[i + k].str = command[j].str;
+ command[i + k].substr = command[j].substr;
+ command[i + k].haspos = 1;
+ command[i + k].position = 0;
+ k++;
+
+ command[i + k].str = command[j].str;
+ command[i + k].substr = command[j].substr;
+ command[i + k].haspos = 1;
+ command[i + k].position = strlen(command[j].str) / 2;
+ k++;
+
+ command[i + k].str = command[j].str;
+ command[i + k].substr = command[j].substr;
+ command[i + k].haspos = 1;
+ command[i + k].position = strlen(command[j].str);
+ k++;
+
+ command[i + k].str = command[j].str;
+ command[i + k].substr = command[j].substr;
+ command[i + k].haspos = 1;
+ command[i + k].position = strlen(command[j].str) + 1;
+ k++;
+
+ command[i + k].str = command[j].str;
+ command[i + k].substr = command[j].substr;
+ command[i + k].haspos = 1;
+ command[i + k].position = strlen(command[j].str) + 2;
+ k++;
+
+ command[i + k].str = command[j].str;
+ command[i + k].substr = command[j].substr;
+ command[i + k].haspos = 1;
+ command[i + k].position = 400;
+ k++;
+
+ j++;
+}
+
+tick-1ms
+/j == i && end == 0/
+{
+ end = k;
+ i = 0;
+}
+
+tick-1ms
+/end != 0 && i < end && !command[i].haspos/
+{
+ this->result = index(command[i].str, command[i].substr);
+
+ printf("\tif (index(\"%s\", \"%s\") != %d) {\n",
+ command[i].str, command[i].substr, this->result);
+ printf("\t\tprintf(\"perl => index(\\\"%s\\\", \\\"%s\\\") = ",
+ command[i].str, command[i].substr);
+ printf("%%d\\n\",\n\t\t index(\"%s\", \"%s\"));\n",
+ command[i].str, command[i].substr);
+ printf("\t\tprintf(\" D => index(\\\"%s\\\", \\\"%s\\\") = ",
+ command[i].str, command[i].substr);
+ printf("%d\\n\");\n", this->result);
+ printf("\t\t$failed++;\n");
+ printf("\t}\n\n");
+}
+
+tick-1ms
+/end != 0 && i < end && !command[i].haspos/
+{
+ this->result = rindex(command[i].str, command[i].substr);
+
+ printf("\tif (rindex(\"%s\", \"%s\") != %d) {\n",
+ command[i].str, command[i].substr, this->result);
+ printf("\t\tprintf(\"perl => rindex(\\\"%s\\\", \\\"%s\\\") = ",
+ command[i].str, command[i].substr);
+ printf("%%d\\n\",\n\t\t rindex(\"%s\", \"%s\"));\n",
+ command[i].str, command[i].substr);
+ printf("\t\tprintf(\" D => rindex(\\\"%s\\\", \\\"%s\\\") = ",
+ command[i].str, command[i].substr);
+ printf("%d\\n\");\n", this->result);
+ printf("\t\t$failed++;\n");
+ printf("\t}\n\n");
+}
+
+tick-1ms
+/end != 0 && i < end && command[i].haspos/
+{
+ this->result = index(command[i].str,
+ command[i].substr, command[i].position);
+
+ printf("\tif (index(\"%s\", \"%s\", %d) != %d) {\n", command[i].str,
+ command[i].substr, command[i].position, this->result);
+ printf("\t\tprintf(\"perl => index(\\\"%s\\\", \\\"%s\\\", %d) = ",
+ command[i].str, command[i].substr, command[i].position);
+ printf("%%d\\n\",\n\t\t index(\"%s\", \"%s\", %d));\n",
+ command[i].str, command[i].substr, command[i].position);
+ printf("\t\tprintf(\" D => index(\\\"%s\\\", \\\"%s\\\", %d) = ",
+ command[i].str, command[i].substr, command[i].position);
+ printf("%d\\n\");\n", this->result);
+ printf("\t\t$failed++;\n");
+ printf("\t}\n\n");
+}
+
+tick-1ms
+/end != 0 && i < end && command[i].haspos/
+{
+ this->result = rindex(command[i].str,
+ command[i].substr, command[i].position);
+
+ printf("\tif (rindex(\"%s\", \"%s\", %d) != %d) {\n", command[i].str,
+ command[i].substr, command[i].position, this->result);
+ printf("\t\tprintf(\"perl => rindex(\\\"%s\\\", \\\"%s\\\", %d) = ",
+ command[i].str, command[i].substr, command[i].position);
+ printf("%%d\\n\",\n\t\t rindex(\"%s\", \"%s\", %d));\n",
+ command[i].str, command[i].substr, command[i].position);
+ printf("\t\tprintf(\" D => rindex(\\\"%s\\\", \\\"%s\\\", %d) = ",
+ command[i].str, command[i].substr, command[i].position);
+ printf("%d\\n\");\n", this->result);
+ printf("\t\t$failed++;\n");
+ printf("\t}\n\n");
+}
+
+tick-1ms
+/end != 0 && ++i == end/
+{
+ printf("\texit($failed);\n}\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d.out
new file mode 100644
index 000000000000..276576c26f7c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d.out
@@ -0,0 +1,1126 @@
+#!/usr/perl5/bin/perl
+
+BEGIN {
+ if (index("foobarbaz", "barbaz") != 3) {
+ printf("perl => index(\"foobarbaz\", \"barbaz\") = %d\n",
+ index("foobarbaz", "barbaz"));
+ printf(" D => index(\"foobarbaz\", \"barbaz\") = 3\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbaz") != 3) {
+ printf("perl => rindex(\"foobarbaz\", \"barbaz\") = %d\n",
+ rindex("foobarbaz", "barbaz"));
+ printf(" D => rindex(\"foobarbaz\", \"barbaz\") = 3\n");
+ $failed++;
+ }
+
+ if (index("foofoofoo", "foo") != 0) {
+ printf("perl => index(\"foofoofoo\", \"foo\") = %d\n",
+ index("foofoofoo", "foo"));
+ printf(" D => index(\"foofoofoo\", \"foo\") = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foofoofoo", "foo") != 6) {
+ printf("perl => rindex(\"foofoofoo\", \"foo\") = %d\n",
+ rindex("foofoofoo", "foo"));
+ printf(" D => rindex(\"foofoofoo\", \"foo\") = 6\n");
+ $failed++;
+ }
+
+ if (index("boofoofoo", "foo") != 3) {
+ printf("perl => index(\"boofoofoo\", \"foo\") = %d\n",
+ index("boofoofoo", "foo"));
+ printf(" D => index(\"boofoofoo\", \"foo\") = 3\n");
+ $failed++;
+ }
+
+ if (rindex("boofoofoo", "foo") != 6) {
+ printf("perl => rindex(\"boofoofoo\", \"foo\") = %d\n",
+ rindex("boofoofoo", "foo"));
+ printf(" D => rindex(\"boofoofoo\", \"foo\") = 6\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbazzy") != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbazzy\") = %d\n",
+ index("foobarbaz", "barbazzy"));
+ printf(" D => index(\"foobarbaz\", \"barbazzy\") = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbazzy") != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbazzy\") = %d\n",
+ rindex("foobarbaz", "barbazzy"));
+ printf(" D => rindex(\"foobarbaz\", \"barbazzy\") = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobar") != 0) {
+ printf("perl => index(\"foobar\", \"foobar\") = %d\n",
+ index("foobar", "foobar"));
+ printf(" D => index(\"foobar\", \"foobar\") = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobar") != 0) {
+ printf("perl => rindex(\"foobar\", \"foobar\") = %d\n",
+ rindex("foobar", "foobar"));
+ printf(" D => rindex(\"foobar\", \"foobar\") = 0\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobarbaz") != -1) {
+ printf("perl => index(\"foobar\", \"foobarbaz\") = %d\n",
+ index("foobar", "foobarbaz"));
+ printf(" D => index(\"foobar\", \"foobarbaz\") = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobarbaz") != -1) {
+ printf("perl => rindex(\"foobar\", \"foobarbaz\") = %d\n",
+ rindex("foobar", "foobarbaz"));
+ printf(" D => rindex(\"foobar\", \"foobarbaz\") = -1\n");
+ $failed++;
+ }
+
+ if (index("", "foobar") != -1) {
+ printf("perl => index(\"\", \"foobar\") = %d\n",
+ index("", "foobar"));
+ printf(" D => index(\"\", \"foobar\") = -1\n");
+ $failed++;
+ }
+
+ if (rindex("", "foobar") != -1) {
+ printf("perl => rindex(\"\", \"foobar\") = %d\n",
+ rindex("", "foobar"));
+ printf(" D => rindex(\"\", \"foobar\") = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "") != 0) {
+ printf("perl => index(\"foobar\", \"\") = %d\n",
+ index("foobar", ""));
+ printf(" D => index(\"foobar\", \"\") = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "") != 6) {
+ printf("perl => rindex(\"foobar\", \"\") = %d\n",
+ rindex("foobar", ""));
+ printf(" D => rindex(\"foobar\", \"\") = 6\n");
+ $failed++;
+ }
+
+ if (index("", "") != 0) {
+ printf("perl => index(\"\", \"\") = %d\n",
+ index("", ""));
+ printf(" D => index(\"\", \"\") = 0\n");
+ $failed++;
+ }
+
+ if (rindex("", "") != 0) {
+ printf("perl => rindex(\"\", \"\") = %d\n",
+ rindex("", ""));
+ printf(" D => rindex(\"\", \"\") = 0\n");
+ $failed++;
+ }
+
+ if (index("foo", "") != 0) {
+ printf("perl => index(\"foo\", \"\") = %d\n",
+ index("foo", ""));
+ printf(" D => index(\"foo\", \"\") = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foo", "") != 3) {
+ printf("perl => rindex(\"foo\", \"\") = %d\n",
+ rindex("foo", ""));
+ printf(" D => rindex(\"foo\", \"\") = 3\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbaz", -400) != 3) {
+ printf("perl => index(\"foobarbaz\", \"barbaz\", -400) = %d\n",
+ index("foobarbaz", "barbaz", -400));
+ printf(" D => index(\"foobarbaz\", \"barbaz\", -400) = 3\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbaz", -400) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbaz\", -400) = %d\n",
+ rindex("foobarbaz", "barbaz", -400));
+ printf(" D => rindex(\"foobarbaz\", \"barbaz\", -400) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbaz", -1) != 3) {
+ printf("perl => index(\"foobarbaz\", \"barbaz\", -1) = %d\n",
+ index("foobarbaz", "barbaz", -1));
+ printf(" D => index(\"foobarbaz\", \"barbaz\", -1) = 3\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbaz", -1) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbaz\", -1) = %d\n",
+ rindex("foobarbaz", "barbaz", -1));
+ printf(" D => rindex(\"foobarbaz\", \"barbaz\", -1) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbaz", 0) != 3) {
+ printf("perl => index(\"foobarbaz\", \"barbaz\", 0) = %d\n",
+ index("foobarbaz", "barbaz", 0));
+ printf(" D => index(\"foobarbaz\", \"barbaz\", 0) = 3\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbaz", 0) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbaz\", 0) = %d\n",
+ rindex("foobarbaz", "barbaz", 0));
+ printf(" D => rindex(\"foobarbaz\", \"barbaz\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbaz", 4) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbaz\", 4) = %d\n",
+ index("foobarbaz", "barbaz", 4));
+ printf(" D => index(\"foobarbaz\", \"barbaz\", 4) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbaz", 4) != 3) {
+ printf("perl => rindex(\"foobarbaz\", \"barbaz\", 4) = %d\n",
+ rindex("foobarbaz", "barbaz", 4));
+ printf(" D => rindex(\"foobarbaz\", \"barbaz\", 4) = 3\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbaz", 9) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbaz\", 9) = %d\n",
+ index("foobarbaz", "barbaz", 9));
+ printf(" D => index(\"foobarbaz\", \"barbaz\", 9) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbaz", 9) != 3) {
+ printf("perl => rindex(\"foobarbaz\", \"barbaz\", 9) = %d\n",
+ rindex("foobarbaz", "barbaz", 9));
+ printf(" D => rindex(\"foobarbaz\", \"barbaz\", 9) = 3\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbaz", 10) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbaz\", 10) = %d\n",
+ index("foobarbaz", "barbaz", 10));
+ printf(" D => index(\"foobarbaz\", \"barbaz\", 10) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbaz", 10) != 3) {
+ printf("perl => rindex(\"foobarbaz\", \"barbaz\", 10) = %d\n",
+ rindex("foobarbaz", "barbaz", 10));
+ printf(" D => rindex(\"foobarbaz\", \"barbaz\", 10) = 3\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbaz", 11) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbaz\", 11) = %d\n",
+ index("foobarbaz", "barbaz", 11));
+ printf(" D => index(\"foobarbaz\", \"barbaz\", 11) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbaz", 11) != 3) {
+ printf("perl => rindex(\"foobarbaz\", \"barbaz\", 11) = %d\n",
+ rindex("foobarbaz", "barbaz", 11));
+ printf(" D => rindex(\"foobarbaz\", \"barbaz\", 11) = 3\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbaz", 400) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbaz\", 400) = %d\n",
+ index("foobarbaz", "barbaz", 400));
+ printf(" D => index(\"foobarbaz\", \"barbaz\", 400) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbaz", 400) != 3) {
+ printf("perl => rindex(\"foobarbaz\", \"barbaz\", 400) = %d\n",
+ rindex("foobarbaz", "barbaz", 400));
+ printf(" D => rindex(\"foobarbaz\", \"barbaz\", 400) = 3\n");
+ $failed++;
+ }
+
+ if (index("foofoofoo", "foo", -400) != 0) {
+ printf("perl => index(\"foofoofoo\", \"foo\", -400) = %d\n",
+ index("foofoofoo", "foo", -400));
+ printf(" D => index(\"foofoofoo\", \"foo\", -400) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foofoofoo", "foo", -400) != -1) {
+ printf("perl => rindex(\"foofoofoo\", \"foo\", -400) = %d\n",
+ rindex("foofoofoo", "foo", -400));
+ printf(" D => rindex(\"foofoofoo\", \"foo\", -400) = -1\n");
+ $failed++;
+ }
+
+ if (index("foofoofoo", "foo", -1) != 0) {
+ printf("perl => index(\"foofoofoo\", \"foo\", -1) = %d\n",
+ index("foofoofoo", "foo", -1));
+ printf(" D => index(\"foofoofoo\", \"foo\", -1) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foofoofoo", "foo", -1) != -1) {
+ printf("perl => rindex(\"foofoofoo\", \"foo\", -1) = %d\n",
+ rindex("foofoofoo", "foo", -1));
+ printf(" D => rindex(\"foofoofoo\", \"foo\", -1) = -1\n");
+ $failed++;
+ }
+
+ if (index("foofoofoo", "foo", 0) != 0) {
+ printf("perl => index(\"foofoofoo\", \"foo\", 0) = %d\n",
+ index("foofoofoo", "foo", 0));
+ printf(" D => index(\"foofoofoo\", \"foo\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foofoofoo", "foo", 0) != 0) {
+ printf("perl => rindex(\"foofoofoo\", \"foo\", 0) = %d\n",
+ rindex("foofoofoo", "foo", 0));
+ printf(" D => rindex(\"foofoofoo\", \"foo\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (index("foofoofoo", "foo", 4) != 6) {
+ printf("perl => index(\"foofoofoo\", \"foo\", 4) = %d\n",
+ index("foofoofoo", "foo", 4));
+ printf(" D => index(\"foofoofoo\", \"foo\", 4) = 6\n");
+ $failed++;
+ }
+
+ if (rindex("foofoofoo", "foo", 4) != 3) {
+ printf("perl => rindex(\"foofoofoo\", \"foo\", 4) = %d\n",
+ rindex("foofoofoo", "foo", 4));
+ printf(" D => rindex(\"foofoofoo\", \"foo\", 4) = 3\n");
+ $failed++;
+ }
+
+ if (index("foofoofoo", "foo", 9) != -1) {
+ printf("perl => index(\"foofoofoo\", \"foo\", 9) = %d\n",
+ index("foofoofoo", "foo", 9));
+ printf(" D => index(\"foofoofoo\", \"foo\", 9) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foofoofoo", "foo", 9) != 6) {
+ printf("perl => rindex(\"foofoofoo\", \"foo\", 9) = %d\n",
+ rindex("foofoofoo", "foo", 9));
+ printf(" D => rindex(\"foofoofoo\", \"foo\", 9) = 6\n");
+ $failed++;
+ }
+
+ if (index("foofoofoo", "foo", 10) != -1) {
+ printf("perl => index(\"foofoofoo\", \"foo\", 10) = %d\n",
+ index("foofoofoo", "foo", 10));
+ printf(" D => index(\"foofoofoo\", \"foo\", 10) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foofoofoo", "foo", 10) != 6) {
+ printf("perl => rindex(\"foofoofoo\", \"foo\", 10) = %d\n",
+ rindex("foofoofoo", "foo", 10));
+ printf(" D => rindex(\"foofoofoo\", \"foo\", 10) = 6\n");
+ $failed++;
+ }
+
+ if (index("foofoofoo", "foo", 11) != -1) {
+ printf("perl => index(\"foofoofoo\", \"foo\", 11) = %d\n",
+ index("foofoofoo", "foo", 11));
+ printf(" D => index(\"foofoofoo\", \"foo\", 11) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foofoofoo", "foo", 11) != 6) {
+ printf("perl => rindex(\"foofoofoo\", \"foo\", 11) = %d\n",
+ rindex("foofoofoo", "foo", 11));
+ printf(" D => rindex(\"foofoofoo\", \"foo\", 11) = 6\n");
+ $failed++;
+ }
+
+ if (index("foofoofoo", "foo", 400) != -1) {
+ printf("perl => index(\"foofoofoo\", \"foo\", 400) = %d\n",
+ index("foofoofoo", "foo", 400));
+ printf(" D => index(\"foofoofoo\", \"foo\", 400) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foofoofoo", "foo", 400) != 6) {
+ printf("perl => rindex(\"foofoofoo\", \"foo\", 400) = %d\n",
+ rindex("foofoofoo", "foo", 400));
+ printf(" D => rindex(\"foofoofoo\", \"foo\", 400) = 6\n");
+ $failed++;
+ }
+
+ if (index("boofoofoo", "foo", -400) != 3) {
+ printf("perl => index(\"boofoofoo\", \"foo\", -400) = %d\n",
+ index("boofoofoo", "foo", -400));
+ printf(" D => index(\"boofoofoo\", \"foo\", -400) = 3\n");
+ $failed++;
+ }
+
+ if (rindex("boofoofoo", "foo", -400) != -1) {
+ printf("perl => rindex(\"boofoofoo\", \"foo\", -400) = %d\n",
+ rindex("boofoofoo", "foo", -400));
+ printf(" D => rindex(\"boofoofoo\", \"foo\", -400) = -1\n");
+ $failed++;
+ }
+
+ if (index("boofoofoo", "foo", -1) != 3) {
+ printf("perl => index(\"boofoofoo\", \"foo\", -1) = %d\n",
+ index("boofoofoo", "foo", -1));
+ printf(" D => index(\"boofoofoo\", \"foo\", -1) = 3\n");
+ $failed++;
+ }
+
+ if (rindex("boofoofoo", "foo", -1) != -1) {
+ printf("perl => rindex(\"boofoofoo\", \"foo\", -1) = %d\n",
+ rindex("boofoofoo", "foo", -1));
+ printf(" D => rindex(\"boofoofoo\", \"foo\", -1) = -1\n");
+ $failed++;
+ }
+
+ if (index("boofoofoo", "foo", 0) != 3) {
+ printf("perl => index(\"boofoofoo\", \"foo\", 0) = %d\n",
+ index("boofoofoo", "foo", 0));
+ printf(" D => index(\"boofoofoo\", \"foo\", 0) = 3\n");
+ $failed++;
+ }
+
+ if (rindex("boofoofoo", "foo", 0) != -1) {
+ printf("perl => rindex(\"boofoofoo\", \"foo\", 0) = %d\n",
+ rindex("boofoofoo", "foo", 0));
+ printf(" D => rindex(\"boofoofoo\", \"foo\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (index("boofoofoo", "foo", 4) != 6) {
+ printf("perl => index(\"boofoofoo\", \"foo\", 4) = %d\n",
+ index("boofoofoo", "foo", 4));
+ printf(" D => index(\"boofoofoo\", \"foo\", 4) = 6\n");
+ $failed++;
+ }
+
+ if (rindex("boofoofoo", "foo", 4) != 3) {
+ printf("perl => rindex(\"boofoofoo\", \"foo\", 4) = %d\n",
+ rindex("boofoofoo", "foo", 4));
+ printf(" D => rindex(\"boofoofoo\", \"foo\", 4) = 3\n");
+ $failed++;
+ }
+
+ if (index("boofoofoo", "foo", 9) != -1) {
+ printf("perl => index(\"boofoofoo\", \"foo\", 9) = %d\n",
+ index("boofoofoo", "foo", 9));
+ printf(" D => index(\"boofoofoo\", \"foo\", 9) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("boofoofoo", "foo", 9) != 6) {
+ printf("perl => rindex(\"boofoofoo\", \"foo\", 9) = %d\n",
+ rindex("boofoofoo", "foo", 9));
+ printf(" D => rindex(\"boofoofoo\", \"foo\", 9) = 6\n");
+ $failed++;
+ }
+
+ if (index("boofoofoo", "foo", 10) != -1) {
+ printf("perl => index(\"boofoofoo\", \"foo\", 10) = %d\n",
+ index("boofoofoo", "foo", 10));
+ printf(" D => index(\"boofoofoo\", \"foo\", 10) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("boofoofoo", "foo", 10) != 6) {
+ printf("perl => rindex(\"boofoofoo\", \"foo\", 10) = %d\n",
+ rindex("boofoofoo", "foo", 10));
+ printf(" D => rindex(\"boofoofoo\", \"foo\", 10) = 6\n");
+ $failed++;
+ }
+
+ if (index("boofoofoo", "foo", 11) != -1) {
+ printf("perl => index(\"boofoofoo\", \"foo\", 11) = %d\n",
+ index("boofoofoo", "foo", 11));
+ printf(" D => index(\"boofoofoo\", \"foo\", 11) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("boofoofoo", "foo", 11) != 6) {
+ printf("perl => rindex(\"boofoofoo\", \"foo\", 11) = %d\n",
+ rindex("boofoofoo", "foo", 11));
+ printf(" D => rindex(\"boofoofoo\", \"foo\", 11) = 6\n");
+ $failed++;
+ }
+
+ if (index("boofoofoo", "foo", 400) != -1) {
+ printf("perl => index(\"boofoofoo\", \"foo\", 400) = %d\n",
+ index("boofoofoo", "foo", 400));
+ printf(" D => index(\"boofoofoo\", \"foo\", 400) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("boofoofoo", "foo", 400) != 6) {
+ printf("perl => rindex(\"boofoofoo\", \"foo\", 400) = %d\n",
+ rindex("boofoofoo", "foo", 400));
+ printf(" D => rindex(\"boofoofoo\", \"foo\", 400) = 6\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbazzy", -400) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbazzy\", -400) = %d\n",
+ index("foobarbaz", "barbazzy", -400));
+ printf(" D => index(\"foobarbaz\", \"barbazzy\", -400) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbazzy", -400) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbazzy\", -400) = %d\n",
+ rindex("foobarbaz", "barbazzy", -400));
+ printf(" D => rindex(\"foobarbaz\", \"barbazzy\", -400) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbazzy", -1) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbazzy\", -1) = %d\n",
+ index("foobarbaz", "barbazzy", -1));
+ printf(" D => index(\"foobarbaz\", \"barbazzy\", -1) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbazzy", -1) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbazzy\", -1) = %d\n",
+ rindex("foobarbaz", "barbazzy", -1));
+ printf(" D => rindex(\"foobarbaz\", \"barbazzy\", -1) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbazzy", 0) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbazzy\", 0) = %d\n",
+ index("foobarbaz", "barbazzy", 0));
+ printf(" D => index(\"foobarbaz\", \"barbazzy\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbazzy", 0) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbazzy\", 0) = %d\n",
+ rindex("foobarbaz", "barbazzy", 0));
+ printf(" D => rindex(\"foobarbaz\", \"barbazzy\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbazzy", 4) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbazzy\", 4) = %d\n",
+ index("foobarbaz", "barbazzy", 4));
+ printf(" D => index(\"foobarbaz\", \"barbazzy\", 4) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbazzy", 4) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbazzy\", 4) = %d\n",
+ rindex("foobarbaz", "barbazzy", 4));
+ printf(" D => rindex(\"foobarbaz\", \"barbazzy\", 4) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbazzy", 9) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbazzy\", 9) = %d\n",
+ index("foobarbaz", "barbazzy", 9));
+ printf(" D => index(\"foobarbaz\", \"barbazzy\", 9) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbazzy", 9) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbazzy\", 9) = %d\n",
+ rindex("foobarbaz", "barbazzy", 9));
+ printf(" D => rindex(\"foobarbaz\", \"barbazzy\", 9) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbazzy", 10) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbazzy\", 10) = %d\n",
+ index("foobarbaz", "barbazzy", 10));
+ printf(" D => index(\"foobarbaz\", \"barbazzy\", 10) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbazzy", 10) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbazzy\", 10) = %d\n",
+ rindex("foobarbaz", "barbazzy", 10));
+ printf(" D => rindex(\"foobarbaz\", \"barbazzy\", 10) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbazzy", 11) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbazzy\", 11) = %d\n",
+ index("foobarbaz", "barbazzy", 11));
+ printf(" D => index(\"foobarbaz\", \"barbazzy\", 11) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbazzy", 11) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbazzy\", 11) = %d\n",
+ rindex("foobarbaz", "barbazzy", 11));
+ printf(" D => rindex(\"foobarbaz\", \"barbazzy\", 11) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobarbaz", "barbazzy", 400) != -1) {
+ printf("perl => index(\"foobarbaz\", \"barbazzy\", 400) = %d\n",
+ index("foobarbaz", "barbazzy", 400));
+ printf(" D => index(\"foobarbaz\", \"barbazzy\", 400) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobarbaz", "barbazzy", 400) != -1) {
+ printf("perl => rindex(\"foobarbaz\", \"barbazzy\", 400) = %d\n",
+ rindex("foobarbaz", "barbazzy", 400));
+ printf(" D => rindex(\"foobarbaz\", \"barbazzy\", 400) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobar", -400) != 0) {
+ printf("perl => index(\"foobar\", \"foobar\", -400) = %d\n",
+ index("foobar", "foobar", -400));
+ printf(" D => index(\"foobar\", \"foobar\", -400) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobar", -400) != -1) {
+ printf("perl => rindex(\"foobar\", \"foobar\", -400) = %d\n",
+ rindex("foobar", "foobar", -400));
+ printf(" D => rindex(\"foobar\", \"foobar\", -400) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobar", -1) != 0) {
+ printf("perl => index(\"foobar\", \"foobar\", -1) = %d\n",
+ index("foobar", "foobar", -1));
+ printf(" D => index(\"foobar\", \"foobar\", -1) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobar", -1) != -1) {
+ printf("perl => rindex(\"foobar\", \"foobar\", -1) = %d\n",
+ rindex("foobar", "foobar", -1));
+ printf(" D => rindex(\"foobar\", \"foobar\", -1) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobar", 0) != 0) {
+ printf("perl => index(\"foobar\", \"foobar\", 0) = %d\n",
+ index("foobar", "foobar", 0));
+ printf(" D => index(\"foobar\", \"foobar\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobar", 0) != 0) {
+ printf("perl => rindex(\"foobar\", \"foobar\", 0) = %d\n",
+ rindex("foobar", "foobar", 0));
+ printf(" D => rindex(\"foobar\", \"foobar\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobar", 3) != -1) {
+ printf("perl => index(\"foobar\", \"foobar\", 3) = %d\n",
+ index("foobar", "foobar", 3));
+ printf(" D => index(\"foobar\", \"foobar\", 3) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobar", 3) != 0) {
+ printf("perl => rindex(\"foobar\", \"foobar\", 3) = %d\n",
+ rindex("foobar", "foobar", 3));
+ printf(" D => rindex(\"foobar\", \"foobar\", 3) = 0\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobar", 6) != -1) {
+ printf("perl => index(\"foobar\", \"foobar\", 6) = %d\n",
+ index("foobar", "foobar", 6));
+ printf(" D => index(\"foobar\", \"foobar\", 6) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobar", 6) != 0) {
+ printf("perl => rindex(\"foobar\", \"foobar\", 6) = %d\n",
+ rindex("foobar", "foobar", 6));
+ printf(" D => rindex(\"foobar\", \"foobar\", 6) = 0\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobar", 7) != -1) {
+ printf("perl => index(\"foobar\", \"foobar\", 7) = %d\n",
+ index("foobar", "foobar", 7));
+ printf(" D => index(\"foobar\", \"foobar\", 7) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobar", 7) != 0) {
+ printf("perl => rindex(\"foobar\", \"foobar\", 7) = %d\n",
+ rindex("foobar", "foobar", 7));
+ printf(" D => rindex(\"foobar\", \"foobar\", 7) = 0\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobar", 8) != -1) {
+ printf("perl => index(\"foobar\", \"foobar\", 8) = %d\n",
+ index("foobar", "foobar", 8));
+ printf(" D => index(\"foobar\", \"foobar\", 8) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobar", 8) != 0) {
+ printf("perl => rindex(\"foobar\", \"foobar\", 8) = %d\n",
+ rindex("foobar", "foobar", 8));
+ printf(" D => rindex(\"foobar\", \"foobar\", 8) = 0\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobar", 400) != -1) {
+ printf("perl => index(\"foobar\", \"foobar\", 400) = %d\n",
+ index("foobar", "foobar", 400));
+ printf(" D => index(\"foobar\", \"foobar\", 400) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobar", 400) != 0) {
+ printf("perl => rindex(\"foobar\", \"foobar\", 400) = %d\n",
+ rindex("foobar", "foobar", 400));
+ printf(" D => rindex(\"foobar\", \"foobar\", 400) = 0\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobarbaz", -400) != -1) {
+ printf("perl => index(\"foobar\", \"foobarbaz\", -400) = %d\n",
+ index("foobar", "foobarbaz", -400));
+ printf(" D => index(\"foobar\", \"foobarbaz\", -400) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobarbaz", -400) != -1) {
+ printf("perl => rindex(\"foobar\", \"foobarbaz\", -400) = %d\n",
+ rindex("foobar", "foobarbaz", -400));
+ printf(" D => rindex(\"foobar\", \"foobarbaz\", -400) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobarbaz", -1) != -1) {
+ printf("perl => index(\"foobar\", \"foobarbaz\", -1) = %d\n",
+ index("foobar", "foobarbaz", -1));
+ printf(" D => index(\"foobar\", \"foobarbaz\", -1) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobarbaz", -1) != -1) {
+ printf("perl => rindex(\"foobar\", \"foobarbaz\", -1) = %d\n",
+ rindex("foobar", "foobarbaz", -1));
+ printf(" D => rindex(\"foobar\", \"foobarbaz\", -1) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobarbaz", 0) != -1) {
+ printf("perl => index(\"foobar\", \"foobarbaz\", 0) = %d\n",
+ index("foobar", "foobarbaz", 0));
+ printf(" D => index(\"foobar\", \"foobarbaz\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobarbaz", 0) != -1) {
+ printf("perl => rindex(\"foobar\", \"foobarbaz\", 0) = %d\n",
+ rindex("foobar", "foobarbaz", 0));
+ printf(" D => rindex(\"foobar\", \"foobarbaz\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobarbaz", 3) != -1) {
+ printf("perl => index(\"foobar\", \"foobarbaz\", 3) = %d\n",
+ index("foobar", "foobarbaz", 3));
+ printf(" D => index(\"foobar\", \"foobarbaz\", 3) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobarbaz", 3) != -1) {
+ printf("perl => rindex(\"foobar\", \"foobarbaz\", 3) = %d\n",
+ rindex("foobar", "foobarbaz", 3));
+ printf(" D => rindex(\"foobar\", \"foobarbaz\", 3) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobarbaz", 6) != -1) {
+ printf("perl => index(\"foobar\", \"foobarbaz\", 6) = %d\n",
+ index("foobar", "foobarbaz", 6));
+ printf(" D => index(\"foobar\", \"foobarbaz\", 6) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobarbaz", 6) != -1) {
+ printf("perl => rindex(\"foobar\", \"foobarbaz\", 6) = %d\n",
+ rindex("foobar", "foobarbaz", 6));
+ printf(" D => rindex(\"foobar\", \"foobarbaz\", 6) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobarbaz", 7) != -1) {
+ printf("perl => index(\"foobar\", \"foobarbaz\", 7) = %d\n",
+ index("foobar", "foobarbaz", 7));
+ printf(" D => index(\"foobar\", \"foobarbaz\", 7) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobarbaz", 7) != -1) {
+ printf("perl => rindex(\"foobar\", \"foobarbaz\", 7) = %d\n",
+ rindex("foobar", "foobarbaz", 7));
+ printf(" D => rindex(\"foobar\", \"foobarbaz\", 7) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobarbaz", 8) != -1) {
+ printf("perl => index(\"foobar\", \"foobarbaz\", 8) = %d\n",
+ index("foobar", "foobarbaz", 8));
+ printf(" D => index(\"foobar\", \"foobarbaz\", 8) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobarbaz", 8) != -1) {
+ printf("perl => rindex(\"foobar\", \"foobarbaz\", 8) = %d\n",
+ rindex("foobar", "foobarbaz", 8));
+ printf(" D => rindex(\"foobar\", \"foobarbaz\", 8) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "foobarbaz", 400) != -1) {
+ printf("perl => index(\"foobar\", \"foobarbaz\", 400) = %d\n",
+ index("foobar", "foobarbaz", 400));
+ printf(" D => index(\"foobar\", \"foobarbaz\", 400) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "foobarbaz", 400) != -1) {
+ printf("perl => rindex(\"foobar\", \"foobarbaz\", 400) = %d\n",
+ rindex("foobar", "foobarbaz", 400));
+ printf(" D => rindex(\"foobar\", \"foobarbaz\", 400) = -1\n");
+ $failed++;
+ }
+
+ if (index("", "foobar", -400) != -1) {
+ printf("perl => index(\"\", \"foobar\", -400) = %d\n",
+ index("", "foobar", -400));
+ printf(" D => index(\"\", \"foobar\", -400) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("", "foobar", -400) != -1) {
+ printf("perl => rindex(\"\", \"foobar\", -400) = %d\n",
+ rindex("", "foobar", -400));
+ printf(" D => rindex(\"\", \"foobar\", -400) = -1\n");
+ $failed++;
+ }
+
+ if (index("", "foobar", -1) != -1) {
+ printf("perl => index(\"\", \"foobar\", -1) = %d\n",
+ index("", "foobar", -1));
+ printf(" D => index(\"\", \"foobar\", -1) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("", "foobar", -1) != -1) {
+ printf("perl => rindex(\"\", \"foobar\", -1) = %d\n",
+ rindex("", "foobar", -1));
+ printf(" D => rindex(\"\", \"foobar\", -1) = -1\n");
+ $failed++;
+ }
+
+ if (index("", "foobar", 0) != -1) {
+ printf("perl => index(\"\", \"foobar\", 0) = %d\n",
+ index("", "foobar", 0));
+ printf(" D => index(\"\", \"foobar\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("", "foobar", 0) != -1) {
+ printf("perl => rindex(\"\", \"foobar\", 0) = %d\n",
+ rindex("", "foobar", 0));
+ printf(" D => rindex(\"\", \"foobar\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (index("", "foobar", 0) != -1) {
+ printf("perl => index(\"\", \"foobar\", 0) = %d\n",
+ index("", "foobar", 0));
+ printf(" D => index(\"\", \"foobar\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("", "foobar", 0) != -1) {
+ printf("perl => rindex(\"\", \"foobar\", 0) = %d\n",
+ rindex("", "foobar", 0));
+ printf(" D => rindex(\"\", \"foobar\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (index("", "foobar", 0) != -1) {
+ printf("perl => index(\"\", \"foobar\", 0) = %d\n",
+ index("", "foobar", 0));
+ printf(" D => index(\"\", \"foobar\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("", "foobar", 0) != -1) {
+ printf("perl => rindex(\"\", \"foobar\", 0) = %d\n",
+ rindex("", "foobar", 0));
+ printf(" D => rindex(\"\", \"foobar\", 0) = -1\n");
+ $failed++;
+ }
+
+ if (index("", "foobar", 1) != -1) {
+ printf("perl => index(\"\", \"foobar\", 1) = %d\n",
+ index("", "foobar", 1));
+ printf(" D => index(\"\", \"foobar\", 1) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("", "foobar", 1) != -1) {
+ printf("perl => rindex(\"\", \"foobar\", 1) = %d\n",
+ rindex("", "foobar", 1));
+ printf(" D => rindex(\"\", \"foobar\", 1) = -1\n");
+ $failed++;
+ }
+
+ if (index("", "foobar", 2) != -1) {
+ printf("perl => index(\"\", \"foobar\", 2) = %d\n",
+ index("", "foobar", 2));
+ printf(" D => index(\"\", \"foobar\", 2) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("", "foobar", 2) != -1) {
+ printf("perl => rindex(\"\", \"foobar\", 2) = %d\n",
+ rindex("", "foobar", 2));
+ printf(" D => rindex(\"\", \"foobar\", 2) = -1\n");
+ $failed++;
+ }
+
+ if (index("", "foobar", 400) != -1) {
+ printf("perl => index(\"\", \"foobar\", 400) = %d\n",
+ index("", "foobar", 400));
+ printf(" D => index(\"\", \"foobar\", 400) = -1\n");
+ $failed++;
+ }
+
+ if (rindex("", "foobar", 400) != -1) {
+ printf("perl => rindex(\"\", \"foobar\", 400) = %d\n",
+ rindex("", "foobar", 400));
+ printf(" D => rindex(\"\", \"foobar\", 400) = -1\n");
+ $failed++;
+ }
+
+ if (index("foobar", "", -400) != 0) {
+ printf("perl => index(\"foobar\", \"\", -400) = %d\n",
+ index("foobar", "", -400));
+ printf(" D => index(\"foobar\", \"\", -400) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "", -400) != 0) {
+ printf("perl => rindex(\"foobar\", \"\", -400) = %d\n",
+ rindex("foobar", "", -400));
+ printf(" D => rindex(\"foobar\", \"\", -400) = 0\n");
+ $failed++;
+ }
+
+ if (index("foobar", "", -1) != 0) {
+ printf("perl => index(\"foobar\", \"\", -1) = %d\n",
+ index("foobar", "", -1));
+ printf(" D => index(\"foobar\", \"\", -1) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "", -1) != 0) {
+ printf("perl => rindex(\"foobar\", \"\", -1) = %d\n",
+ rindex("foobar", "", -1));
+ printf(" D => rindex(\"foobar\", \"\", -1) = 0\n");
+ $failed++;
+ }
+
+ if (index("foobar", "", 0) != 0) {
+ printf("perl => index(\"foobar\", \"\", 0) = %d\n",
+ index("foobar", "", 0));
+ printf(" D => index(\"foobar\", \"\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "", 0) != 0) {
+ printf("perl => rindex(\"foobar\", \"\", 0) = %d\n",
+ rindex("foobar", "", 0));
+ printf(" D => rindex(\"foobar\", \"\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (index("foobar", "", 3) != 3) {
+ printf("perl => index(\"foobar\", \"\", 3) = %d\n",
+ index("foobar", "", 3));
+ printf(" D => index(\"foobar\", \"\", 3) = 3\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "", 3) != 3) {
+ printf("perl => rindex(\"foobar\", \"\", 3) = %d\n",
+ rindex("foobar", "", 3));
+ printf(" D => rindex(\"foobar\", \"\", 3) = 3\n");
+ $failed++;
+ }
+
+ if (index("foobar", "", 6) != 6) {
+ printf("perl => index(\"foobar\", \"\", 6) = %d\n",
+ index("foobar", "", 6));
+ printf(" D => index(\"foobar\", \"\", 6) = 6\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "", 6) != 6) {
+ printf("perl => rindex(\"foobar\", \"\", 6) = %d\n",
+ rindex("foobar", "", 6));
+ printf(" D => rindex(\"foobar\", \"\", 6) = 6\n");
+ $failed++;
+ }
+
+ if (index("foobar", "", 7) != 6) {
+ printf("perl => index(\"foobar\", \"\", 7) = %d\n",
+ index("foobar", "", 7));
+ printf(" D => index(\"foobar\", \"\", 7) = 6\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "", 7) != 6) {
+ printf("perl => rindex(\"foobar\", \"\", 7) = %d\n",
+ rindex("foobar", "", 7));
+ printf(" D => rindex(\"foobar\", \"\", 7) = 6\n");
+ $failed++;
+ }
+
+ if (index("foobar", "", 8) != 6) {
+ printf("perl => index(\"foobar\", \"\", 8) = %d\n",
+ index("foobar", "", 8));
+ printf(" D => index(\"foobar\", \"\", 8) = 6\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "", 8) != 6) {
+ printf("perl => rindex(\"foobar\", \"\", 8) = %d\n",
+ rindex("foobar", "", 8));
+ printf(" D => rindex(\"foobar\", \"\", 8) = 6\n");
+ $failed++;
+ }
+
+ if (index("foobar", "", 400) != 6) {
+ printf("perl => index(\"foobar\", \"\", 400) = %d\n",
+ index("foobar", "", 400));
+ printf(" D => index(\"foobar\", \"\", 400) = 6\n");
+ $failed++;
+ }
+
+ if (rindex("foobar", "", 400) != 6) {
+ printf("perl => rindex(\"foobar\", \"\", 400) = %d\n",
+ rindex("foobar", "", 400));
+ printf(" D => rindex(\"foobar\", \"\", 400) = 6\n");
+ $failed++;
+ }
+
+ if (index("", "", -400) != 0) {
+ printf("perl => index(\"\", \"\", -400) = %d\n",
+ index("", "", -400));
+ printf(" D => index(\"\", \"\", -400) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("", "", -400) != 0) {
+ printf("perl => rindex(\"\", \"\", -400) = %d\n",
+ rindex("", "", -400));
+ printf(" D => rindex(\"\", \"\", -400) = 0\n");
+ $failed++;
+ }
+
+ if (index("", "", -1) != 0) {
+ printf("perl => index(\"\", \"\", -1) = %d\n",
+ index("", "", -1));
+ printf(" D => index(\"\", \"\", -1) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("", "", -1) != 0) {
+ printf("perl => rindex(\"\", \"\", -1) = %d\n",
+ rindex("", "", -1));
+ printf(" D => rindex(\"\", \"\", -1) = 0\n");
+ $failed++;
+ }
+
+ if (index("", "", 0) != 0) {
+ printf("perl => index(\"\", \"\", 0) = %d\n",
+ index("", "", 0));
+ printf(" D => index(\"\", \"\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("", "", 0) != 0) {
+ printf("perl => rindex(\"\", \"\", 0) = %d\n",
+ rindex("", "", 0));
+ printf(" D => rindex(\"\", \"\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (index("", "", 0) != 0) {
+ printf("perl => index(\"\", \"\", 0) = %d\n",
+ index("", "", 0));
+ printf(" D => index(\"\", \"\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("", "", 0) != 0) {
+ printf("perl => rindex(\"\", \"\", 0) = %d\n",
+ rindex("", "", 0));
+ printf(" D => rindex(\"\", \"\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (index("", "", 0) != 0) {
+ printf("perl => index(\"\", \"\", 0) = %d\n",
+ index("", "", 0));
+ printf(" D => index(\"\", \"\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("", "", 0) != 0) {
+ printf("perl => rindex(\"\", \"\", 0) = %d\n",
+ rindex("", "", 0));
+ printf(" D => rindex(\"\", \"\", 0) = 0\n");
+ $failed++;
+ }
+
+ if (index("", "", 1) != 0) {
+ printf("perl => index(\"\", \"\", 1) = %d\n",
+ index("", "", 1));
+ printf(" D => index(\"\", \"\", 1) = 0\n");
+ $failed++;
+ }
+
+ if (rindex("", "", 1) != 0) {
+ printf("perl => rindex(\"\", \"\", 1) = %d\n",
+ rindex("", "", 1));
+ printf(" D => rindex(\"\", \"\", 1) = 0\n");
+ $failed++;
+ }
+
+ exit($failed);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d
new file mode 100644
index 000000000000..fbc56203d5e6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+in_addr_t *ip4a;
+in_addr_t *ip4b;
+in_addr_t *ip4c;
+in_addr_t *ip4d;
+
+BEGIN
+{
+ this->buf4a = alloca(sizeof (in_addr_t));
+ this->buf4b = alloca(sizeof (in_addr_t));
+ this->buf4c = alloca(sizeof (in_addr_t));
+ this->buf4d = alloca(sizeof (in_addr_t));
+ ip4a = this->buf4a;
+ ip4b = this->buf4b;
+ ip4c = this->buf4c;
+ ip4d = this->buf4d;
+
+ *ip4a = htonl(0xc0a80117);
+ *ip4b = htonl(0x7f000001);
+ *ip4c = htonl(0xffffffff);
+ *ip4d = htonl(0x00000000);
+
+ printf("%s\n", inet_ntoa(ip4a));
+ printf("%s\n", inet_ntoa(ip4b));
+ printf("%s\n", inet_ntoa(ip4c));
+ printf("%s\n", inet_ntoa(ip4d));
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d.out
new file mode 100644
index 000000000000..ab535e78c117
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d.out
@@ -0,0 +1,5 @@
+192.168.1.23
+127.0.0.1
+255.255.255.255
+0.0.0.0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d
new file mode 100644
index 000000000000..40b3849da278
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d
@@ -0,0 +1,95 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+struct in6_addr *ip6a;
+struct in6_addr *ip6b;
+struct in6_addr *ip6c;
+struct in6_addr *ip6d;
+struct in6_addr *ip6e;
+struct in6_addr *ip6f;
+struct in6_addr *ip6g;
+
+BEGIN
+{
+ this->buf6a = alloca(sizeof (struct in6_addr));
+ this->buf6b = alloca(sizeof (struct in6_addr));
+ this->buf6c = alloca(sizeof (struct in6_addr));
+ this->buf6d = alloca(sizeof (struct in6_addr));
+ this->buf6e = alloca(sizeof (struct in6_addr));
+ this->buf6f = alloca(sizeof (struct in6_addr));
+ this->buf6g = alloca(sizeof (struct in6_addr));
+ ip6a = this->buf6a;
+ ip6b = this->buf6b;
+ ip6c = this->buf6c;
+ ip6d = this->buf6d;
+ ip6e = this->buf6e;
+ ip6f = this->buf6f;
+ ip6g = this->buf6g;
+
+ ip6a->__u6_addr.__u6_addr8[0] = 0xfe;
+ ip6a->__u6_addr.__u6_addr8[1] = 0x80;
+ ip6a->__u6_addr.__u6_addr8[8] = 0x02;
+ ip6a->__u6_addr.__u6_addr8[9] = 0x14;
+ ip6a->__u6_addr.__u6_addr8[10] = 0x4f;
+ ip6a->__u6_addr.__u6_addr8[11] = 0xff;
+ ip6a->__u6_addr.__u6_addr8[12] = 0xfe;
+ ip6a->__u6_addr.__u6_addr8[13] = 0x0b;
+ ip6a->__u6_addr.__u6_addr8[14] = 0x76;
+ ip6a->__u6_addr.__u6_addr8[15] = 0xc8;
+ ip6b->__u6_addr.__u6_addr8[0] = 0x10;
+ ip6b->__u6_addr.__u6_addr8[1] = 0x80;
+ ip6b->__u6_addr.__u6_addr8[10] = 0x08;
+ ip6b->__u6_addr.__u6_addr8[11] = 0x08;
+ ip6b->__u6_addr.__u6_addr8[13] = 0x20;
+ ip6b->__u6_addr.__u6_addr8[13] = 0x0c;
+ ip6b->__u6_addr.__u6_addr8[14] = 0x41;
+ ip6b->__u6_addr.__u6_addr8[15] = 0x7a;
+ ip6c->__u6_addr.__u6_addr8[15] = 0x01;
+ ip6e->__u6_addr.__u6_addr8[12] = 0x7f;
+ ip6e->__u6_addr.__u6_addr8[15] = 0x01;
+ ip6f->__u6_addr.__u6_addr8[10] = 0xff;
+ ip6f->__u6_addr.__u6_addr8[11] = 0xff;
+ ip6f->__u6_addr.__u6_addr8[12] = 0x7f;
+ ip6f->__u6_addr.__u6_addr8[15] = 0x01;
+ ip6g->__u6_addr.__u6_addr8[10] = 0xff;
+ ip6g->__u6_addr.__u6_addr8[11] = 0xfe;
+ ip6g->__u6_addr.__u6_addr8[12] = 0x7f;
+ ip6g->__u6_addr.__u6_addr8[15] = 0x01;
+
+ printf("%s\n", inet_ntoa6(ip6a));
+ printf("%s\n", inet_ntoa6(ip6b));
+ printf("%s\n", inet_ntoa6(ip6c));
+ printf("%s\n", inet_ntoa6(ip6d));
+ printf("%s\n", inet_ntoa6(ip6e));
+ printf("%s\n", inet_ntoa6(ip6f));
+ printf("%s\n", inet_ntoa6(ip6g));
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d.out
new file mode 100644
index 000000000000..d87c1f6141d3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d.out
@@ -0,0 +1,8 @@
+fe80::214:4fff:fe0b:76c8
+1080::808:c:417a
+::1
+::
+127.0.0.1
+127.0.0.1
+::fffe:7f00:1
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d
new file mode 100644
index 000000000000..21452d6e96e7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d
@@ -0,0 +1,138 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+inline int AF_INET = 2;
+inline int AF_INET6 = 28;
+
+in_addr_t *ip4a;
+in_addr_t *ip4b;
+in_addr_t *ip4c;
+in_addr_t *ip4d;
+struct in6_addr *ip6a;
+struct in6_addr *ip6b;
+struct in6_addr *ip6c;
+struct in6_addr *ip6d;
+struct in6_addr *ip6e;
+struct in6_addr *ip6f;
+struct in6_addr *ip6g;
+struct in6_addr *ip6h;
+
+BEGIN
+{
+ this->buf4a = alloca(sizeof (in_addr_t));
+ this->buf4b = alloca(sizeof (in_addr_t));
+ this->buf4c = alloca(sizeof (in_addr_t));
+ this->buf4d = alloca(sizeof (in_addr_t));
+ this->buf6a = alloca(sizeof (struct in6_addr));
+ this->buf6b = alloca(sizeof (struct in6_addr));
+ this->buf6c = alloca(sizeof (struct in6_addr));
+ this->buf6d = alloca(sizeof (struct in6_addr));
+ this->buf6e = alloca(sizeof (struct in6_addr));
+ this->buf6f = alloca(sizeof (struct in6_addr));
+ this->buf6g = alloca(sizeof (struct in6_addr));
+ this->buf6h = alloca(sizeof (struct in6_addr));
+ ip4a = this->buf4a;
+ ip4b = this->buf4b;
+ ip4c = this->buf4c;
+ ip4d = this->buf4d;
+ ip6a = this->buf6a;
+ ip6b = this->buf6b;
+ ip6c = this->buf6c;
+ ip6d = this->buf6d;
+ ip6e = this->buf6e;
+ ip6f = this->buf6f;
+ ip6g = this->buf6g;
+ ip6h = this->buf6h;
+
+ *ip4a = htonl(0xc0a80117);
+ *ip4b = htonl(0x7f000001);
+ *ip4c = htonl(0xffffffff);
+ *ip4d = htonl(0x00000000);
+ ip6a->__u6_addr.__u6_addr8[0] = 0xfe;
+ ip6a->__u6_addr.__u6_addr8[1] = 0x80;
+ ip6a->__u6_addr.__u6_addr8[8] = 0x02;
+ ip6a->__u6_addr.__u6_addr8[9] = 0x14;
+ ip6a->__u6_addr.__u6_addr8[10] = 0x4f;
+ ip6a->__u6_addr.__u6_addr8[11] = 0xff;
+ ip6a->__u6_addr.__u6_addr8[12] = 0xfe;
+ ip6a->__u6_addr.__u6_addr8[13] = 0x0b;
+ ip6a->__u6_addr.__u6_addr8[14] = 0x76;
+ ip6a->__u6_addr.__u6_addr8[15] = 0xc8;
+ ip6b->__u6_addr.__u6_addr8[0] = 0x10;
+ ip6b->__u6_addr.__u6_addr8[1] = 0x80;
+ ip6b->__u6_addr.__u6_addr8[10] = 0x08;
+ ip6b->__u6_addr.__u6_addr8[11] = 0x08;
+ ip6b->__u6_addr.__u6_addr8[13] = 0x20;
+ ip6b->__u6_addr.__u6_addr8[13] = 0x0c;
+ ip6b->__u6_addr.__u6_addr8[14] = 0x41;
+ ip6b->__u6_addr.__u6_addr8[15] = 0x7a;
+ ip6c->__u6_addr.__u6_addr8[15] = 0x01;
+ ip6e->__u6_addr.__u6_addr8[12] = 0x7f;
+ ip6e->__u6_addr.__u6_addr8[15] = 0x01;
+ ip6f->__u6_addr.__u6_addr8[10] = 0xff;
+ ip6f->__u6_addr.__u6_addr8[11] = 0xff;
+ ip6f->__u6_addr.__u6_addr8[12] = 0x7f;
+ ip6f->__u6_addr.__u6_addr8[15] = 0x01;
+ ip6g->__u6_addr.__u6_addr8[10] = 0xff;
+ ip6g->__u6_addr.__u6_addr8[11] = 0xfe;
+ ip6g->__u6_addr.__u6_addr8[12] = 0x7f;
+ ip6g->__u6_addr.__u6_addr8[15] = 0x01;
+ ip6h->__u6_addr.__u6_addr8[0] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[1] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[2] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[3] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[4] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[5] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[6] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[7] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[8] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[9] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[10] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[11] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[12] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[13] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[14] = 0xff;
+ ip6h->__u6_addr.__u6_addr8[15] = 0xff;
+
+ printf("%s\n", inet_ntop(AF_INET, ip4a));
+ printf("%s\n", inet_ntop(AF_INET, ip4b));
+ printf("%s\n", inet_ntop(AF_INET, ip4c));
+ printf("%s\n", inet_ntop(AF_INET, ip4d));
+ printf("%s\n", inet_ntop(AF_INET6, ip6a));
+ printf("%s\n", inet_ntop(AF_INET6, ip6b));
+ printf("%s\n", inet_ntop(AF_INET6, ip6c));
+ printf("%s\n", inet_ntop(AF_INET6, ip6d));
+ printf("%s\n", inet_ntop(AF_INET6, ip6e));
+ printf("%s\n", inet_ntop(AF_INET6, ip6f));
+ printf("%s\n", inet_ntop(AF_INET6, ip6g));
+ printf("%s\n", inet_ntop(AF_INET6, ip6h));
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d.out
new file mode 100644
index 000000000000..7c8311c2b8ef
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d.out
@@ -0,0 +1,13 @@
+192.168.1.23
+127.0.0.1
+255.255.255.255
+0.0.0.0
+fe80::214:4fff:fe0b:76c8
+1080::808:c:417a
+::1
+::
+::127.0.0.1
+::ffff:127.0.0.1
+::fffe:7f00:1
+ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d
new file mode 100644
index 000000000000..03e295a74d5b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("%s\n", lltostr(0));
+ printf("%s\n", lltostr(1));
+ printf("%s\n", lltostr(-1));
+ printf("%s\n", lltostr(123456789));
+ printf("%s\n", lltostr(-123456789));
+ printf("%s\n", lltostr(1LL << 62));
+ printf("%s\n", lltostr(-(1LL << 62)));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d.out
new file mode 100644
index 000000000000..e007c648aa65
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d.out
@@ -0,0 +1,8 @@
+0
+1
+-1
+123456789
+-123456789
+4611686018427387904
+-4611686018427387904
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d
new file mode 100644
index 000000000000..1afe37dc689d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d
@@ -0,0 +1,80 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+int64_t val[int];
+
+BEGIN
+{
+ base = -2;
+ i = 0;
+ val[i++] = -10;
+ val[i++] = -1;
+ val[i++] = 0;
+ val[i++] = 10;
+ val[i++] = 100;
+ val[i++] = 1000;
+ val[i++] = (1LL << 62);
+ maxval = i;
+ i = 0;
+}
+
+tick-1ms
+/i < maxval/
+{
+ printf("base %2d of %20d: ", base, val[i]);
+}
+
+tick-1ms
+/i < maxval/
+{
+ printf(" %s\n", lltostr(val[i], base));
+}
+
+ERROR
+{
+ printf(" <error>\n");
+}
+
+tick-1ms
+/i < maxval/
+{
+ i++;
+}
+
+tick-1ms
+/i == maxval/
+{
+ i = 0;
+ base++;
+}
+
+tick-1ms
+/base > 40/
+{
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out
new file mode 100644
index 000000000000..94e22577123a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out
@@ -0,0 +1,302 @@
+base -2 of -10: <error>
+base -2 of -1: <error>
+base -2 of 0: <error>
+base -2 of 10: <error>
+base -2 of 100: <error>
+base -2 of 1000: <error>
+base -2 of 4611686018427387904: <error>
+base -1 of -10: <error>
+base -1 of -1: <error>
+base -1 of 0: <error>
+base -1 of 10: <error>
+base -1 of 100: <error>
+base -1 of 1000: <error>
+base -1 of 4611686018427387904: <error>
+base 0 of -10: <error>
+base 0 of -1: <error>
+base 0 of 0: <error>
+base 0 of 10: <error>
+base 0 of 100: <error>
+base 0 of 1000: <error>
+base 0 of 4611686018427387904: <error>
+base 1 of -10: <error>
+base 1 of -1: <error>
+base 1 of 0: <error>
+base 1 of 10: <error>
+base 1 of 100: <error>
+base 1 of 1000: <error>
+base 1 of 4611686018427387904: <error>
+base 2 of -10: 1111111111111111111111111111111111111111111111111111111111110110
+base 2 of -1: 1111111111111111111111111111111111111111111111111111111111111111
+base 2 of 0: 0
+base 2 of 10: 1010
+base 2 of 100: 1100100
+base 2 of 1000: 1111101000
+base 2 of 4611686018427387904: 100000000000000000000000000000000000000000000000000000000000000
+base 3 of -10: 11112220022122120101211020120210210211120
+base 3 of -1: 11112220022122120101211020120210210211220
+base 3 of 0: 0
+base 3 of 10: 101
+base 3 of 100: 10201
+base 3 of 1000: 1101001
+base 3 of 4611686018427387904: 1010201120122220002201001122110012110111
+base 4 of -10: 33333333333333333333333333333312
+base 4 of -1: 33333333333333333333333333333333
+base 4 of 0: 0
+base 4 of 10: 22
+base 4 of 100: 1210
+base 4 of 1000: 33220
+base 4 of 4611686018427387904: 10000000000000000000000000000000
+base 5 of -10: 2214220303114400424121122411
+base 5 of -1: 2214220303114400424121122430
+base 5 of 0: 0
+base 5 of 10: 20
+base 5 of 100: 400
+base 5 of 1000: 13000
+base 5 of 4611686018427387904: 302141200402211214402403104
+base 6 of -10: 3520522010102100444244410
+base 6 of -1: 3520522010102100444244423
+base 6 of 0: 0
+base 6 of 10: 14
+base 6 of 100: 244
+base 6 of 1000: 4344
+base 6 of 4611686018427387904: 550120301313313111041104
+base 7 of -10: 45012021522523134134556
+base 7 of -1: 45012021522523134134601
+base 7 of 0: 0
+base 7 of 10: 13
+base 7 of 100: 202
+base 7 of 1000: 2626
+base 7 of 4611686018427387904: 11154003640456024361134
+base 8 of -10: 01777777777777777777766
+base 8 of -1: 01777777777777777777777
+base 8 of 0: 0
+base 8 of 10: 012
+base 8 of 100: 0144
+base 8 of 1000: 01750
+base 8 of 4611686018427387904: 0400000000000000000000
+base 9 of -10: 145808576354216723746
+base 9 of -1: 145808576354216723756
+base 9 of 0: 0
+base 9 of 10: 11
+base 9 of 100: 121
+base 9 of 1000: 1331
+base 9 of 4611686018427387904: 33646586081048405414
+base 10 of -10: -10
+base 10 of -1: -1
+base 10 of 0: 0
+base 10 of 10: 10
+base 10 of 100: 100
+base 10 of 1000: 1000
+base 10 of 4611686018427387904: 4611686018427387904
+base 11 of -10: 335500516a429071276
+base 11 of -1: 335500516a429071284
+base 11 of 0: 0
+base 11 of 10: a
+base 11 of 100: 91
+base 11 of 1000: 82a
+base 11 of 4611686018427387904: 9140013181078458a4
+base 12 of -10: 839365134a2a240706
+base 12 of -1: 839365134a2a240713
+base 12 of 0: 0
+base 12 of 10: a
+base 12 of 100: 84
+base 12 of 1000: 6b4
+base 12 of 4611686018427387904: 20b3a733a268670194
+base 13 of -10: 219505a9511a867b66
+base 13 of -1: 219505a9511a867b72
+base 13 of 0: 0
+base 13 of 10: a
+base 13 of 100: 79
+base 13 of 1000: 5bc
+base 13 of 4611686018427387904: 6c1349246a2881c84
+base 14 of -10: 8681049adb03db166
+base 14 of -1: 8681049adb03db171
+base 14 of 0: 0
+base 14 of 10: a
+base 14 of 100: 72
+base 14 of 1000: 516
+base 14 of 4611686018427387904: 219038263637dd3c4
+base 15 of -10: 2c1d56b648c6cd106
+base 15 of -1: 2c1d56b648c6cd110
+base 15 of 0: 0
+base 15 of 10: a
+base 15 of 100: 6a
+base 15 of 1000: 46a
+base 15 of 4611686018427387904: a7e8ce189a933404
+base 16 of -10: 0xfffffffffffffff6
+base 16 of -1: 0xffffffffffffffff
+base 16 of 0: 0x0
+base 16 of 10: 0xa
+base 16 of 100: 0x64
+base 16 of 1000: 0x3e8
+base 16 of 4611686018427387904: 0x4000000000000000
+base 17 of -10: 67979g60f5428008
+base 17 of -1: 67979g60f5428010
+base 17 of 0: 0
+base 17 of 10: a
+base 17 of 100: 5f
+base 17 of 1000: 37e
+base 17 of 4611686018427387904: 1a6a6ca03e10a88d
+base 18 of -10: 2d3fgb0b9cg4bd26
+base 18 of -1: 2d3fgb0b9cg4bd2f
+base 18 of 0: 0
+base 18 of 10: a
+base 18 of 100: 5a
+base 18 of 1000: 31a
+base 18 of 4611686018427387904: c588bdbfgd12ge4
+base 19 of -10: 141c8786h1ccaag7
+base 19 of -1: 141c8786h1ccaagg
+base 19 of 0: 0
+base 19 of 10: a
+base 19 of 100: 55
+base 19 of 1000: 2ec
+base 19 of 4611686018427387904: 5ecbb6fi9h7ggi9
+base 20 of -10: b53bjh07be4dj06
+base 20 of -1: b53bjh07be4dj0f
+base 20 of 0: 0
+base 20 of 10: a
+base 20 of 100: 50
+base 20 of 1000: 2a0
+base 20 of 4611686018427387904: 2g5hjj51hib39f4
+base 21 of -10: 5e8g4ggg7g56di6
+base 21 of -1: 5e8g4ggg7g56dif
+base 21 of 0: 0
+base 21 of 10: a
+base 21 of 100: 4g
+base 21 of 1000: 25d
+base 21 of 4611686018427387904: 18hjgjjjhebh8f4
+base 22 of -10: 2l4lf104353j8k6
+base 22 of -1: 2l4lf104353j8kf
+base 22 of 0: 0
+base 22 of 10: a
+base 22 of 100: 4c
+base 22 of 1000: 21a
+base 22 of 4611686018427387904: g6g95gc0hha7g4
+base 23 of -10: 1ddh88h2782i50j
+base 23 of -1: 1ddh88h2782i515
+base 23 of 0: 0
+base 23 of 10: a
+base 23 of 100: 48
+base 23 of 1000: 1kb
+base 23 of 4611686018427387904: 93a22467dc4chd
+base 24 of -10: l12ee5fn0ji1i6
+base 24 of -1: l12ee5fn0ji1if
+base 24 of 0: 0
+base 24 of 10: a
+base 24 of 100: 44
+base 24 of 1000: 1hg
+base 24 of 4611686018427387904: 566ffd9ni4mcag
+base 25 of -10: c9c336o0mlb7e6
+base 25 of -1: c9c336o0mlb7ef
+base 25 of 0: 0
+base 25 of 10: a
+base 25 of 100: 40
+base 25 of 1000: 1f0
+base 25 of 4611686018427387904: 32970kc6bo2kg4
+base 26 of -10: 7b7n2pcniokcg6
+base 26 of -1: 7b7n2pcniokcgf
+base 26 of 0: 0
+base 26 of 10: a
+base 26 of 100: 3m
+base 26 of 1000: 1cc
+base 26 of 4611686018427387904: 1m8c769io65344
+base 27 of -10: 4eo8hfam6fllmf
+base 27 of -1: 4eo8hfam6fllmo
+base 27 of 0: 0
+base 27 of 10: a
+base 27 of 100: 3j
+base 27 of 1000: 1a1
+base 27 of 4611686018427387904: 13jfho2j1hc5cd
+base 28 of -10: 2nc6j26l66rho6
+base 28 of -1: 2nc6j26l66rhof
+base 28 of 0: 0
+base 28 of 10: a
+base 28 of 100: 3g
+base 28 of 1000: 17k
+base 28 of 4611686018427387904: jo1ilfj8fkpd4
+base 29 of -10: 1n3rsh11f098re
+base 29 of -1: 1n3rsh11f098rn
+base 29 of 0: 0
+base 29 of 10: a
+base 29 of 100: 3d
+base 29 of 1000: 15e
+base 29 of 4611686018427387904: d0slim0b029e6
+base 30 of -10: 14l9lkmo30o406
+base 30 of -1: 14l9lkmo30o40f
+base 30 of 0: 0
+base 30 of 10: a
+base 30 of 100: 3a
+base 30 of 1000: 13a
+base 30 of 4611686018427387904: 8k9rrkl0ml104
+base 31 of -10: nd075ib45k866
+base 31 of -1: nd075ib45k86f
+base 31 of 0: 0
+base 31 of 10: a
+base 31 of 100: 37
+base 31 of 1000: 118
+base 31 of 4611686018427387904: 5qfh94i8okhh4
+base 32 of -10: fvvvvvvvvvvvm
+base 32 of -1: fvvvvvvvvvvvv
+base 32 of 0: 0
+base 32 of 10: a
+base 32 of 100: 34
+base 32 of 1000: v8
+base 32 of 4611686018427387904: 4000000000000
+base 33 of -10: b1w8p7j5q9r66
+base 33 of -1: b1w8p7j5q9r6f
+base 33 of 0: 0
+base 33 of 10: a
+base 33 of 100: 31
+base 33 of 1000: ua
+base 33 of 4611686018427387904: 2p826a4q6ivi4
+base 34 of -10: 7orp63sh4dph8
+base 34 of -1: 7orp63sh4dphh
+base 34 of 0: 0
+base 34 of 10: a
+base 34 of 100: 2w
+base 34 of 1000: te
+base 34 of 4611686018427387904: 1vnvr0wl9ketu
+base 35 of -10: 5g24a25twkwf6
+base 35 of -1: 5g24a25twkwff
+base 35 of 0: 0
+base 35 of 10: a
+base 35 of 100: 2u
+base 35 of 1000: sk
+base 35 of 4611686018427387904: 1cqrb9a7gvgu4
+base 36 of -10: 3w5e11264sgs6
+base 36 of -1: 3w5e11264sgsf
+base 36 of 0: 0
+base 36 of 10: a
+base 36 of 100: 2s
+base 36 of 1000: rs
+base 36 of 4611686018427387904: z1ci99jj7474
+base 37 of -10: <error>
+base 37 of -1: <error>
+base 37 of 0: <error>
+base 37 of 10: <error>
+base 37 of 100: <error>
+base 37 of 1000: <error>
+base 37 of 4611686018427387904: <error>
+base 38 of -10: <error>
+base 38 of -1: <error>
+base 38 of 0: <error>
+base 38 of 10: <error>
+base 38 of 100: <error>
+base 38 of 1000: <error>
+base 38 of 4611686018427387904: <error>
+base 39 of -10: <error>
+base 39 of -1: <error>
+base 39 of 0: <error>
+base 39 of 10: <error>
+base 39 of 100: <error>
+base 39 of 1000: <error>
+base 39 of 4611686018427387904: <error>
+base 40 of -10: <error>
+base 40 of -1: <error>
+base 40 of 0: <error>
+base 40 of 10: <error>
+base 40 of 100: <error>
+base 40 of 1000: <error>
+base 40 of 4611686018427387904: <error>
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owned.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owned.d
new file mode 100644
index 000000000000..0f97aa1a951e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owned.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * mutex_owned() should return a non-zero value if the calling
+ * thread currently holds the mutex.
+ *
+ * SECTION: Actions and Subroutines/mutex_owned()
+ */
+
+#pragma D option quiet
+
+lockstat:::adaptive-acquire
+{
+ this->owned = mutex_owned((struct mtx *)arg0);
+ this->owner = mutex_owner((struct mtx *)arg0);
+}
+
+lockstat:::adaptive-acquire
+/!this->owned/
+{
+ printf("mutex_owned() returned 0, expected non-zero\n");
+ exit(1);
+}
+
+lockstat:::adaptive-acquire
+/this->owner != curthread/
+{
+ printf("current thread is not current owner of owned lock\n");
+ exit(1);
+}
+
+lockstat:::adaptive-acquire
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d
new file mode 100644
index 000000000000..dbb10c3fd598
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * mutex_owner() should return a pointer to the kernel thread holding
+ * the mutex.
+ *
+ * SECTION: Actions and Subroutines/mutex_owner()
+ *
+ * NOTES: This assertion can't be verified so we'll just call it.
+ */
+
+
+
+
+#pragma D option quiet
+
+struct thread *ptr;
+
+BEGIN
+{
+ i = 0;
+}
+
+lockstat::mtx_lock:adaptive-acquire
+{
+
+ ptr = mutex_owner((struct mtx *)arg0);
+ i++;
+}
+
+tick-1
+/i > 5/
+{
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d
new file mode 100644
index 000000000000..ac43e790b7b3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d
@@ -0,0 +1,71 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * mutex_type_adaptive() should return a non-zero value if the
+ * mutex is an adaptive one.
+ *
+ * SECTION: Actions and Subroutines/mutex_type_adaptive()
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+ ret = -99;
+}
+
+mtx_lock:adaptive-acquire
+{
+ ret = mutex_type_adaptive((struct mtx *)arg0);
+ i++;
+}
+
+tick-1
+/ret == 1/
+{
+ exit(0);
+}
+
+tick-1
+/i == 100 && ret == 0/
+{
+ printf("mutex_type_adaptive returned 0, expected non-zero\n");
+ exit(1);
+}
+
+tick-1
+/i == 100 && ret == -99/
+{
+ printf("No adaptive_mutexs called in the time this test was run.\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.progenyof.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.progenyof.d
new file mode 100644
index 000000000000..02911580e50e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.progenyof.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * progenyof() should return non-zero if the pid passed is in the
+ # progeny of the calling process.
+ *
+ * SECTION: Actions and Subroutines/progenyof()
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ res_1 = -1;
+ res_2 = -1;
+ res_3 = -1;
+
+ res_1 = progenyof($ppid); /* this will always be true */
+ res_2 = progenyof($ppid + 1); /* this will always be false */
+ res_3 = progenyof(1); /* this will always be true */
+}
+
+
+tick-1
+/res_1 > 0 && res_2 == 0 && res_3 > 0/
+{
+ exit(0);
+}
+
+tick-1
+/res_1 <= 0 || res_2 != 0 || res_3 <= 0/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.rand.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.rand.d
new file mode 100644
index 000000000000..51f4491177d2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.rand.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test rand()
+ *
+ * SECTION: Actions and Subroutines/rand()
+ */
+
+
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-1
+/i != 10/
+{
+ i++;
+ trace(rand());
+}
+
+tick-1
+/i == 10/
+{
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strchr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strchr.d
new file mode 100644
index 000000000000..8dc8f89ba225
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strchr.d
@@ -0,0 +1,71 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ str = "fooeyfooeyfoo";
+ this->success = 0;
+
+ c = 'f';
+ printf("strchr(\"%s\", '%c') = \"%s\"\n", str, c, strchr(str, c));
+ printf("strrchr(\"%s\", '%c') = \"%s\"\n", str, c, strrchr(str, c));
+
+ c = 'y';
+ printf("strchr(\"%s\", '%c') = \"%s\"\n", str, c, strchr(str, c));
+ printf("strrchr(\"%s\", '%c') = \"%s\"\n", str, c, strrchr(str, c));
+
+ printf("strrchr(\"%s\", '%c') = \"%s\"\n", strchr(str, c), c,
+ strrchr(strchr(str, c), c));
+
+ this->success = 1;
+}
+
+BEGIN
+/!this->success/
+{
+ exit(1);
+}
+
+BEGIN
+/strchr(str, 'a') != NULL/
+{
+ exit(2);
+}
+
+BEGIN
+/strrchr(str, 'a') != NULL/
+{
+ exit(3);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strchr.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strchr.d.out
new file mode 100644
index 000000000000..328b5318bc8e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strchr.d.out
@@ -0,0 +1,6 @@
+strchr("fooeyfooeyfoo", 'f') = "fooeyfooeyfoo"
+strrchr("fooeyfooeyfoo", 'f') = "foo"
+strchr("fooeyfooeyfoo", 'y') = "yfooeyfoo"
+strrchr("fooeyfooeyfoo", 'y') = "yfoo"
+strrchr("yfooeyfoo", 'y') = "yfoo"
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d
new file mode 100644
index 000000000000..0f23737d38f6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("%s\n", strjoin("foo", "baz"));
+ printf("%s\n", strjoin("foo", ""));
+ printf("%s\n", strjoin("", "baz"));
+ printf("%s\n", strjoin("", ""));
+ exit(0);
+}
+
+BEGIN
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d.out
new file mode 100644
index 000000000000..657286944a75
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d.out
@@ -0,0 +1,5 @@
+foobaz
+foo
+baz
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strstr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strstr.d
new file mode 100644
index 000000000000..0c81b7a892ab
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strstr.d
@@ -0,0 +1,89 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ str = "foobarbarbazbarbop";
+ this->success = 0;
+
+ c = str;
+ printf("strstr(\"%s\", \"%s\") = \"%s\"\n", str, c, strstr(str, c));
+
+ c = "baz";
+ printf("strstr(\"%s\", \"%s\") = \"%s\"\n", str, c, strstr(str, c));
+
+ c = "bar";
+ printf("strstr(\"%s\", \"%s\") = \"%s\"\n", str, c, strstr(str, c));
+
+ c = "bazbarbop";
+ printf("strstr(\"%s\", \"%s\") = \"%s\"\n", str, c, strstr(str, c));
+
+ c = "barba";
+ printf("strstr(\"%s\", \"%s\") = \"%s\"\n", str, c, strstr(str, c));
+
+ printf("strstr(\"%s\", \"%s\") = \"%s\"\n",
+ strstr(str, "baz"), strstr(str, "zba"),
+ strstr(strstr(str, "baz"), strstr(str, "zba")));
+
+ c = "";
+ printf("strstr(\"%s\", \"%s\") = \"%s\"\n", str, c, strstr(str, c));
+
+ str = "";
+ printf("strstr(\"%s\", \"%s\") = \"%s\"\n", str, c, strstr(str, c));
+
+ str = "f";
+ c = "f";
+ printf("strstr(\"%s\", \"%s\") = \"%s\"\n", str, c, strstr(str, c));
+
+ this->success = 1;
+}
+
+BEGIN
+/!this->success/
+{
+ exit(1);
+}
+
+BEGIN
+/strstr(str, "barbarf") != NULL/
+{
+ exit(2);
+}
+
+BEGIN
+/strstr(str, "foobarbarbazbarbopp") != NULL/
+{
+ exit(3);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strstr.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strstr.d.out
new file mode 100644
index 000000000000..f9121dbcfb8d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strstr.d.out
@@ -0,0 +1,10 @@
+strstr("foobarbarbazbarbop", "foobarbarbazbarbop") = "foobarbarbazbarbop"
+strstr("foobarbarbazbarbop", "baz") = "bazbarbop"
+strstr("foobarbarbazbarbop", "bar") = "barbarbazbarbop"
+strstr("foobarbarbazbarbop", "bazbarbop") = "bazbarbop"
+strstr("foobarbarbazbarbop", "barba") = "barbarbazbarbop"
+strstr("bazbarbop", "zbarbop") = "zbarbop"
+strstr("foobarbarbazbarbop", "") = "foobarbarbazbarbop"
+strstr("", "") = ""
+strstr("f", "f") = "f"
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok.d
new file mode 100644
index 000000000000..47092ba46ba1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok.d
@@ -0,0 +1,146 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ this->str = ",,,Carrots,,Barley,Oatmeal,,,Beans,";
+}
+
+BEGIN
+/(this->field = strtok(this->str, ",")) == NULL/
+{
+ exit(1);
+}
+
+BEGIN
+{
+ printf("%s\n", this->field);
+}
+
+BEGIN
+/(this->field = strtok(NULL, ",")) == NULL/
+{
+ exit(2);
+}
+
+BEGIN
+{
+ printf("%s\n", this->field);
+}
+
+BEGIN
+/(this->field = strtok(NULL, ",")) == NULL/
+{
+ exit(3);
+}
+
+BEGIN
+{
+ printf("%s\n", this->field);
+}
+
+BEGIN
+/(this->field = strtok(NULL, ",")) == NULL/
+{
+ exit(4);
+}
+
+BEGIN
+{
+ printf("%s\n", this->field);
+}
+
+BEGIN
+/(self->a = strtok(NULL, ",")) != NULL/
+{
+ printf("unexpected field: %s\n", this->field);
+ exit(5);
+}
+
+struct {
+ string s1;
+ string s2;
+ string result;
+} command[int];
+
+int i;
+
+BEGIN
+{
+ command[i].s1 = "";
+ command[i].s2 = "";
+ command[i].result = "";
+ i++;
+
+ command[i].s1 = "foo";
+ command[i].s2 = "";
+ command[i].result = command[i].s1;
+ i++;
+
+ command[i].s1 = "foobar";
+ command[i].s2 = "o";
+ command[i].result = "f";
+ i++;
+
+ command[i].s1 = "oobar";
+ command[i].s2 = "o";
+ command[i].result = "bar";
+ i++;
+
+ command[i].s1 = "foo";
+ command[i].s2 = "bar";
+ command[i].result = command[i].s1;
+ i++;
+
+ command[i].s1 = "";
+ command[i].s2 = "foo";
+ command[i].result = "";
+ i++;
+
+ end = i;
+ i = 0;
+}
+
+tick-1ms
+/i < end &&
+ (this->result = strtok(command[i].s1, command[i].s2)) != command[i].result/
+{
+ printf("strtok(\"%s\", \"%s\") = \"%s\", expected \"%s\"",
+ command[i].s1, command[i].s2,
+ this->result != NULL ? this->result : "<null>",
+ command[i].result != NULL ? command[i].result : "<null>");
+ exit(6 + i);
+}
+
+tick-1ms
+/++i == end/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok.d.out
new file mode 100644
index 000000000000..4bc37274b928
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok.d.out
@@ -0,0 +1,5 @@
+Carrots
+Barley
+Oatmeal
+Beans
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok_null.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok_null.d
new file mode 100644
index 000000000000..6de4f97d18fb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok_null.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * Test that a strtok(NULL, ...) without first calling strtok(string, ...)
+ * produces an error
+ */
+
+BEGIN
+{
+ trace(strtok(NULL, "!"));
+ exit(1);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d
new file mode 100644
index 000000000000..edee6442e350
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d
@@ -0,0 +1,231 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+#pragma D option strsize=32
+
+struct {
+ int index;
+ int length;
+ int nolen;
+ int alt;
+} command[int];
+
+int i;
+
+BEGIN
+{
+ str = "foobarbazbop";
+ str2 = "";
+ altstr = "CRAIG: Positioned them, I don't ";
+ altstr2 = "know... I'm fairly wide guy.";
+
+ command[i].index = 3;
+ command[i].nolen = 1;
+ i++;
+
+ command[i].index = 300;
+ command[i].nolen = 1;
+ i++;
+
+ command[i].index = -10;
+ command[i].nolen = 1;
+ i++;
+
+ command[i].index = 0;
+ command[i].nolen = 1;
+ i++;
+
+ command[i].index = 1;
+ command[i].nolen = 1;
+ i++;
+
+ command[i].index = strlen(str) - 1;
+ command[i].nolen = 1;
+ i++;
+
+ command[i].index = strlen(str);
+ command[i].nolen = 1;
+ i++;
+
+ command[i].index = strlen(str) + 1;
+ command[i].nolen = 1;
+ i++;
+
+ command[i].index = 8;
+ command[i].length = 20;
+ i++;
+
+ command[i].index = 4;
+ command[i].length = 4;
+ i++;
+
+ command[i].index = 5;
+ command[i].length = strlen(str) - command[i].index + 1;
+ i++;
+
+ command[i].index = 5;
+ command[i].length = strlen(str) - command[i].index + 2;
+ i++;
+
+ command[i].index = 400;
+ command[i].length = 20;
+ i++;
+
+ command[i].index = 400;
+ command[i].length = 0;
+ i++;
+
+ command[i].index = 400;
+ command[i].length = -1;
+ i++;
+
+ command[i].index = 3;
+ command[i].length = 0;
+ i++;
+
+ command[i].index = 3;
+ command[i].length = -1;
+ i++;
+
+ command[i].index = 3;
+ command[i].length = -4;
+ i++;
+
+ command[i].index = 3;
+ command[i].length = -20;
+ i++;
+
+ command[i].index = -10;
+ command[i].length = -5;
+ i++;
+
+ command[i].index = 0;
+ command[i].length = 400;
+ i++;
+
+ command[i].index = -1;
+ command[i].length = 400;
+ i++;
+
+ command[i].index = -1;
+ command[i].length = 0;
+ i++;
+
+ command[i].index = -1;
+ command[i].length = -1;
+ i++;
+
+ command[i].index = -2 * strlen(str);
+ command[i].length = 2 * strlen(str);
+ i++;
+
+ command[i].index = -2 * strlen(str);
+ command[i].length = strlen(str);
+ i++;
+
+ command[i].index = -2 * strlen(str);
+ command[i].length = strlen(str) + 1;
+ i++;
+
+ command[i].index = -1 * strlen(str);
+ command[i].length = strlen(str);
+ i++;
+
+ command[i].index = -1 * strlen(str);
+ command[i].length = strlen(str) - 1;
+ i++;
+
+ command[i].index = 100;
+ command[i].length = 10;
+ command[i].alt = 1;
+ i++;
+
+ command[i].index = 100;
+ command[i].nolen = 1;
+ command[i].alt = 1;
+ i++;
+
+ end = i;
+ i = 0;
+ printf("#!/usr/perl5/bin/perl\n\nBEGIN {\n");
+
+}
+
+tick-1ms
+/i < end && command[i].nolen/
+{
+ this->str = command[i].alt ? altstr : str;
+ this->str2 = command[i].alt ? altstr2 : str2;
+ this->result = substr(command[i].alt ?
+ "CRAIG: Positioned them, I don't know... I'm fairly wide guy." :
+ str, command[i].index);
+
+ printf("\tif (substr(\"%s%s\", %d) ne \"%s\") {\n",
+ this->str, this->str2, command[i].index, this->result);
+
+ printf("\t\tprintf(\"perl => substr(\\\"%s%s\\\", %d) = ",
+ this->str, this->str2, command[i].index);
+ printf("\\\"%%s\\\"\\n\",\n\t\t substr(\"%s%s\", %d));\n",
+ this->str, this->str2, command[i].index);
+ printf("\t\tprintf(\" D => substr(\\\"%s%s\\\", %d) = ",
+ this->str, this->str2, command[i].index);
+ printf("\\\"%%s\\\"\\n\",\n\t\t \"%s\");\n", this->result);
+ printf("\t\t$failed++;\n");
+ printf("\t}\n\n");
+}
+
+tick-1ms
+/i < end && !command[i].nolen/
+{
+ this->str = command[i].alt ? altstr : str;
+ this->str2 = command[i].alt ? altstr2 : str2;
+ this->result = substr(command[i].alt ?
+ "CRAIG: Positioned them, I don't know... I'm fairly wide guy." :
+ str, command[i].index, command[i].length);
+
+ printf("\tif (substr(\"%s%s\", %d, %d) ne \"%s\") {\n",
+ this->str, this->str2, command[i].index, command[i].length,
+ this->result);
+ printf("\t\tprintf(\"perl => substr(\\\"%s%s\\\", %d, %d) = ",
+ this->str, this->str2, command[i].index, command[i].length);
+ printf("\\\"%%s\\\"\\n\",\n\t\t substr(\"%s%s\", %d, %d));\n",
+ this->str, this->str2, command[i].index, command[i].length);
+ printf("\t\tprintf(\" D => substr(\\\"%s%s\\\", %d, %d) = ",
+ this->str, this->str2, command[i].index, command[i].length);
+ printf("\\\"%%s\\\"\\n\",\n\t\t \"%s\");\n", this->result);
+ printf("\t\t$failed++;\n");
+ printf("\t}\n\n");
+}
+
+tick-1ms
+/++i == end/
+{
+ printf("\texit($failed);\n}\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out
new file mode 100644
index 000000000000..5b498ef36be9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out
@@ -0,0 +1,254 @@
+#!/usr/perl5/bin/perl
+
+BEGIN {
+ if (substr("foobarbazbop", 3) ne "barbazbop") {
+ printf("perl => substr(\"foobarbazbop\", 3) = \"%s\"\n",
+ substr("foobarbazbop", 3));
+ printf(" D => substr(\"foobarbazbop\", 3) = \"%s\"\n",
+ "barbazbop");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 300) ne "") {
+ printf("perl => substr(\"foobarbazbop\", 300) = \"%s\"\n",
+ substr("foobarbazbop", 300));
+ printf(" D => substr(\"foobarbazbop\", 300) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", -10) ne "obarbazbop") {
+ printf("perl => substr(\"foobarbazbop\", -10) = \"%s\"\n",
+ substr("foobarbazbop", -10));
+ printf(" D => substr(\"foobarbazbop\", -10) = \"%s\"\n",
+ "obarbazbop");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 0) ne "foobarbazbop") {
+ printf("perl => substr(\"foobarbazbop\", 0) = \"%s\"\n",
+ substr("foobarbazbop", 0));
+ printf(" D => substr(\"foobarbazbop\", 0) = \"%s\"\n",
+ "foobarbazbop");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 1) ne "oobarbazbop") {
+ printf("perl => substr(\"foobarbazbop\", 1) = \"%s\"\n",
+ substr("foobarbazbop", 1));
+ printf(" D => substr(\"foobarbazbop\", 1) = \"%s\"\n",
+ "oobarbazbop");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 11) ne "p") {
+ printf("perl => substr(\"foobarbazbop\", 11) = \"%s\"\n",
+ substr("foobarbazbop", 11));
+ printf(" D => substr(\"foobarbazbop\", 11) = \"%s\"\n",
+ "p");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 12) ne "") {
+ printf("perl => substr(\"foobarbazbop\", 12) = \"%s\"\n",
+ substr("foobarbazbop", 12));
+ printf(" D => substr(\"foobarbazbop\", 12) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 13) ne "") {
+ printf("perl => substr(\"foobarbazbop\", 13) = \"%s\"\n",
+ substr("foobarbazbop", 13));
+ printf(" D => substr(\"foobarbazbop\", 13) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 8, 20) ne "zbop") {
+ printf("perl => substr(\"foobarbazbop\", 8, 20) = \"%s\"\n",
+ substr("foobarbazbop", 8, 20));
+ printf(" D => substr(\"foobarbazbop\", 8, 20) = \"%s\"\n",
+ "zbop");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 4, 4) ne "arba") {
+ printf("perl => substr(\"foobarbazbop\", 4, 4) = \"%s\"\n",
+ substr("foobarbazbop", 4, 4));
+ printf(" D => substr(\"foobarbazbop\", 4, 4) = \"%s\"\n",
+ "arba");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 5, 8) ne "rbazbop") {
+ printf("perl => substr(\"foobarbazbop\", 5, 8) = \"%s\"\n",
+ substr("foobarbazbop", 5, 8));
+ printf(" D => substr(\"foobarbazbop\", 5, 8) = \"%s\"\n",
+ "rbazbop");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 5, 9) ne "rbazbop") {
+ printf("perl => substr(\"foobarbazbop\", 5, 9) = \"%s\"\n",
+ substr("foobarbazbop", 5, 9));
+ printf(" D => substr(\"foobarbazbop\", 5, 9) = \"%s\"\n",
+ "rbazbop");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 400, 20) ne "") {
+ printf("perl => substr(\"foobarbazbop\", 400, 20) = \"%s\"\n",
+ substr("foobarbazbop", 400, 20));
+ printf(" D => substr(\"foobarbazbop\", 400, 20) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 400, 0) ne "") {
+ printf("perl => substr(\"foobarbazbop\", 400, 0) = \"%s\"\n",
+ substr("foobarbazbop", 400, 0));
+ printf(" D => substr(\"foobarbazbop\", 400, 0) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 400, -1) ne "") {
+ printf("perl => substr(\"foobarbazbop\", 400, -1) = \"%s\"\n",
+ substr("foobarbazbop", 400, -1));
+ printf(" D => substr(\"foobarbazbop\", 400, -1) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 3, 0) ne "") {
+ printf("perl => substr(\"foobarbazbop\", 3, 0) = \"%s\"\n",
+ substr("foobarbazbop", 3, 0));
+ printf(" D => substr(\"foobarbazbop\", 3, 0) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 3, -1) ne "barbazbo") {
+ printf("perl => substr(\"foobarbazbop\", 3, -1) = \"%s\"\n",
+ substr("foobarbazbop", 3, -1));
+ printf(" D => substr(\"foobarbazbop\", 3, -1) = \"%s\"\n",
+ "barbazbo");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 3, -4) ne "barba") {
+ printf("perl => substr(\"foobarbazbop\", 3, -4) = \"%s\"\n",
+ substr("foobarbazbop", 3, -4));
+ printf(" D => substr(\"foobarbazbop\", 3, -4) = \"%s\"\n",
+ "barba");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 3, -20) ne "") {
+ printf("perl => substr(\"foobarbazbop\", 3, -20) = \"%s\"\n",
+ substr("foobarbazbop", 3, -20));
+ printf(" D => substr(\"foobarbazbop\", 3, -20) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", -10, -5) ne "obarb") {
+ printf("perl => substr(\"foobarbazbop\", -10, -5) = \"%s\"\n",
+ substr("foobarbazbop", -10, -5));
+ printf(" D => substr(\"foobarbazbop\", -10, -5) = \"%s\"\n",
+ "obarb");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", 0, 400) ne "foobarbazbop") {
+ printf("perl => substr(\"foobarbazbop\", 0, 400) = \"%s\"\n",
+ substr("foobarbazbop", 0, 400));
+ printf(" D => substr(\"foobarbazbop\", 0, 400) = \"%s\"\n",
+ "foobarbazbop");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", -1, 400) ne "p") {
+ printf("perl => substr(\"foobarbazbop\", -1, 400) = \"%s\"\n",
+ substr("foobarbazbop", -1, 400));
+ printf(" D => substr(\"foobarbazbop\", -1, 400) = \"%s\"\n",
+ "p");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", -1, 0) ne "") {
+ printf("perl => substr(\"foobarbazbop\", -1, 0) = \"%s\"\n",
+ substr("foobarbazbop", -1, 0));
+ printf(" D => substr(\"foobarbazbop\", -1, 0) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", -1, -1) ne "") {
+ printf("perl => substr(\"foobarbazbop\", -1, -1) = \"%s\"\n",
+ substr("foobarbazbop", -1, -1));
+ printf(" D => substr(\"foobarbazbop\", -1, -1) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", -24, 24) ne "foobarbazbop") {
+ printf("perl => substr(\"foobarbazbop\", -24, 24) = \"%s\"\n",
+ substr("foobarbazbop", -24, 24));
+ printf(" D => substr(\"foobarbazbop\", -24, 24) = \"%s\"\n",
+ "foobarbazbop");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", -24, 12) ne "") {
+ printf("perl => substr(\"foobarbazbop\", -24, 12) = \"%s\"\n",
+ substr("foobarbazbop", -24, 12));
+ printf(" D => substr(\"foobarbazbop\", -24, 12) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", -24, 13) ne "f") {
+ printf("perl => substr(\"foobarbazbop\", -24, 13) = \"%s\"\n",
+ substr("foobarbazbop", -24, 13));
+ printf(" D => substr(\"foobarbazbop\", -24, 13) = \"%s\"\n",
+ "f");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", -12, 12) ne "foobarbazbop") {
+ printf("perl => substr(\"foobarbazbop\", -12, 12) = \"%s\"\n",
+ substr("foobarbazbop", -12, 12));
+ printf(" D => substr(\"foobarbazbop\", -12, 12) = \"%s\"\n",
+ "foobarbazbop");
+ $failed++;
+ }
+
+ if (substr("foobarbazbop", -12, 11) ne "foobarbazbo") {
+ printf("perl => substr(\"foobarbazbop\", -12, 11) = \"%s\"\n",
+ substr("foobarbazbop", -12, 11));
+ printf(" D => substr(\"foobarbazbop\", -12, 11) = \"%s\"\n",
+ "foobarbazbo");
+ $failed++;
+ }
+
+ if (substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100, 10) ne "") {
+ printf("perl => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100, 10) = \"%s\"\n",
+ substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100, 10));
+ printf(" D => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100, 10) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ if (substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100) ne "") {
+ printf("perl => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100) = \"%s\"\n",
+ substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100));
+ printf(" D => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100) = \"%s\"\n",
+ "");
+ $failed++;
+ }
+
+ exit($failed);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d
new file mode 100644
index 000000000000..2c025410d443
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+#pragma D option aggsortkey
+
+/*
+ * This is to check that we're correctly null-terminating the result of the
+ * substr() subroutine.
+ */
+
+tick-1ms
+/i++ > 1000/
+{
+ exit(0);
+}
+
+tick-1ms
+{
+ @[substr((i & 1) ? "Bryan is smart" : "he's not a dummy", 0,
+ (i & 1) ? 8 : 18)] = count();
+}
+
+END
+{
+ printa("%s\n", @);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d.out
new file mode 100644
index 000000000000..26c19aa2c5a3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d.out
@@ -0,0 +1,3 @@
+Bryan is
+he's not a dummy
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d
new file mode 100644
index 000000000000..b7ffbfa4329c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+#pragma D option destructive
+
+BEGIN
+{
+ this->a = 9;
+ this->b = -2;
+
+ system("echo %s %d %d", "foo", this->a, this->b);
+ system("ping localhost");
+ system("echo %d", ++this->a);
+ system("ping localhost");
+ system("echo %d", ++this->a);
+ system("ping localhost");
+ system("echo %d", ++this->a);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d.out
new file mode 100644
index 000000000000..cd0d735f0fb2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d.out
@@ -0,0 +1,8 @@
+foo 9 -2
+localhost is alive
+10
+localhost is alive
+11
+localhost is alive
+12
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.tolower.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.tolower.d
new file mode 100644
index 000000000000..2539630e9d66
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.tolower.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+
+ input[i] = "ahi";
+ expected[i++] = "ahi";
+
+ input[i] = "MaHi!";
+ expected[i++] = "mahi!";
+
+ input[i] = " Nase-5";
+ expected[i++] = " nase-5";
+
+ input[i] = "!@#$%";
+ expected[i++] = "!@#$%";
+
+ i = 0;
+}
+
+tick-1ms
+/input[i] != NULL && (this->out = tolower(input[i])) != expected[i]/
+{
+ printf("expected tolower(\"%s\") to be \"%s\"; found \"%s\"\n",
+ input[i], expected[i], this->out);
+ exit(1);
+}
+
+tick-1ms
+/input[i] != NULL/
+{
+ printf("tolower(\"%s\") is \"%s\", as expected\n",
+ input[i], expected[i]);
+}
+
+tick-1ms
+/input[i++] == NULL/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.toupper.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.toupper.d
new file mode 100644
index 000000000000..fd803f2ef0af
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.toupper.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+
+ input[i] = "ahi";
+ expected[i++] = "AHI";
+
+ input[i] = "MaHi!";
+ expected[i++] = "MAHI!";
+
+ input[i] = " dace-9";
+ expected[i++] = " DACE-9";
+
+ input[i] = "!@#$%";
+ expected[i++] = "!@#$%";
+
+ i = 0;
+}
+
+tick-1ms
+/input[i] != NULL && (this->out = toupper(input[i])) != expected[i]/
+{
+ printf("expected toupper(\"%s\") to be \"%s\"; found \"%s\"\n",
+ input[i], expected[i], this->out);
+ exit(1);
+}
+
+tick-1ms
+/input[i] != NULL/
+{
+ printf("toupper(\"%s\") is \"%s\", as expected\n",
+ input[i], expected[i]);
+}
+
+tick-1ms
+/input[i++] == NULL/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/err.D_ADDROF_LVAL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/err.D_ADDROF_LVAL.d
new file mode 100644
index 000000000000..8f5d694ae51b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/err.D_ADDROF_LVAL.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * & can not be applied to a non-lvalue
+ *
+ * SECTION: Pointers and Arrays/Pointers and Addresses
+ *
+ */
+
+BEGIN
+{
+ trace(&1);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/err.D_EMPTY.empty.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/err.D_EMPTY.empty.d
new file mode 100644
index 000000000000..929ccc69ce84
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/err.D_EMPTY.empty.d
@@ -0,0 +1,34 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test the "empty translation unit" error path.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/tst.clauses.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/tst.clauses.d
new file mode 100644
index 000000000000..a9930292eff3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/tst.clauses.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test the kinds of probe definition clause grammar rules.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations;
+ * Program Structure/Actions
+ */
+
+
+BEGIN
+{}
+
+BEGIN
+/1/
+{}
+
+tick-1
+{
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/tst.stmts.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/tst.stmts.d
new file mode 100644
index 000000000000..03a015ad3229
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/tst.stmts.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test the various kinds of D probe description statement
+ * rules in the grammar.
+ *
+ * SECTION: Program Structure/Probe Descriptions
+ *
+ */
+
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-1
+/i != 20/
+{
+ i++;
+ x = 0;
+ stack();
+ @a = count();
+ @b = max(x);
+ @c[x] = count();
+ @d[x] = max(x);
+}
+
+tick-1
+/i = 20/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/tst.includefirst.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/tst.includefirst.ksh
new file mode 100644
index 000000000000..b8240d64367c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/include/tst.includefirst.ksh
@@ -0,0 +1,76 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2011, Joyent Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test verifies that we only use the first entry of a file with a given
+# name in the library path
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+firstinc=${TMPDIR:-/tmp}/firstinc.$$
+secondinc=${TMPDIR:-/tmp}/secondinc.$$
+expexit=23
+
+setup_include()
+{
+ mkdir $firstinc
+ mkdir $secondinc
+ cat > $firstinc/lib.d <<EOF
+inline int foobar = $expexit;
+#pragma D binding "1.0" foobar
+EOF
+ cat > $secondinc/lib.d <<EOF
+inline int foobar = 42;
+#pragma D binding "1.0" foobar
+EOF
+}
+
+clean()
+{
+ rm -rf $firstinc
+ rm -rf $secondinc
+}
+
+fail()
+{
+ echo "$@"
+ clean
+ exit 1
+}
+
+setup_include
+
+dtrace -L$firstinc -L$secondinc -e -n 'BEGIN{ exit(foobar) }'
+[[ $? != 0 ]] && fail "Failed to compile with same file in include path twice"
+dtrace -L$firstinc -L$secondinc -n 'BEGIN{ exit(foobar) }'
+status=$?
+[[ $status != $expexit ]] && fail "Exited with unexpected status code: $status"
+clean
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef1.d
new file mode 100644
index 000000000000..39f2996ad277
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef1.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Test handling of an inline definition that overrides a previous
+ * definition of an inline definition.
+ *
+ * SECTION: Type and Constant Definitions/Inlines
+ *
+ * NOTES:
+ *
+ */
+
+inline int foo = timestamp;
+inline int foo = 8;
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef2.d
new file mode 100644
index 000000000000..1df590802866
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef2.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Test handling of an inline definition that overrides a previous
+ * definition of a dtrace built-in function.
+ *
+ * SECTION: Type and Constant Definitions/Inlines
+ *
+ * NOTES:
+ *
+ */
+
+inline int rand = 7;
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_IDENT_UNDEF.recur.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_IDENT_UNDEF.recur.d
new file mode 100644
index 000000000000..95522d0eb60a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_IDENT_UNDEF.recur.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * D program to test recursive inline definitions. This script should
+ * properly detect that foo is undefined on the right-hand side and fail.
+ *
+ * SECTION: Type and Constant Definitions/Inlines
+ *
+ * NOTES:
+ *
+ */
+
+inline int foo = foo + 3;
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef1.d
new file mode 100644
index 000000000000..a42afb747e97
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef1.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Attempt to create an invalid inline definition by creating an
+ * inline of a function type. This should fail to compile.
+ *
+ * SECTION: Type and Constant Definitions/Inlines
+ *
+ * NOTES:
+ *
+ */
+
+inline cyc_func_t i = "i am a cyclic function";
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef2.d
new file mode 100644
index 000000000000..9a246b4b123e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef2.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Attempt to create an invalid inline definition by creating an
+ * inline of incompatible types. This should fail to compile.
+ *
+ * SECTION: Type and Constant Definitions/Inlines
+ *
+ * NOTES:
+ *
+ */
+
+inline int i = "i am a string";
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d
new file mode 100644
index 000000000000..963b604839a3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Test an invalid inline definition of a translator. An inlined translation
+ * must have the same type as the translator output.
+ *
+ * SECTION: Type and Constant Definitions/Inlines
+ *
+ * NOTES:
+ *
+ */
+
+inline vfs_t *invalid = xlate<psinfo_t>(curthread->t_procp);
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineDataAssign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineDataAssign.d
new file mode 100644
index 000000000000..c7ab62fd9ce6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineDataAssign.d
@@ -0,0 +1,68 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Declare different types of inline data types.
+ *
+ * SECTION: Type and Constant Definitions/Inlines
+ *
+ * NOTES: The commented lines defining floats and doubles should be uncommented
+ * once the functionality is provided.
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+inline char new_char = 'c';
+inline short new_short = 10;
+inline int new_int = 100;
+inline long new_long = 1234567890;
+inline long long new_long_long = 1234512345;
+inline int8_t new_int8 = 'p';
+inline int16_t new_int16 = 20;
+inline int32_t new_int32 = 200;
+inline int64_t new_int64 = 2000000;
+inline intptr_t new_intptr = 0x12345;
+inline uint8_t new_uint8 = 'q';
+inline uint16_t new_uint16 = 30;
+inline uint32_t new_uint32 = 300;
+inline uint64_t new_uint64 = 3000000;
+inline uintptr_t new_uintptr = 0x67890;
+/* inline float new_float = 1.23456;
+inline double new_double = 2.34567890;
+inline long double new_long_double = 3.567890123;
+*/
+
+inline int * pointer = &`kmem_flags;
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineExpression.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineExpression.d
new file mode 100644
index 000000000000..d67d3f27d0fe
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineExpression.d
@@ -0,0 +1,80 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ *
+ * Test different inline assignments by various expressions.
+ *
+ * SECTION: Type and Constant Definitions/Inlines
+ *
+ * NOTES: The commented lines for the floats and doubles should be uncommented
+ * once the functionality is implemented.
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+inline char new_char = 'c' + 2;
+inline short new_short = 10 * new_char;
+inline int new_int = 100 + new_short;
+inline long new_long = 1234567890;
+inline long long new_long_long = 1234512345 * new_long;
+inline int8_t new_int8 = 'p';
+inline int16_t new_int16 = 20 / new_int8;
+inline int32_t new_int32 = 200;
+inline int64_t new_int64 = 2000000 * (-new_int16);
+inline intptr_t new_intptr = 0x12345 - 129;
+inline uint8_t new_uint8 = 'q';
+inline uint16_t new_uint16 = 30 - new_uint8;
+inline uint32_t new_uint32 = 300 - 0;
+inline uint64_t new_uint64 = 3000000;
+inline uintptr_t new_uintptr = 0x67890 / new_uint64;
+
+/* inline float new_float = 1.23456;
+inline double new_double = 2.34567890;
+inline long double new_long_double = 3.567890123;
+*/
+
+inline int * pointer = &`kmem_flags;
+inline int result = 3 > 2 ? 3 : 2;
+
+BEGIN
+{
+ printf("new_char: %c\nnew_short: %d\nnew_int: %d\nnew_long: %d\n",
+ new_char, new_short, new_int, new_long);
+ printf("new_long_long: %d\nnew_int8: %d\nnew_int16: %d\n",
+ new_long_long, new_int8, new_int16);
+ printf("new_int32: %d\nnew_int64: %d\n", new_int32, new_int64);
+ printf("new_intptr: %d\nnew_uint8: %d\nnew_uint16: %d\n",
+ new_intptr, new_uint8, new_uint16);
+ printf("new_uint32:%d\nnew_uint64: %d\nnew_uintptr:%d\nresult:%d",
+ new_uint32, new_uint64, new_uintptr, result);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d
new file mode 100644
index 000000000000..7f188fb0d575
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * Test the code generation and results of the various kinds of inlines.
+ * In particular, we test constant and expression-based scalar inlines,
+ * associative array inlines, and inlines using translators.
+ */
+
+#pragma D option quiet
+
+inline int i0 = 100 + 23; /* constant-folded integer constant */
+inline string i1 = probename; /* string variable reference */
+inline int i2 = pid != 0; /* expression involving a variable */
+
+struct s {
+ int s_x;
+};
+
+translator struct s < int T > {
+ s_x = T + 1;
+};
+
+inline struct s i3 = xlate < struct s > (i0); /* translator */
+inline int i4[int x, int y] = x + y; /* associative array */
+inline int i5[int x] = (xlate < struct s > (x)).s_x; /* array by xlate */
+
+BEGIN
+{
+ printf("i0 = %d\n", i0);
+ printf("i1 = %s\n", i1);
+ printf("i2 = %d\n", i2);
+
+ printf("i3.s_x = %d\n", i3.s_x);
+ printf("i4[10, 20] = %d\n", i4[10, 20]);
+ printf("i5[123] = %d\n", i5[123]);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d.out
new file mode 100644
index 000000000000..c9a603b24ef0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d.out
@@ -0,0 +1,7 @@
+i0 = 123
+i1 = BEGIN
+i2 = 1
+i3.s_x = 124
+i4[10, 20] = 30
+i5[123] = 124
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineTypedef.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineTypedef.d
new file mode 100644
index 000000000000..a6247659afa8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineTypedef.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Create inline names from aliases created using typedef.
+ *
+ * SECTION: Type and Constant Definitions/Inlines
+ *
+ * NOTES:
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+typedef char new_char;
+inline new_char char_var = 'c';
+
+typedef int * pointer;
+inline pointer p = &`kmem_flags;
+
+BEGIN
+{
+ printf("char_var: %c\npointer p: %d", char_var, *p);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineWritableAssign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineWritableAssign.d
new file mode 100644
index 000000000000..a7842a334da3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineWritableAssign.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Create inline names from aliases created using typedef.
+ *
+ * SECTION: Type and Constant Definitions/Inlines
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+struct record {
+ char c;
+ int i;
+};
+
+struct record rec1;
+inline struct record rec2 = rec1;
+
+union var {
+ char c;
+ int i;
+};
+
+union var un1;
+inline union var un2 = un1;
+
+
+BEGIN
+{
+ rec1.c = 'c';
+ rec1.i = 10;
+
+ un1.c = 'd';
+
+ printf("rec1.c: %c\nrec1.i:%d\nun1.c: %c\n", rec1.c, rec1.i, un1.c);
+ printf("rec2.c: %c\nrec2.i:%d\nun2.c: %c\n", rec2.c, rec2.i, un2.c);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c
new file mode 100644
index 000000000000..3cded11e8529
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c
@@ -0,0 +1,100 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <assert.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+
+static sigjmp_buf env;
+
+static void
+interrupt(int sig)
+{
+ siglongjmp(env, sig);
+}
+
+int
+main(int argc, char *argv[])
+{
+ const char *file = "/dev/null";
+ int i, n, fds[10];
+ struct sigaction act;
+
+ if (argc > 1) {
+ (void) fprintf(stderr, "Usage: %s\n", argv[0]);
+ return (EXIT_FAILURE);
+ }
+
+ act.sa_handler = interrupt;
+ act.sa_flags = 0;
+
+ (void) sigemptyset(&act.sa_mask);
+ (void) sigaction(SIGUSR1, &act, NULL);
+
+ closefrom(0);
+ n = 0;
+
+ /*
+ * With all of our file descriptors closed, wait here spinning in bogus
+ * ioctl() calls until DTrace hits us with a SIGUSR1 to start the test.
+ */
+ if (sigsetjmp(env, 1) == 0) {
+ for (;;)
+ (void) ioctl(-1, -1, NULL);
+ }
+
+ /*
+ * To test the fds[] array, we open /dev/null (a file with reliable
+ * pathname and properties) using various flags and seek offsets.
+ */
+ fds[n++] = open(file, O_RDONLY);
+ fds[n++] = open(file, O_WRONLY);
+ fds[n++] = open(file, O_RDWR);
+
+ fds[n++] = open(file, O_RDWR | O_APPEND | O_CREAT | O_DSYNC |
+ O_LARGEFILE | O_NOCTTY | O_NONBLOCK | O_NDELAY | O_RSYNC |
+ O_SYNC | O_TRUNC | O_XATTR, 0666);
+
+ fds[n++] = open(file, O_RDWR);
+ (void) lseek(fds[n - 1], 123, SEEK_SET);
+
+ /*
+ * Once we have all the file descriptors in the state we want to test,
+ * issue a bogus ioctl() on each fd with cmd -1 and arg NULL to whack
+ * our DTrace script into recording the content of the fds[] array.
+ */
+ for (i = 0; i < n; i++)
+ (void) ioctl(fds[i], -1, NULL);
+
+ assert(n <= sizeof (fds) / sizeof (fds[0]));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d
new file mode 100644
index 000000000000..52a3312da984
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option destructive
+#pragma D option quiet
+
+syscall::ioctl:entry
+/pid == $1 && arg0 == -1u/
+{
+ raise(SIGUSR1); /* kick tst.fds.c out of its busy-wait loop */
+}
+
+syscall::ioctl:entry
+/pid == $1 && arg0 != -1u && arg1 == -1u && arg2 == NULL/
+{
+ printf("fds[%d] fi_name = %s\n", arg0, fds[arg0].fi_name);
+ printf("fds[%d] fi_dirname = %s\n", arg0, fds[arg0].fi_dirname);
+ printf("fds[%d] fi_pathname = %s\n", arg0, fds[arg0].fi_pathname);
+ printf("fds[%d] fi_fs = %s\n", arg0, fds[arg0].fi_fs);
+ printf("fds[%d] fi_mount = %s\n", arg0, fds[arg0].fi_mount);
+ printf("fds[%d] fi_offset = %d\n", arg0, fds[arg0].fi_offset);
+ printf("fds[%d] fi_oflags = 0x%x\n", arg0, fds[arg0].fi_oflags);
+}
+
+proc:::exit
+/pid == $1/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d.out
new file mode 100644
index 000000000000..9d268268570d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d.out
@@ -0,0 +1,36 @@
+fds[0] fi_name = mm@0:null
+fds[0] fi_dirname = /devices/pseudo
+fds[0] fi_pathname = /devices/pseudo/mm@0:null
+fds[0] fi_fs = specfs
+fds[0] fi_mount = /devices
+fds[0] fi_offset = 0
+fds[0] fi_oflags = 0x0
+fds[1] fi_name = mm@0:null
+fds[1] fi_dirname = /devices/pseudo
+fds[1] fi_pathname = /devices/pseudo/mm@0:null
+fds[1] fi_fs = specfs
+fds[1] fi_mount = /devices
+fds[1] fi_offset = 0
+fds[1] fi_oflags = 0x1
+fds[2] fi_name = mm@0:null
+fds[2] fi_dirname = /devices/pseudo
+fds[2] fi_pathname = /devices/pseudo/mm@0:null
+fds[2] fi_fs = specfs
+fds[2] fi_mount = /devices
+fds[2] fi_offset = 0
+fds[2] fi_oflags = 0x2
+fds[3] fi_name = mm@0:null
+fds[3] fi_dirname = /devices/pseudo
+fds[3] fi_pathname = /devices/pseudo/mm@0:null
+fds[3] fi_fs = specfs
+fds[3] fi_mount = /devices
+fds[3] fi_offset = 0
+fds[3] fi_oflags = 0xebda
+fds[4] fi_name = mm@0:null
+fds[4] fi_dirname = /devices/pseudo
+fds[4] fi_pathname = /devices/pseudo/mm@0:null
+fds[4] fi_fs = specfs
+fds[4] fi_mount = /devices
+fds[4] fi_offset = 123
+fds[4] fi_oflags = 0x2
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl
new file mode 100755
index 000000000000..ccc247dec514
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl
@@ -0,0 +1,104 @@
+#!/usr/bin/perl -w
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#
+# get.ipv4remote.pl [tcpport]
+#
+# Find an IPv4 reachable remote host using both ifconfig(1M) and ping(1M).
+# If a tcpport is specified, return a host that is also listening on this
+# TCP port. Print the local address and the remote address, or an
+# error message if no suitable remote host was found. Exit status is 0 if
+# a host was found.
+#
+
+use strict;
+use IO::Socket;
+
+my $MAXHOSTS = 32; # max hosts to port scan
+my $TIMEOUT = 3; # connection timeout
+my $tcpport = @ARGV == 1 ? $ARGV[0] : 0;
+
+#
+# Determine local IP address
+#
+my $local = "";
+my $remote = "";
+my %Broadcast;
+my $up;
+open IFCONFIG, '/sbin/ifconfig -a |' or die "Couldn't run ifconfig: $!\n";
+while (<IFCONFIG>) {
+ next if /^lo/;
+
+ # "UP" is always printed first (see print_flags() in ifconfig.c):
+ $up = 1 if /^[a-z].*<UP,/;
+ $up = 0 if /^[a-z].*<,/;
+
+ # assume output is "inet X ... broadcast Z":
+ if (/inet (\S+) .* broadcast (\S+)/) {
+ my ($addr, $bcast) = ($1, $2);
+ $Broadcast{$addr} = $bcast;
+ $local = $addr if $up and $local eq "";
+ $up = 0;
+ }
+}
+close IFCONFIG;
+die "Could not determine local IP address" if $local eq "";
+
+#
+# Find the first remote host that responds to an icmp echo,
+# which isn't a local address.
+#
+open PING, "/sbin/ping -n -s 56 -c $MAXHOSTS $Broadcast{$local} |" or
+ die "Couldn't run ping: $!\n";
+while (<PING>) {
+ if (/bytes from (.*): / and not defined $Broadcast{$1}) {
+ my $addr = $1;
+
+ if ($tcpport != 0) {
+ #
+ # Test TCP
+ #
+ my $socket = IO::Socket::INET->new(
+ Proto => "tcp",
+ PeerAddr => $addr,
+ PeerPort => $tcpport,
+ Timeout => $TIMEOUT,
+ );
+ next unless $socket;
+ close $socket;
+ }
+
+ $remote = $addr;
+ last;
+ }
+}
+close PING;
+die "Can't find a remote host for testing: No suitable response from " .
+ "$Broadcast{$local}\n" if $remote eq "";
+
+print "$local $remote\n";
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl
new file mode 100755
index 000000000000..35bea8e58fa1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl
@@ -0,0 +1,97 @@
+#!/usr/bin/perl -w
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#
+# get.ipv6remote.pl
+#
+# Find an IPv6 reachable remote host using both ifconfig(1M) and ping(1M).
+# Print the local address and the remote address, or print nothing if either
+# no IPv6 interfaces or remote hosts were found. (Remote IPv6 testing is
+# considered optional, and so not finding another IPv6 host is not an error
+# state we need to log.) Exit status is 0 if a host was found.
+#
+
+use strict;
+use IO::Socket;
+
+my $MAXHOSTS = 32; # max hosts to scan
+my $TIMEOUT = 3; # connection timeout
+my $MULTICAST = "FF02::1"; # IPv6 multicast address
+
+#
+# Determine local IP address
+#
+my $local = "";
+my $remote = "";
+my $interf = "";
+my %Local;
+my %Addr;
+my $up;
+open IFCONFIG, '/sbin/ifconfig -a inet6 |'
+ or die "Couldn't run ifconfig: $!\n";
+while (<IFCONFIG>) {
+ next if /^lo/;
+
+ # "UP" is always printed first (see print_flags() in ifconfig.c):
+ $up = 1 if /^[a-z].*<UP,/;
+ $up = 0 if /^[a-z].*<,/;
+
+ if (m:(\S+\d+)\: :) {
+ $interf = $1;
+ }
+
+ # assume output is "inet6 ...":
+ if (m:inet6 (\S+) :) {
+ my $addr = $1;
+ $Local{$addr} = 1;
+ $Addr{$interf} = $addr;
+ $up = 0;
+ $interf = "";
+ }
+}
+close IFCONFIG;
+
+#
+# Find the first remote host that responds to an icmp echo,
+# which isn't a local address. Try each IPv6-enabled interface.
+#
+foreach $interf (split(' ', `ifconfig -l -u inet6`)) {
+ next if $interf =~ /lo[0-9]+/;
+ open PING, "/sbin/ping6 -n -s 56 -c $MAXHOSTS $MULTICAST\%$interf |" or next;
+ while (<PING>) {
+ if (/bytes from (.*), / and not defined $Local{$1}) {
+ $remote = $1;
+ $local = $Addr{$interf};
+ last;
+ }
+ }
+}
+close PING;
+exit 2 if $remote eq "";
+
+print "$local $remote\n";
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh
new file mode 100755
index 000000000000..0f2b64a2d902
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh
@@ -0,0 +1,70 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#
+# Test ip:::{send,receive} of IPv4 ICMP to a local address.
+#
+# This may fail due to:
+#
+# 1. A change to the ip stack breaking expected probe behavior,
+# which is the reason we are testing.
+# 2. The lo0 interface missing or not up.
+# 3. Unrelated ICMP on lo0 traced by accident.
+#
+
+if (( $# != 1 )); then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+local=127.0.0.1
+
+$dtrace -c "/sbin/ping $local 3" -qs /dev/stdin <<EOF | sort -n
+ip:::send
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->ipv4_protocol == IPPROTO_ICMP/
+{
+ printf("1 ip:::send (");
+ printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
+ printf("args[4]: %d %d %d %d %d)\n",
+ args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags,
+ args[4]->ipv4_offset, args[4]->ipv4_ttl);
+}
+
+ip:::receive
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->ipv4_protocol == IPPROTO_ICMP/
+{
+ printf("2 ip:::receive (");
+ printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
+ printf("args[4]: %d %d %d %d %d)\n",
+ args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags,
+ args[4]->ipv4_offset, args[4]->ipv4_ttl);
+}
+EOF
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh.out
new file mode 100644
index 000000000000..41d6e0c8ad41
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh.out
@@ -0,0 +1,6 @@
+
+1 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 255)
+1 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 255)
+2 ip:::receive (args[2]: 4 64, args[4]: 4 84 0 0 255)
+2 ip:::receive (args[2]: 4 64, args[4]: 4 84 0 0 255)
+127.0.0.1 is alive
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
new file mode 100755
index 000000000000..c18dc7625d8e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
@@ -0,0 +1,125 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# Test {ip,tcp}:::{send,receive} of IPv4 TCP to local host.
+#
+# This may fail due to:
+#
+# 1. A change to the ip stack breaking expected probe behavior,
+# which is the reason we are testing.
+# 2. The lo0 interface missing or not up.
+# 3. The local ssh service is not online.
+# 4. An unlikely race causes the unlocked global send/receive
+# variables to be corrupted.
+#
+# This test performs a TCP connection and checks that at least the
+# following packet counts were traced:
+#
+# 3 x ip:::send (2 during the TCP handshake, then a FIN)
+# 3 x tcp:::send (2 during the TCP handshake, then a FIN)
+# 2 x ip:::receive (1 during the TCP handshake, then the FIN ACK)
+# 2 x tcp:::receive (1 during the TCP handshake, then the FIN ACK)
+
+# The actual count tested is 5 each way, since we are tracing both
+# source and destination events.
+#
+# For this test to work, we are assuming that the TCP handshake and
+# TCP close will enter the IP code path and not use tcp fusion.
+#
+
+if (( $# != 1 )); then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+local=127.0.0.1
+tcpport=22
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.pl <<-EOPERL
+ use IO::Socket;
+ my \$s = IO::Socket::INET->new(
+ Proto => "tcp",
+ PeerAddr => "$local",
+ PeerPort => $tcpport,
+ Timeout => 3);
+ die "Could not connect to host $local port $tcpport" unless \$s;
+ close \$s;
+EOPERL
+
+$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
+BEGIN
+{
+ ipsend = tcpsend = ipreceive = tcpreceive = 0;
+}
+
+ip:::send
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->ipv4_protocol == IPPROTO_TCP/
+{
+ ipsend++;
+}
+
+tcp:::send
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/
+{
+ tcpsend++;
+}
+
+ip:::receive
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->ipv4_protocol == IPPROTO_TCP/
+{
+ ipreceive++;
+}
+
+tcp:::receive
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/
+{
+ tcpreceive++;
+}
+
+END
+{
+ printf("Minimum TCP events seen\n\n");
+ printf("ip:::send - %s\n", ipsend >= 5 ? "yes" : "no");
+ printf("ip:::receive - %s\n", ipreceive >= 5 ? "yes" : "no");
+ printf("tcp:::send - %s\n", tcpsend >= 5 ? "yes" : "no");
+ printf("tcp:::receive - %s\n", tcpreceive >= 5 ? "yes" : "no");
+}
+EODTRACE
+
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh.out
new file mode 100644
index 000000000000..2a85b98b6b7d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh.out
@@ -0,0 +1,7 @@
+Minimum TCP events seen
+
+ip:::send - yes
+ip:::receive - yes
+tcp:::send - yes
+tcp:::receive - yes
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
new file mode 100755
index 000000000000..6d08e24a9fbd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
@@ -0,0 +1,93 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# Test ip:::{send,receive} of IPv4 UDP to a local address.
+#
+# This may fail due to:
+#
+# 1. A change to the ip stack breaking expected probe behavior,
+# which is the reason we are testing.
+# 2. No physical network interface is plumbed and up.
+# 3. No other hosts on this subnet are reachable and listening on rpcbind.
+# 4. An unlikely race causes the unlocked global send/receive
+# variables to be corrupted.
+#
+# This test sends a UDP message using ping and checks that at least the
+# following counts were traced:
+#
+# 1 x ip:::send (UDP sent to ping's base UDP port)
+# 1 x udp:::send (UDP sent to ping's base UDP port)
+# 1 x ip:::receive (UDP received)
+#
+# No udp:::receive event is expected as the response ping -U elicits is
+# an ICMP PORT_UNREACHABLE response rather than a UDP packet, and locally
+# the echo request UDP packet only reaches IP, so the udp:::receive probe
+# is not triggered by it.
+#
+
+if (( $# != 1 )); then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+local=127.0.0.1
+
+$dtrace -c "/sbin/ping -U $local" -qs /dev/stdin <<EOF | grep -v 'is alive'
+BEGIN
+{
+ ipsend = udpsend = ipreceive = 0;
+}
+
+ip:::send
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->ipv4_protocol == IPPROTO_UDP/
+{
+ ipsend++;
+}
+
+udp:::send
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/
+{
+ udpsend++;
+}
+
+ip:::receive
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->ipv4_protocol == IPPROTO_UDP/
+{
+ ipreceive++;
+}
+
+END
+{
+ printf("Minimum UDP events seen\n\n");
+ printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no");
+ printf("ip:::receive - %s\n", ipreceive >= 1 ? "yes" : "no");
+ printf("udp:::send - %s\n", udpsend >= 1 ? "yes" : "no");
+}
+EOF
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out
new file mode 100644
index 000000000000..bca55327ef57
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out
@@ -0,0 +1,6 @@
+Minimum UDP events seen
+
+ip:::send - yes
+ip:::receive - yes
+udp:::send - yes
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh
new file mode 100755
index 000000000000..87553ea71107
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh
@@ -0,0 +1,81 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#
+# Test ip:::{send,receive} of IPv4 ICMP to a remote host.
+#
+# This may fail due to:
+#
+# 1. A change to the ip stack breaking expected probe behavior,
+# which is the reason we are testing.
+# 2. No physical network interface is plumbed and up.
+# 3. No other hosts on this subnet are reachable.
+# 4. An unrelated ICMP between these hosts was traced by accident.
+#
+
+if (( $# != 1 )); then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+getaddr=./get.ipv4remote.pl
+
+if [[ ! -x $getaddr ]]; then
+ print -u2 "could not find or execute sub program: $getaddr"
+ exit 3
+fi
+$getaddr | read source dest
+if (( $? != 0 )); then
+ exit 4
+fi
+
+$dtrace -c "/sbin/ping $dest 3" -qs /dev/stdin <<EOF | \
+ grep -v 'is alive' | sort -n
+ip:::send
+/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" &&
+ args[4]->ipv4_protocol == IPPROTO_ICMP/
+{
+ printf("1 ip:::send (");
+ printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
+ printf("args[4]: %d %d %d %d %d)\n",
+ args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags,
+ args[4]->ipv4_offset, args[4]->ipv4_ttl);
+}
+
+ip:::receive
+/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" &&
+ args[4]->ipv4_protocol == IPPROTO_ICMP/
+{
+ printf("2 ip:::receive (");
+ printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
+ printf("args[4]: %d %d %d %d %d)\n",
+ args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags,
+ args[4]->ipv4_offset, args[4]->ipv4_ttl);
+}
+EOF
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh.out
new file mode 100644
index 000000000000..b5915f8db477
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh.out
@@ -0,0 +1,3 @@
+
+1 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 255)
+2 ip:::receive (args[2]: 4 64, args[4]: 4 84 4 0 255)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
new file mode 100755
index 000000000000..e513ace0be64
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
@@ -0,0 +1,128 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# Test {tcp,ip}:::{send,receive} of IPv4 TCP to a remote host.
+#
+# This may fail due to:
+#
+# 1. A change to the ip stack breaking expected probe behavior,
+# which is the reason we are testing.
+# 2. No physical network interface is plumbed and up.
+# 3. No other hosts on this subnet are reachable and listening on ssh.
+# 4. An unlikely race causes the unlocked global send/receive
+# variables to be corrupted.
+#
+# This test performs a TCP connection and checks that at least the
+# following packet counts were traced:
+#
+# 3 x ip:::send (2 during the TCP handshake, then a FIN)
+# 3 x tcp:::send (2 during the TCP handshake, then a FIN)
+# 2 x ip:::receive (1 during the TCP handshake, then the FIN ACK)
+# 2 x tcp:::receive (1 during the TCP handshake, then the FIN ACK)
+#
+
+if (( $# != 1 )); then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+getaddr=./get.ipv4remote.pl
+tcpport=22
+DIR=/var/tmp/dtest.$$
+
+if [[ ! -x $getaddr ]]; then
+ print -u2 "could not find or execute sub program: $getaddr"
+ exit 3
+fi
+$getaddr $tcpport | read source dest
+if (( $? != 0 )); then
+ exit 4
+fi
+
+mkdir $DIR
+cd $DIR
+
+cat > test.pl <<-EOPERL
+ use IO::Socket;
+ my \$s = IO::Socket::INET->new(
+ Proto => "tcp",
+ PeerAddr => "$dest",
+ PeerPort => $tcpport,
+ Timeout => 3);
+ die "Could not connect to host $dest port $tcpport" unless \$s;
+ close \$s;
+EOPERL
+
+$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
+BEGIN
+{
+ ipsend = tcpsend = ipreceive = tcpreceive = 0;
+}
+
+ip:::send
+/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" &&
+ args[4]->ipv4_protocol == IPPROTO_TCP/
+{
+ ipsend++;
+}
+
+tcp:::send
+/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest"/
+{
+ tcpsend++;
+}
+
+ip:::receive
+/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" &&
+ args[4]->ipv4_protocol == IPPROTO_TCP/
+{
+ ipreceive++;
+}
+
+tcp:::receive
+/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source"/
+{
+ tcpreceive++;
+}
+
+END
+{
+ printf("Minimum TCP events seen\n\n");
+ printf("ip:::send - %s\n", ipsend >= 3 ? "yes" : "no");
+ printf("ip:::receive - %s\n", ipreceive >= 2 ? "yes" : "no");
+ printf("tcp:::send - %s\n", tcpsend >= 3 ? "yes" : "no");
+ printf("tcp:::receive - %s\n", tcpreceive >= 2 ? "yes" : "no");
+}
+EODTRACE
+
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $?
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh.out
new file mode 100644
index 000000000000..2a85b98b6b7d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh.out
@@ -0,0 +1,7 @@
+Minimum TCP events seen
+
+ip:::send - yes
+ip:::receive - yes
+tcp:::send - yes
+tcp:::receive - yes
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh
new file mode 100755
index 000000000000..cc7a32c556b1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh
@@ -0,0 +1,88 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# Test {udp,ip}:::{send,receive} of IPv4 UDP to a remote host.
+#
+# This may fail due to:
+#
+# 1. A change to the ip stack breaking expected probe behavior,
+# which is the reason we are testing.
+# 2. No physical network interface is plumbed and up.
+# 3. No other hosts on this subnet are reachable and listening on rpcbind.
+# 4. An unlikely race causes the unlocked global send/receive
+# variables to be corrupted.
+#
+# This test sends a UDP message using ping and checks that at least the
+# following counts were traced:
+#
+# 1 x ip:::send (UDP sent to ping's base UDP port)
+# 1 x udp:::send (UDP sent to ping's base UDP port)
+#
+
+if (( $# != 1 )); then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+getaddr=./get.ipv4remote.pl
+
+if [[ ! -x $getaddr ]]; then
+ print -u2 "could not find or execute sub program: $getaddr"
+ exit 3
+fi
+$getaddr | read source dest
+if (( $? != 0 )); then
+ exit 4
+fi
+
+$dtrace -c "/sbin/ping -U $dest" -qs /dev/stdin <<EOF | grep -v 'is alive'
+BEGIN
+{
+ ipsend = udpsend = 0;
+}
+
+ip:::send
+/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" &&
+ args[4]->ipv4_protocol == IPPROTO_UDP/
+{
+ ipsend++;
+}
+
+udp:::send
+/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest"/
+{
+ udpsend++;
+}
+
+END
+{
+ printf("Minimum UDP events seen\n\n");
+ printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no");
+ printf("udp:::send - %s\n", udpsend >= 1 ? "yes" : "no");
+}
+EOF
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh.out
new file mode 100644
index 000000000000..bdbbe1fd6562
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh.out
@@ -0,0 +1,5 @@
+Minimum UDP events seen
+
+ip:::send - yes
+udp:::send - yes
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh
new file mode 100755
index 000000000000..f63d1ed766bc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh
@@ -0,0 +1,82 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#
+# Test ip:::{send,receive} of IPv6 ICMP to a local address. This creates a
+# temporary lo0/inet6 interface if one doesn't already exist.
+#
+# This may fail due to:
+#
+# 1. A change to the ip stack breaking expected probe behavior,
+# which is the reason we are testing.
+# 2. Unrelated ICMPv6 on lo0 traced by accident.
+#
+
+if (( $# != 1 )); then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+local=::1
+
+if ! ifconfig lo0 inet6 > /dev/null 2>&1; then
+ if ! ifconfig lo0 inet6 plumb up; then
+ print -u2 "could not plumb lo0 inet6 for testing"
+ exit 3
+ fi
+ removeinet6=1
+else
+ removeinet6=0
+fi
+
+$dtrace -c "/sbin/ping -A inet6 $local 3" -qs /dev/stdin <<EOF | sort -n
+ip:::send
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/
+{
+ printf("1 ip:::send (");
+ printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
+ printf("args[5]: %d %d %d)\n",
+ args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);
+}
+
+ip:::receive
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/
+{
+ printf("2 ip:::receive (");
+ printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
+ printf("args[5]: %d %d %d)\n",
+ args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);
+}
+EOF
+
+if (( removeinet6 )); then
+ ifconfig lo0 inet6 unplumb
+fi
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out
new file mode 100644
index 000000000000..529d251fa06e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out
@@ -0,0 +1,6 @@
+
+::1 is alive
+1 ip:::send (args[2]: 6 64, args[5]: 6 0 64)
+1 ip:::send (args[2]: 6 64, args[5]: 6 0 64)
+2 ip:::receive (args[2]: 6 64, args[5]: 6 0 64)
+2 ip:::receive (args[2]: 6 64, args[5]: 6 0 64)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh
new file mode 100755
index 000000000000..c859e6bfe44f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh
@@ -0,0 +1,88 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#
+# Test ip:::{send,receive} of IPv6 ICMP to a remote host. This test is
+# skipped if there are no physical interfaces configured with IPv6, or no
+# other IPv6 hosts are reachable.
+#
+# This may fail due to:
+#
+# 1. A change to the ip stack breaking expected probe behavior,
+# which is the reason we are testing.
+# 2. An unrelated ICMPv6 between these hosts was traced by accident.
+#
+
+if (( $# != 1 )); then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+getaddr=./get.ipv6remote.pl
+
+if [[ ! -x $getaddr ]]; then
+ print -u2 "could not find or execute sub program: $getaddr"
+ exit 3
+fi
+$getaddr | read source dest
+if (( $? != 0 )); then
+ print -nu2 "Could not find a local IPv6 interface and a remote IPv6 "
+ print -u2 "host. Aborting test.\n"
+ print -nu2 "For this test to continue, a \"ping -ns -A inet6 FF02::1\" "
+ print -u2 "must respond with a\nremote IPv6 host."
+ exit 3
+fi
+
+#
+# Shake loose any ICMPv6 Neighbor advertisement messages before tracing.
+#
+/sbin/ping $dest 3 > /dev/null 2>&1
+
+$dtrace -c "/sbin/ping $dest 3" -qs /dev/stdin <<EOF | \
+ grep -v 'is alive' | sort -n
+ip:::send
+/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" &&
+ args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/
+{
+ printf("1 ip:::send (");
+ printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
+ printf("args[5]: %d %d %d)\n",
+ args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);
+}
+
+ip:::receive
+/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" &&
+ args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/
+{
+ printf("2 ip:::receive (");
+ printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength);
+ printf("args[5]: %d %d %d)\n",
+ args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen);
+}
+EOF
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh.out
new file mode 100644
index 000000000000..1ddcd07b367e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh.out
@@ -0,0 +1,3 @@
+
+1 ip:::send (args[2]: 6 64, args[5]: 6 0 64)
+2 ip:::receive (args[2]: 6 64, args[5]: 6 0 64)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
new file mode 100644
index 000000000000..5e0c7474065f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
@@ -0,0 +1,182 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# Test tcp:::state-change and tcp:::{send,receive} by connecting to
+# the local ssh service and sending a test message. This should result
+# in a "Protocol mismatch" response and a close of the connection.
+# A number of state transition events along with tcp fusion send and
+# receive events for the message should result.
+#
+# This may fail due to:
+#
+# 1. A change to the ip stack breaking expected probe behavior,
+# which is the reason we are testing.
+# 2. The lo0 interface missing or not up.
+# 3. The local ssh service is not online.
+# 4. An unlikely race causes the unlocked global send/receive
+# variables to be corrupted.
+#
+# This test performs a TCP connection to the ssh service (port 22) and
+# checks that at least the following packet counts were traced:
+#
+# 3 x ip:::send (2 during the TCP handshake, then a FIN)
+# 4 x tcp:::send (2 during the TCP handshake, 1 message then a FIN)
+# 2 x ip:::receive (1 during the TCP handshake, then the FIN ACK)
+# 3 x tcp:::receive (1 during the TCP handshake, 1 message then the FIN ACK)
+#
+# The actual ip count tested is 5 each way, since we are tracing both
+# source and destination events. The actual tcp count tested is 7
+# each way, since the TCP fusion send/receive events will not reach IP.
+#
+# For this test to work, we are assuming that the TCP handshake and
+# TCP close will enter the IP code path and not use tcp fusion.
+#
+
+if (( $# != 1 )); then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+local=127.0.0.1
+tcpport=22
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.pl <<-EOPERL
+ use IO::Socket;
+ my \$s = IO::Socket::INET->new(
+ Proto => "tcp",
+ PeerAddr => "$local",
+ PeerPort => $tcpport,
+ Timeout => 3);
+ die "Could not connect to host $local port $tcpport" unless \$s;
+ print \$s "testing state machine transitions";
+ close \$s;
+EOPERL
+
+$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
+BEGIN
+{
+ ipsend = tcpsend = ipreceive = tcpreceive = 0;
+ connreq = connest = connaccept = 0;
+}
+
+ip:::send
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->ipv4_protocol == IPPROTO_TCP/
+{
+ ipsend++;
+}
+
+tcp:::send
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ (args[4]->tcp_sport == $tcpport || args[4]->tcp_dport == $tcpport)/
+{
+ tcpsend++;
+}
+
+ip:::receive
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->ipv4_protocol == IPPROTO_TCP/
+{
+ ipreceive++;
+}
+
+tcp:::receive
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ (args[4]->tcp_sport == $tcpport || args[4]->tcp_dport == $tcpport)/
+{
+ tcpreceive++;
+}
+
+tcp:::state-change
+{
+ state_event[args[3]->tcps_state]++;
+}
+
+tcp:::connect-request
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->tcp_dport == $tcpport/
+{
+ connreq++;
+}
+
+tcp:::connect-established
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->tcp_sport == $tcpport/
+{
+ connest++;
+}
+
+tcp:::accept-established
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
+ args[4]->tcp_dport == $tcpport/
+{
+ connaccept++;
+}
+
+END
+{
+ printf("Minimum TCP events seen\n\n");
+ printf("ip:::send - %s\n", ipsend >= 5 ? "yes" : "no");
+ printf("ip:::receive - %s\n", ipreceive >= 5 ? "yes" : "no");
+ printf("tcp:::send - %s\n", tcpsend >= 7 ? "yes" : "no");
+ printf("tcp:::receive - %s\n", tcpreceive >= 7 ? "yes" : "no");
+ printf("tcp:::state-change to syn-sent - %s\n",
+ state_event[TCP_STATE_SYN_SENT] >=1 ? "yes" : "no");
+ printf("tcp:::state-change to syn-received - %s\n",
+ state_event[TCP_STATE_SYN_RECEIVED] >=1 ? "yes" : "no");
+ printf("tcp:::state-change to established - %s\n",
+ state_event[TCP_STATE_ESTABLISHED] >= 2 ? "yes" : "no");
+ printf("tcp:::state-change to fin-wait-1 - %s\n",
+ state_event[TCP_STATE_FIN_WAIT_1] >= 1 ? "yes" : "no");
+ printf("tcp:::state-change to close-wait - %s\n",
+ state_event[TCP_STATE_CLOSE_WAIT] >= 1 ? "yes" : "no");
+ printf("tcp:::state-change to fin-wait-2 - %s\n",
+ state_event[TCP_STATE_FIN_WAIT_2] >= 1 ? "yes" : "no");
+ printf("tcp:::state-change to last-ack - %s\n",
+ state_event[TCP_STATE_LAST_ACK] >= 1 ? "yes" : "no");
+ printf("tcp:::state-change to time-wait - %s\n",
+ state_event[TCP_STATE_TIME_WAIT] >= 1 ? "yes" : "no");
+ printf("tcp:::connect-request - %s\n",
+ connreq >=1 ? "yes" : "no");
+ printf("tcp:::connect-established - %s\n",
+ connest >=1 ? "yes" : "no");
+ printf("tcp:::accept-established - %s\n",
+ connaccept >=1 ? "yes" : "no");
+}
+EODTRACE
+
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh.out
new file mode 100644
index 000000000000..ea1c27e5020c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh.out
@@ -0,0 +1,18 @@
+Minimum TCP events seen
+
+ip:::send - yes
+ip:::receive - yes
+tcp:::send - yes
+tcp:::receive - yes
+tcp:::state-change to syn-sent - yes
+tcp:::state-change to syn-received - yes
+tcp:::state-change to established - yes
+tcp:::state-change to fin-wait-1 - yes
+tcp:::state-change to close-wait - yes
+tcp:::state-change to fin-wait-2 - yes
+tcp:::state-change to last-ack - yes
+tcp:::state-change to time-wait - yes
+tcp:::connect-request - yes
+tcp:::connect-established - yes
+tcp:::accept-established - yes
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
new file mode 100644
index 000000000000..4bf4362b61d2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
@@ -0,0 +1,172 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# Test tcp:::state-change and tcp:::{send,receive} by connecting to
+# the remote ssh service and sending a test message. This should result
+# in a "Protocol mismatch" response and a close of the connection.
+# A number of state transition events along with tcp send and receive
+# events for the message should result.
+#
+# This may fail due to:
+#
+# 1. A change to the ip stack breaking expected probe behavior,
+# which is the reason we are testing.
+# 2. The lo0 interface missing or not up.
+# 3. The remote ssh service is not online.
+# 4. An unlikely race causes the unlocked global send/receive
+# variables to be corrupted.
+#
+# This test performs a TCP connection to the ssh service (port 22) and
+# checks that at least the following packet counts were traced:
+#
+# 4 x ip:::send (2 during the TCP handshake, the message, then a FIN)
+# 4 x tcp:::send (2 during the TCP handshake, the messages, then a FIN)
+# 3 x ip:::receive (1 during the TCP handshake, the response, then the FIN ACK)
+# 3 x tcp:::receive (1 during the TCP handshake, the response, then the FIN ACK)
+#
+# For this test to work, we are assuming that the TCP handshake and
+# TCP close will enter the IP code path and not use tcp fusion.
+#
+
+if (( $# != 1 )); then
+ print -u2 "expected one argument: <dtrace-path>"
+ exit 2
+fi
+
+dtrace=$1
+getaddr=./get.ipv4remote.pl
+tcpport=22
+DIR=/var/tmp/dtest.$$
+
+if [[ ! -x $getaddr ]]; then
+ print -u2 "could not find or execute sub program: $getaddr"
+ exit 3
+fi
+$getaddr $tcpport | read source dest
+if (( $? != 0 )); then
+ exit 4
+fi
+
+mkdir $DIR
+cd $DIR
+
+cat > test.pl <<-EOPERL
+ use IO::Socket;
+ my \$s = IO::Socket::INET->new(
+ Proto => "tcp",
+ PeerAddr => "$dest",
+ PeerPort => $tcpport,
+ Timeout => 3);
+ die "Could not connect to host $dest port $tcpport" unless \$s;
+ print \$s "testing state machine transitions";
+ close \$s;
+EOPERL
+
+$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
+BEGIN
+{
+ ipsend = tcpsend = ipreceive = tcpreceive = 0;
+ connreq = connest = 0;
+}
+
+ip:::send
+/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" &&
+ args[4]->ipv4_protocol == IPPROTO_TCP/
+{
+ ipsend++;
+}
+
+tcp:::send
+/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" &&
+ args[4]->tcp_dport == $tcpport/
+{
+ tcpsend++;
+}
+
+ip:::receive
+/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" &&
+ args[4]->ipv4_protocol == IPPROTO_TCP/
+{
+ ipreceive++;
+}
+
+tcp:::receive
+/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" &&
+ args[4]->tcp_sport == $tcpport/
+{
+ tcpreceive++;
+}
+
+tcp:::state-change
+{
+ state_event[args[3]->tcps_state]++;
+}
+
+tcp:::connect-request
+/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" &&
+ args[4]->tcp_dport == $tcpport/
+{
+ connreq++;
+}
+
+tcp:::connect-established
+/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" &&
+ args[4]->tcp_sport == $tcpport/
+{
+ connest++;
+}
+
+END
+{
+ printf("Minimum TCP events seen\n\n");
+ printf("ip:::send - %s\n", ipsend >= 4 ? "yes" : "no");
+ printf("ip:::receive - %s\n", ipreceive >= 3 ? "yes" : "no");
+ printf("tcp:::send - %s\n", tcpsend >= 4 ? "yes" : "no");
+ printf("tcp:::receive - %s\n", tcpreceive >= 3 ? "yes" : "no");
+ printf("tcp:::state-change to syn-sent - %s\n",
+ state_event[TCP_STATE_SYN_SENT] >=1 ? "yes" : "no");
+ printf("tcp:::state-change to established - %s\n",
+ state_event[TCP_STATE_ESTABLISHED] >= 1 ? "yes" : "no");
+ printf("tcp:::state-change to fin-wait-1 - %s\n",
+ state_event[TCP_STATE_FIN_WAIT_1] >= 1 ? "yes" : "no");
+ printf("tcp:::state-change to fin-wait-2 - %s\n",
+ state_event[TCP_STATE_FIN_WAIT_2] >= 1 ? "yes" : "no");
+ printf("tcp:::state-change to time-wait - %s\n",
+ state_event[TCP_STATE_TIME_WAIT] >= 1 ? "yes" : "no");
+ printf("tcp:::connect-request - %s\n",
+ connreq >=1 ? "yes" : "no");
+ printf("tcp:::connect-established - %s\n",
+ connest >=1 ? "yes" : "no");
+}
+EODTRACE
+
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh.out
new file mode 100644
index 000000000000..27388fba65dc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh.out
@@ -0,0 +1,15 @@
+Minimum TCP events seen
+
+ip:::send - yes
+ip:::receive - yes
+tcp:::send - yes
+tcp:::receive - yes
+tcp:::state-change to syn-sent - yes
+tcp:::state-change to established - yes
+tcp:::state-change to fin-wait-1 - yes
+tcp:::state-change to close-wait - yes
+tcp:::state-change to fin-wait-2 - yes
+tcp:::state-change to time-wait - yes
+tcp:::connect-request - yes
+tcp:::connect-established - yes
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/manifest/test.jar-manifest b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/manifest/test.jar-manifest
new file mode 100644
index 000000000000..8f07fb2cf3b9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/manifest/test.jar-manifest
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Class-Path: /usr/share/lib/java/dtrace.jar
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestAbort.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestAbort.java
new file mode 100644
index 000000000000..310dd184a726
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestAbort.java
@@ -0,0 +1,158 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+import org.opensolaris.os.dtrace.*;
+import java.util.NoSuchElementException;
+
+/**
+ * Regression for 6426129 abort() after close() throws
+ * NoSuchElementException.
+ */
+public class TestAbort {
+ static boolean aborted = false;
+
+ public static void
+ main(String[] args)
+ {
+ Consumer consumer = new LocalConsumer();
+
+ // Test for deadlock (bug 6419880)
+ try {
+ consumer.open();
+ consumer.compile("syscall:::entry { @[execname] = count(); } " +
+ "tick-101ms { printa(@); }");
+ consumer.enable();
+ consumer.go();
+ try {
+ Thread.currentThread().sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ consumer.close();
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+
+ consumer = new LocalConsumer();
+
+ // Should be able to abort an unopened consumer
+ try {
+ aborted = false;
+ consumer.addConsumerListener(new ConsumerAdapter() {
+ public void consumerStopped(ConsumerEvent e) {
+ aborted = true;
+ }
+ });
+ consumer.abort();
+ consumer.open();
+ consumer.compile("syscall:::entry { @[execname] = count(); } " +
+ "tick-101ms { printa(@); }");
+ consumer.enable();
+ consumer.go();
+ try {
+ Thread.currentThread().sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ if (!aborted) {
+ throw new IllegalStateException("consumer not aborted");
+ }
+ consumer.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+
+ consumer = new LocalConsumer();
+
+ // Should be safe to call abort() in any state
+ try {
+ consumer.abort();
+ consumer.open();
+ consumer.abort();
+ consumer.compile("syscall:::entry { @[execname] = count(); } " +
+ "tick-101ms { printa(@); }");
+ consumer.abort();
+ consumer.enable();
+ consumer.abort();
+ consumer.go();
+ consumer.abort();
+ consumer.close();
+ // Should be safe to call after close()
+ try {
+ consumer.abort();
+ } catch (NoSuchElementException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+
+ consumer = new LocalConsumer();
+
+ // Tests that close() throws expected exception when called on
+ // synchronized consumer.
+ try {
+ consumer.open();
+ consumer.compile("syscall:::entry { @[execname] = count(); } " +
+ "tick-101ms { printa(@); }");
+ consumer.enable();
+ consumer.go();
+ try {
+ Thread.currentThread().sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ try {
+ synchronized (consumer) {
+ consumer.close();
+ }
+ } catch (IllegalThreadStateException e) {
+ try {
+ consumer.close();
+ System.out.println("Successful");
+ System.exit(0);
+ } catch (NoSuchElementException x) {
+ x.printStackTrace();
+ System.exit(1);
+ }
+ }
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ System.err.println("Failed");
+ System.exit(1);
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestBean.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestBean.java
new file mode 100644
index 000000000000..dd4a969d4355
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestBean.java
@@ -0,0 +1,706 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+import org.opensolaris.os.dtrace.*;
+import java.util.*;
+import java.io.*;
+import java.beans.*;
+import java.lang.reflect.*;
+
+/**
+ * Regression test for serialization and XML encoding/decoding. Tests
+ * every Serializable class in the Java DTrace API by creating a dummy
+ * instance, writing it to a file, then reading it back in and comparing
+ * the string values of the object before and after, as well as
+ * verifying object equality before and after if the class overrides the
+ * equals() method.
+ */
+public class TestBean {
+ public static final String[] TESTS = new String[] {
+ "ExitRecord",
+ "AggregationRecord",
+ "Aggregation",
+ "Tuple",
+ "ScalarRecord",
+ "KernelStackRecord",
+ "LogDistribution",
+ "LinearDistribution",
+ "Option",
+ "ProcessState",
+ "ProbeDescription",
+ "PrintaRecord",
+ "PrintfRecord",
+ "ProbeData",
+ "Aggregate",
+ "UserStackRecord",
+ "AvgValue",
+ "CountValue",
+ "SumValue",
+ "MinValue",
+ "MaxValue",
+ "Error",
+ "Drop",
+ "InterfaceAttributes",
+ "ProgramInfo",
+ "ProbeInfo",
+ "Probe",
+ "Flow",
+ "KernelSymbolRecord",
+ "UserSymbolRecord",
+ "UserSymbolRecord$Value",
+ "Program",
+ "Program$File",
+ "StddevValue"
+ };
+
+ static File file;
+
+ static void
+ exit(int status)
+ {
+ System.out.flush();
+ System.err.flush();
+ System.exit(status);
+ }
+
+ public static XMLEncoder
+ getXMLEncoder(File file)
+ {
+ XMLEncoder encoder = null;
+ try {
+ OutputStream out = new BufferedOutputStream
+ (new FileOutputStream(file));
+ encoder = new XMLEncoder(out);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ return encoder;
+ }
+
+ public static XMLDecoder
+ getXMLDecoder(File file)
+ {
+ return getXMLDecoder(file, null);
+ }
+
+ public static XMLDecoder
+ getXMLDecoder(File file, ExceptionListener exceptionListener)
+ {
+ XMLDecoder decoder = null;
+ try {
+ InputStream in = new BufferedInputStream
+ (new FileInputStream(file));
+ decoder = new XMLDecoder(in, null, exceptionListener);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ return decoder;
+ }
+
+ public static ExitRecord
+ getExitRecord()
+ {
+ ExitRecord r = new ExitRecord(1);
+ return r;
+ }
+
+ public static AggregationRecord
+ getAggregationRecord()
+ {
+ Tuple tuple = getTuple();
+ AggregationValue value = new CountValue(7);
+ AggregationRecord r = new AggregationRecord(tuple, value);
+ return r;
+ }
+
+ public static Aggregation
+ getAggregation()
+ {
+ List < AggregationRecord > list =
+ new ArrayList < AggregationRecord > ();
+ AggregationRecord r;
+ r = getAggregationRecord();
+ list.add(r);
+
+ ValueRecord v1 = new ScalarRecord(new byte[] {(byte)1, (byte)2,
+ (byte)3}, 3);
+ ValueRecord v2 = new ScalarRecord("shebang!", 256);
+ Tuple tuple = new Tuple(v1, v2);
+ AggregationValue value = getLinearDistribution();
+ r = new AggregationRecord(tuple, value);
+ list.add(r);
+
+ Aggregation a = new Aggregation("counts", 2, list);
+ return a;
+ }
+
+ public static Tuple
+ getTuple()
+ {
+ ValueRecord r1 = new ScalarRecord("cat", 256);
+ ValueRecord r2 = new ScalarRecord(new Integer(9), 2);
+ ValueRecord r3 = new KernelStackRecord(
+ new StackFrame[] {
+ new StackFrame("has"),
+ new StackFrame("nine"),
+ new StackFrame("lives")},
+ new byte[] { (byte)0, (byte)1, (byte)2 });
+ ValueRecord r4 = new ScalarRecord(new byte[] {(byte)1, (byte)2,
+ (byte)3}, 3);
+
+ Tuple tuple = new Tuple(r1, r2, r3, r4);
+ return tuple;
+ }
+
+ public static ScalarRecord
+ getScalarRecord()
+ {
+ Object v = new byte[] {(byte)1, (byte)2, (byte)3};
+ ScalarRecord r = new ScalarRecord(v, 3);
+ return r;
+ }
+
+ public static KernelStackRecord
+ getKernelStackRecord()
+ {
+ StackFrame[] stackFrames = new StackFrame[] {
+ new StackFrame("Frame 1"),
+ new StackFrame("Frame 2"),
+ new StackFrame("Frame 3")
+ };
+ KernelStackRecord r = new KernelStackRecord(stackFrames,
+ new byte[] { (byte)0, (byte)1, (byte)2 });
+ return r;
+ }
+
+ public static LogDistribution
+ getLogDistribution()
+ {
+ List < Distribution.Bucket > buckets =
+ new ArrayList < Distribution.Bucket > ();
+ Distribution.Bucket bucket;
+ int n = 0;
+ long base = 0;
+ long i;
+ long sign;
+ long nextSign;
+ long power;
+ long nextPower;
+ long lowerBound;
+ long upperBound;
+ for (i = -62; i <= 62; ++i) {
+ if (i == 0) {
+ bucket = new Distribution.Bucket(-1, -1, n++);
+ buckets.add(bucket);
+ bucket = new Distribution.Bucket(0, 0, n++);
+ buckets.add(bucket);
+ bucket = new Distribution.Bucket(1, 1, n++);
+ buckets.add(bucket);
+ continue;
+ }
+ sign = ((i < 0) ? -1L : 1L);
+ power = (sign * i);
+ nextSign = (((i + 1) < 0) ? -1L : 1L);
+ nextPower = (nextSign * (i + 1));
+ lowerBound = sign * ((long) Math.pow(2L, power));
+ upperBound = (nextPower == 0 ? -2L :
+ (nextSign * ((long) Math.pow(2L, nextPower))) - 1);
+ if ((upperBound > 0) && ((upperBound * 2L) < 0)) {
+ upperBound = Long.MAX_VALUE;
+ }
+ bucket = new Distribution.Bucket(lowerBound, upperBound, n++);
+ buckets.add(bucket);
+ }
+ LogDistribution d = new LogDistribution(buckets);
+ return d;
+ }
+
+ public static LinearDistribution
+ getLinearDistribution()
+ {
+ List < Distribution.Bucket > buckets =
+ new ArrayList < Distribution.Bucket > ();
+ Distribution.Bucket bucket;
+ int n = 10; // number of buckets
+ int base = 1;
+ int step = 10;
+ bucket = new Distribution.Bucket(Long.MIN_VALUE, (base - 1), 0);
+ buckets.add(bucket);
+ for (int i = base; i < (n * step); i += step) {
+ bucket = new Distribution.Bucket(i, (i + (step - 1)),
+ ((i - 1) / step));
+ buckets.add(bucket);
+ }
+ bucket = new Distribution.Bucket((n * step) + 1, Long.MAX_VALUE, 0);
+ buckets.add(bucket);
+ LinearDistribution d = new LinearDistribution(base, step, buckets);
+ return d;
+ }
+
+ public static Option
+ getOption()
+ {
+ Option option = new Option("aggrate", "1s");
+ return option;
+ }
+
+ public static ProcessState
+ getProcessState()
+ {
+ ProcessState p = new ProcessState(123456, "UNDEAD",
+ 3, "SIGSTOP",
+ -2, "Process stopped on dime");
+ return p;
+ }
+
+ public static ProbeDescription
+ getProbeDescription()
+ {
+ ProbeDescription d = new ProbeDescription(256, "syscall", null,
+ "malloc", "entry");
+ return d;
+ }
+
+ public static PrintaRecord
+ getPrintaRecord()
+ {
+ List < Aggregation > aggregations = new ArrayList < Aggregation > ();
+ Aggregation a = getAggregation();
+ aggregations.add(a);
+ aggregations.add(a);
+ Map < Tuple, String > formattedOutput =
+ new HashMap < Tuple, String > ();
+ for (Tuple t : a.asMap().keySet()) {
+ formattedOutput.put(t, "cat");
+ }
+ List < Tuple > tuples = new ArrayList < Tuple > ();
+ for (Tuple t : a.asMap().keySet()) {
+ tuples.add(t);
+ }
+ Collections.sort(tuples);
+ PrintaRecord r = new PrintaRecord(1234567890L,
+ aggregations, formattedOutput, tuples,
+ "Yes, this is the formatted printa() output");
+ return r;
+ }
+
+ public static PrintfRecord
+ getPrintfRecord()
+ {
+ List < ValueRecord > list = new ArrayList < ValueRecord > ();
+ ValueRecord v1 = getScalarRecord();
+ ValueRecord v2 = new ScalarRecord(new Integer(7), 4);
+ list.add(v1);
+ list.add(v2);
+ PrintfRecord r = new PrintfRecord(list,
+ "long formatted string");
+ return r;
+ }
+
+ public static ProbeData
+ getProbeData()
+ {
+ List < Record > list = new ArrayList < Record > ();
+ list.add(getPrintaRecord());
+ list.add(getPrintfRecord());
+ list.add(getScalarRecord());
+ list.add(getUserSymbolRecord());
+ list.add(getUserStackRecord());
+ list.add(getExitRecord());
+ ProbeData d = new ProbeData(7, 1, getProbeDescription(),
+ getFlow(), list);
+ return d;
+ }
+
+ public static Aggregate
+ getAggregate()
+ {
+ List < Aggregation > list = new ArrayList < Aggregation > ();
+ list.add(getAggregation());
+
+ List < AggregationRecord > reclist =
+ new ArrayList < AggregationRecord > ();
+ AggregationRecord r;
+ ValueRecord v1 = new ScalarRecord("cat", 256);
+ ValueRecord v2 = new ScalarRecord("dog", 256);
+ ValueRecord v3 = new ScalarRecord("mouse", 256);
+ ValueRecord v4 = new ScalarRecord("mouse", 256);
+ ValueRecord v5 = new ScalarRecord(new Byte((byte) 'C'), 1);
+ ValueRecord v6 = new ScalarRecord(new Short((short) 7), 2);
+ Tuple tuple = new Tuple(v1, v2, v3, v4, v5, v6);
+ AggregationValue value = getCountValue();
+ r = new AggregationRecord(tuple, value);
+ reclist.add(r);
+ list.add(new Aggregation("times", 1, reclist));
+
+ Aggregate a = new Aggregate(1234567890L, list);
+ return a;
+ }
+
+ public static UserStackRecord
+ getUserStackRecord()
+ {
+ StackFrame[] frames = new StackFrame[] {
+ new StackFrame("User Stack Frame 1"),
+ new StackFrame("User Stack Frame 2"),
+ new StackFrame("User Stack Frame 3")
+ };
+ UserStackRecord r = new UserStackRecord(123456, frames,
+ new byte[] { (byte)0, (byte)1, (byte)2 });
+ return r;
+ }
+
+ public static AvgValue
+ getAvgValue()
+ {
+ AvgValue v = new AvgValue(5, 20, 4);
+ return v;
+ }
+
+ public static CountValue
+ getCountValue()
+ {
+ CountValue v = new CountValue(9);
+ return v;
+ }
+
+ public static MinValue
+ getMinValue()
+ {
+ MinValue v = new MinValue(101);
+ return v;
+ }
+
+ public static MaxValue
+ getMaxValue()
+ {
+ MaxValue v = new MaxValue(101);
+ return v;
+ }
+
+ public static SumValue
+ getSumValue()
+ {
+ SumValue v = new SumValue(25);
+ return v;
+ }
+
+ public static org.opensolaris.os.dtrace.Error
+ getError()
+ {
+ ProbeDescription probe = getProbeDescription();
+ org.opensolaris.os.dtrace.Error e =
+ new org.opensolaris.os.dtrace.Error(probe, 8, 3,
+ 1, 20, "DTRACEFLT_BADALIGN", -1, "error on enabled probe ID 8 " +
+ "(ID " + probe.getID() + ": " + probe + "): Bad alignment " +
+ "(0x33ef) in action #1 at DIF offset 20");
+ return e;
+ }
+
+ public static Drop
+ getDrop()
+ {
+ Drop drop = new Drop(2, "SPECBUSY", 72, 1041,
+ "Guess we dropped stuff all over the place.");
+ return drop;
+ }
+
+ public static InterfaceAttributes
+ getInterfaceAttributes()
+ {
+ InterfaceAttributes a = new InterfaceAttributes(
+ InterfaceAttributes.Stability.UNSTABLE,
+ InterfaceAttributes.Stability.EVOLVING,
+ InterfaceAttributes.DependencyClass.ISA);
+ return a;
+ }
+
+ public static ProgramInfo
+ getProgramInfo()
+ {
+ ProgramInfo info = new ProgramInfo(getInterfaceAttributes(),
+ getInterfaceAttributes(), 256);
+ return info;
+ }
+
+ public static ProbeInfo
+ getProbeInfo()
+ {
+ ProbeInfo info = new ProbeInfo(getInterfaceAttributes(),
+ getInterfaceAttributes());
+ return info;
+ }
+
+ public static Probe
+ getProbe()
+ {
+ Probe p = new Probe(getProbeDescription(), getProbeInfo());
+ return p;
+ }
+
+ public static Flow
+ getFlow()
+ {
+ Flow f = new Flow(Flow.Kind.RETURN.name(), 3);
+ return f;
+ }
+
+ public static KernelSymbolRecord
+ getKernelSymbolRecord()
+ {
+ KernelSymbolRecord r = new KernelSymbolRecord("mod`func+0x4", -1L);
+ return r;
+ }
+
+ public static UserSymbolRecord
+ getUserSymbolRecord()
+ {
+ UserSymbolRecord r = new UserSymbolRecord(7, "mod`func+0x4", -1L);
+ return r;
+ }
+
+ public static UserSymbolRecord.Value
+ getUserSymbolRecord$Value()
+ {
+ UserSymbolRecord.Value v = new UserSymbolRecord.Value(7, -1L);
+ return v;
+ }
+
+ public static Program
+ getProgram()
+ {
+ final String PROGRAM = "syscall:::entry { @[execname] = count(); }";
+ Consumer consumer = new LocalConsumer();
+ Program p;
+ try {
+ consumer.open();
+ p = consumer.compile(PROGRAM);
+ consumer.close();
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ p = null;
+ }
+ return p;
+ }
+
+ public static Program.File
+ getProgram$File()
+ {
+ final String PROGRAM = "syscall:::entry { @[execname] = count(); }";
+ Consumer consumer = new LocalConsumer();
+ Program p;
+ try {
+ OutputStream out = new FileOutputStream(file);
+ out.write(PROGRAM.getBytes(), 0, PROGRAM.length());
+ out.flush();
+ out.close();
+ consumer.open();
+ p = consumer.compile(file);
+ consumer.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ p = null;
+ }
+ return Program.File.class.cast(p);
+ }
+
+ public static StddevValue
+ getStddevValue()
+ {
+ StddevValue v = new StddevValue(37, 114, 5, Integer.toString(9544));
+ return v;
+ }
+
+ @SuppressWarnings("unchecked")
+ static String
+ getString(Object o)
+ {
+ String s;
+ if (o instanceof ScalarRecord) {
+ o = ((ScalarRecord)o).getValue();
+ }
+
+ if (o instanceof byte[]) {
+ s = Arrays.toString((byte[])o);
+ } else if (o instanceof Object[]) {
+ s = Arrays.toString((Object[])o);
+ } else {
+ Class c = o.getClass();
+ try {
+ Method m = c.getDeclaredMethod("toLogString");
+ s = (String)m.invoke(o);
+ } catch (Exception e) {
+ s = o.toString();
+ }
+ }
+ return s;
+ }
+
+ static void
+ checkEquality(Object obj, Object newobj)
+ {
+ // If the class overrides equals(), make sure the re-created
+ // object still equals the original object
+ try {
+ Method eq = obj.getClass().getDeclaredMethod("equals",
+ Object.class);
+ Boolean ret = (Boolean) eq.invoke(obj, newobj);
+ if (ret != true) {
+ System.err.println("serialization failed: " +
+ obj.getClass().getName());
+ exit(1);
+ }
+ } catch (Exception e) {
+ // Does not override equals(), although a super-class might.
+ // A better test would check for any superclass other than
+ // Object.class.
+ }
+ }
+
+ static void
+ performSerializationTest(File file, String classname)
+ throws IOException, ClassNotFoundException
+ {
+ String methodName = "get" + classname;
+ Object obj = null;
+ Object newobj = null;
+ try {
+ Method method = TestBean.class.getDeclaredMethod(methodName);
+ obj = method.invoke(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ }
+
+ System.out.println(classname + ":");
+ String serialized = getString(obj);
+ System.out.println(" serialized: " + serialized);
+ FileOutputStream fos = new FileOutputStream(file);
+ ObjectOutputStream out = new ObjectOutputStream(fos);
+ out.writeObject(obj);
+ out.close();
+ FileInputStream fis = new FileInputStream(file);
+ ObjectInputStream in = new ObjectInputStream(fis);
+ newobj = in.readObject();
+ in.close();
+ String deserialized = getString(newobj);
+ System.out.println(" deserialized: " + deserialized);
+
+ if (!serialized.equals(deserialized)) {
+ System.err.println("serialization failed: " + classname);
+ exit(1);
+ }
+ checkEquality(obj, newobj);
+ }
+
+ static void
+ performBeanTest(File file, String classname)
+ {
+ String methodName = "get" + classname;
+ Object obj = null;
+ Object newobj = null;
+ try {
+ Method method = TestBean.class.getDeclaredMethod(methodName);
+ obj = method.invoke(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ }
+
+ Class c = obj.getClass();
+ if (c.getConstructors().length == 0) {
+ return;
+ }
+
+ System.out.println(classname + ":");
+ XMLEncoder encoder = getXMLEncoder(file);
+ String encoded = getString(obj);
+ System.out.println(" encoded: " + encoded);
+ encoder.writeObject(obj);
+ encoder.close();
+ XMLDecoder decoder = getXMLDecoder(file);
+ newobj = decoder.readObject();
+ String decoded = getString(newobj);
+ System.out.println(" decoded: " + decoded);
+ decoder.close();
+
+ if (!encoded.equals(decoded)) {
+ System.err.println("bean persistence failed: " + classname);
+ exit(1);
+ }
+ checkEquality(obj, newobj);
+ }
+
+ public static void
+ main(String[] args)
+ {
+ if ((args.length != 1) && (args.length != 2)) {
+ System.err.println("usage: java TestBean < filename > " +
+ "[ < classname > ]");
+ exit(1);
+ }
+
+ String filename = args[0];
+ String classname = null;
+ if (args.length >= 2) {
+ classname = args[1];
+ }
+
+ file = new File(filename);
+ try {
+ if (!file.canRead()) {
+ try {
+ file.createNewFile();
+ } catch (Exception e) {
+ System.err.println("failed to create " + filename);
+ exit(1);
+ }
+ }
+ } catch (SecurityException e) {
+ System.err.println("failed to open " + filename);
+ exit(1);
+ }
+
+ String[] tests = (classname == null ? TESTS:
+ new String[] { classname });
+ try {
+ for (int i = 0; i < tests.length; ++i) {
+ performSerializationTest(file, tests[i]);
+ performBeanTest(file, tests[i]);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ exit(1);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestClose.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestClose.java
new file mode 100644
index 000000000000..c7a9e89d0383
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestClose.java
@@ -0,0 +1,90 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+import org.opensolaris.os.dtrace.*;
+
+/**
+ * Regression for bug 6419880 close() hangs running consumer.
+ */
+public class TestClose {
+ public static void
+ main(String[] args)
+ {
+ Consumer consumer = new LocalConsumer();
+
+ try {
+ consumer.open();
+ consumer.compile("syscall:::entry { @[execname] = count(); } " +
+ "tick-101ms { printa(@); }");
+ consumer.enable();
+ consumer.go();
+ try {
+ Thread.currentThread().sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ consumer.close();
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+
+ consumer = new LocalConsumer();
+
+ try {
+ consumer.open();
+ consumer.compile("syscall:::entry { @[execname] = count(); } " +
+ "tick-101ms { printa(@); }");
+ consumer.enable();
+ consumer.go();
+ try {
+ Thread.currentThread().sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ try {
+ // Test new rule that close() is illegal while holding
+ // lock on consumer.
+ synchronized (consumer) {
+ consumer.close();
+ }
+ } catch (IllegalThreadStateException e) {
+ consumer.close();
+ System.out.println("Successful");
+ System.exit(0);
+ }
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ System.err.println("Failed");
+ System.exit(1);
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestDrop.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestDrop.java
new file mode 100644
index 000000000000..b5ace25bdbde
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestDrop.java
@@ -0,0 +1,169 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+import java.util.*;
+import java.util.concurrent.atomic.*;
+import org.opensolaris.os.dtrace.*;
+
+/**
+ * Regression test for 6521523 aggregation drops can hang the Java
+ * DTrace API.
+ */
+public class TestDrop {
+ static final String PROGRAM =
+ "fbt:genunix::entry { @[execname, pid] = count(); }";
+
+ static AtomicLong consumerThreadID = new AtomicLong();
+ static AtomicLong getAggregateThreadID = new AtomicLong();
+ static AtomicBoolean done = new AtomicBoolean();
+ static int seconds;
+
+ private static void
+ startTimer()
+ {
+ if (seconds <= 0) {
+ return;
+ }
+
+ final Timer timer = new Timer();
+ timer.schedule(new TimerTask() {
+ public void run() {
+ done.set(true);
+ timer.cancel();
+ }
+ }, seconds * 1000L);
+ }
+
+ private static void
+ sampleAggregate(Consumer consumer) throws DTraceException
+ {
+ while (consumer.isRunning() && !done.get()) {
+ try {
+ Thread.currentThread().sleep(50);
+ } catch (InterruptedException e) {
+ }
+
+ consumer.getAggregate(Collections. <String> emptySet());
+ }
+ }
+
+ private static void
+ startAggregateThread(final Consumer consumer)
+ {
+ Runnable aggregateSampler = new Runnable() {
+ public void run() {
+ Thread t = Thread.currentThread();
+ getAggregateThreadID.set(t.getId());
+ Throwable x = null;
+ try {
+ sampleAggregate(consumer);
+ } catch (Throwable e) {
+ x = e;
+ }
+
+ if (Thread.holdsLock(LocalConsumer.class)) {
+ if (x != null) {
+ x.printStackTrace();
+ }
+ System.out.println("Lock held");
+ System.exit(1);
+ } else {
+ System.out.println("Lock released");
+ consumer.close(); // blocks if lock held
+ }
+ }
+ };
+
+ Thread t = new Thread(aggregateSampler, "Aggregate Sampler");
+ t.start();
+ }
+
+ static void
+ usage()
+ {
+ System.err.println("usage: java TestDrop [ seconds ]");
+ System.exit(2);
+ }
+
+ public static void
+ main(String[] args)
+ {
+ if (args.length == 1) {
+ try {
+ seconds = Integer.parseInt(args[0]);
+ } catch (NumberFormatException e) {
+ usage();
+ }
+ } else if (args.length > 1) {
+ usage();
+ }
+
+ final Consumer consumer = new LocalConsumer() {
+ protected Thread createThread() {
+ Runnable worker = new Runnable() {
+ public void run() {
+ Thread t = Thread.currentThread();
+ consumerThreadID.set(t.getId());
+ work();
+ }
+ };
+ Thread t = new Thread(worker);
+ return t;
+ }
+ };
+
+ consumer.addConsumerListener(new ConsumerAdapter() {
+ public void consumerStarted(ConsumerEvent e) {
+ startAggregateThread(consumer);
+ startTimer();
+ }
+ public void dataDropped(DropEvent e) throws ConsumerException {
+ Thread t = Thread.currentThread();
+ if (t.getId() == getAggregateThreadID.get()) {
+ Drop drop = e.getDrop();
+ throw new ConsumerException(drop.getDefaultMessage(),
+ drop);
+ }
+ }
+ });
+
+ try {
+ consumer.open();
+ consumer.setOption(Option.aggsize, Option.kb(1));
+ consumer.setOption(Option.aggrate, Option.millis(101));
+ consumer.compile(PROGRAM);
+ consumer.enable();
+ consumer.go(new ExceptionHandler() {
+ public void handleException(Throwable e) {
+ e.printStackTrace();
+ }
+ });
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestEnable.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestEnable.java
new file mode 100644
index 000000000000..0e5a608691c0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestEnable.java
@@ -0,0 +1,151 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+import org.opensolaris.os.dtrace.*;
+
+/**
+ * Prove that enable() handles multiple programs, recognizing programs
+ * that are already enabled and programs that were compiled by another
+ * consumer.
+ */
+public class TestEnable {
+ static void
+ exit(int status)
+ {
+ System.out.flush();
+ System.err.flush();
+ System.exit(status);
+ }
+
+ public static void
+ main(String[] args)
+ {
+ Consumer consumer = new LocalConsumer();
+
+ try {
+ consumer.open();
+ Program p0 = consumer.compile("dtrace:::BEGIN");
+ Program p1 = consumer.compile("syscall:::entry");
+ Program p2 = consumer.compile("dtrace:::END");
+ consumer.enable(p0);
+ consumer.enable(p1);
+ try {
+ consumer.go();
+ System.err.println("go() illegal, not all programs " +
+ "enabled (p0, p1)");
+ exit(1);
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ try {
+ consumer.enable();
+ System.err.println("enable() illegal, some programs " +
+ "already enabled (p0, p1)");
+ exit(1);
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ try {
+ consumer.enable(p0);
+ System.err.println("cannot enable a program that " +
+ "has already been enabled (p0)");
+ exit(1);
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ consumer.enable(p2);
+ Program p3 = consumer.compile("syscall:::return");
+ try {
+ consumer.go();
+ System.err.println("go() illegal, not all programs " +
+ "enabled (p0, p1, p2)");
+ exit(1);
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ try {
+ consumer.enable();
+ System.err.println("enable() illegal, some programs " +
+ "already enabled (p0, p1, p2)");
+ exit(1);
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ // Try to fool the consumer with a program compiled by
+ // another consumer
+ Consumer consumer2 = new LocalConsumer();
+ consumer2.open();
+ Program p3x = consumer2.compile("syscall:::return");
+ try {
+ consumer.enable(p3x);
+ System.err.println("cannot enable program compiled " +
+ "by another consumer");
+ exit(1);
+ } catch (IllegalArgumentException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1);
+ } finally {
+ consumer2.close();
+ }
+ consumer.enable(p3);
+ consumer.go();
+ consumer.close();
+
+ // Enable all compiled programs at once
+ consumer = new LocalConsumer();
+ consumer.open();
+ consumer.compile("dtrace:::BEGIN");
+ consumer.compile("syscall:::entry");
+ consumer.compile("dtrace:::END");
+ consumer.enable();
+ consumer.go();
+ consumer.close();
+ exit(0);
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java
new file mode 100644
index 000000000000..2bc43ea6f1ce
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java
@@ -0,0 +1,114 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+import org.opensolaris.os.dtrace.*;
+
+/**
+ * Regression for bug 6413280 lookupKernelFunction() and
+ * lookupUserFunction() truncate last character.
+ */
+public class TestFunctionLookup {
+ static final String kernelLookupProgram = "sdt:::callout-start { " +
+ "@[((callout_t *)arg0)->c_func] = count(); }";
+ static final String userLookupProgram = "pid$target::f2:entry { " +
+ "@[arg0] = count(); }";
+
+ public static void
+ main(String[] args)
+ {
+ if (args.length != 1) {
+ System.err.println("usage: java TestFunctionLookup <command>");
+ System.exit(1);
+ }
+ String cmd = args[0];
+
+ Consumer consumer = new LocalConsumer();
+ try {
+ consumer.open();
+ consumer.compile(kernelLookupProgram);
+ consumer.enable();
+ consumer.go();
+ Aggregate a;
+ Number address;
+ String f;
+ boolean done = false;
+ for (int i = 0; (i < 20) && !done; ++i) {
+ Thread.currentThread().sleep(100);
+ a = consumer.getAggregate();
+ for (Aggregation agg : a.getAggregations()) {
+ for (Tuple tuple : agg.asMap().keySet()) {
+ address = (Number)tuple.get(0).getValue();
+ if (address instanceof Integer) {
+ int addr = (Integer)address;
+ f = consumer.lookupKernelFunction(addr);
+ } else {
+ long addr = (Long)address;
+ f = consumer.lookupKernelFunction(addr);
+ }
+ if (f.equals("genunix`cv_wakeup")) {
+ System.out.println(f);
+ done = true;
+ }
+ }
+ }
+ }
+ consumer.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+
+ consumer = new LocalConsumer();
+ try {
+ consumer.open();
+ int pid = consumer.createProcess(cmd);
+ consumer.compile(userLookupProgram);
+ consumer.enable();
+ consumer.go();
+ Thread.currentThread().sleep(500);
+ Aggregate a = consumer.getAggregate();
+ Number address;
+ String f;
+ for (Aggregation agg : a.getAggregations()) {
+ for (Tuple tuple : agg.asMap().keySet()) {
+ address = (Number)tuple.get(0).getValue();
+ if (address instanceof Integer) {
+ int addr = (Integer)address;
+ f = consumer.lookupUserFunction(pid, addr);
+ } else {
+ long addr = (Long)address;
+ f = consumer.lookupUserFunction(pid, addr);
+ }
+ System.out.println(f);
+ }
+ }
+ consumer.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java
new file mode 100644
index 000000000000..e02df8582417
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java
@@ -0,0 +1,252 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+import org.opensolaris.os.dtrace.*;
+import java.util.*;
+
+/**
+ * Assert getAggregate() can explicitly specify the anonymous aggregation.
+ */
+public class TestGetAggregate {
+ static final String programString =
+ "profile:::tick-50ms" +
+ "{" +
+ " @ = count();" +
+ " @a = count();" +
+ "}";
+
+ static final String ANONYMOUS_AGGREGATION = "";
+ static final int TICK = 50;
+ static final int EXPECTED_TICKS = 3;
+ static final int INTERVALS = 4;
+
+ static void
+ testIncluded(Consumer consumer, String ... aggregationNames)
+ throws DTraceException, InterruptedException
+ {
+ Aggregate aggregate;
+ Set <String> included = new HashSet <String> ();
+ int n = 1;
+
+ for (String name : aggregationNames) {
+ included.add(name);
+ }
+
+ // Wait up to a full second to obtain aggregate data. Without a
+ // time limit, we'll loop forever if no aggregation was
+ // successfully included.
+ do {
+ Thread.sleep(TICK);
+ aggregate = consumer.getAggregate(included, null);
+ } while (aggregate.asMap().isEmpty() && n++ < (1000 / TICK));
+
+ for (String name : included) {
+ if (aggregate.getAggregation(name) == null) {
+ throw new IllegalStateException("@" + name +
+ " was explicitly included but did not appear " +
+ "in the aggregate");
+ }
+ }
+ for (Aggregation a : aggregate.getAggregations()) {
+ if (!included.contains(a.getName())) {
+ throw new IllegalStateException("@" + a.getName() +
+ " was not explicitly included but appeared " +
+ "in the aggregate anyway");
+ }
+ }
+
+ if (!consumer.isRunning()) {
+ throw new IllegalStateException("consumer exited");
+ }
+ }
+
+ static void
+ testCleared(Consumer consumer, String ... aggregationNames)
+ throws DTraceException, InterruptedException
+ {
+ Aggregate aggregate;
+ AggregationRecord rec;
+ long value;
+ Long firstValue;
+ int n = 1;
+ Map <String, Long> firstValues = new HashMap <String, Long> ();
+ Set <String> cleared = new HashSet <String> ();
+
+ for (String name : aggregationNames) {
+ cleared.add(name);
+ }
+
+ do {
+ Thread.sleep(TICK);
+ aggregate = consumer.getAggregate(null, cleared);
+ } while (aggregate.asMap().isEmpty() && n++ < (1000 / TICK));
+ n = 1;
+
+ do {
+ Thread.sleep(TICK * EXPECTED_TICKS);
+ aggregate = consumer.getAggregate(null, cleared);
+
+ for (Aggregation a : aggregate.getAggregations()) {
+ if (!firstValues.containsKey(a.getName())) {
+ rec = a.getRecord(Tuple.EMPTY);
+ value = rec.getValue().getValue().longValue();
+ firstValues.put(a.getName(), value);
+ }
+ }
+ } while (consumer.isRunning() && n++ < INTERVALS);
+
+ for (Aggregation a : aggregate.getAggregations()) {
+ rec = a.getRecord(Tuple.EMPTY);
+ value = rec.getValue().getValue().longValue();
+ firstValue = firstValues.get(a.getName());
+
+ if (cleared.contains(a.getName())) {
+ // last value should be about the same as first value
+ if (value > (firstValue * 2)) {
+ throw new IllegalStateException(
+ "@" + a.getName() + " should have " +
+ "been cleared but instead grew from " +
+ firstValue + " to " + value);
+ }
+ } else {
+ // last value should be about (INTERVALS * firstValue)
+ if (value < (firstValue * 2)) {
+ throw new IllegalStateException(
+ "@" + a.getName() + " should have " +
+ "accumulated a running total but " +
+ "instead went from " +
+ firstValue + " to " + value);
+ }
+ }
+ }
+
+ if (!consumer.isRunning()) {
+ throw new IllegalStateException("consumer exited");
+ }
+ }
+
+ static Integer includedStatus;
+ static Integer clearedStatus;
+
+ static void
+ startIncludedTest()
+ {
+ final Consumer consumer = new LocalConsumer();
+ consumer.addConsumerListener(new ConsumerAdapter() {
+ public void consumerStarted(ConsumerEvent e) {
+ new Thread(new Runnable() {
+ public void run() {
+ try {
+ testIncluded(consumer, ANONYMOUS_AGGREGATION);
+ includedStatus = 0;
+ } catch (Exception e) {
+ includedStatus = 1;
+ e.printStackTrace();
+ } finally {
+ consumer.abort();
+ }
+ }
+ }).start();
+ }
+ });
+
+ try {
+ consumer.open();
+ consumer.setOption(Option.aggrate, Option.millis(TICK));
+ consumer.compile(programString);
+ consumer.enable();
+ consumer.go();
+ } catch (Exception e) {
+ includedStatus = 1;
+ e.printStackTrace();
+ }
+ }
+
+ static void
+ startClearedTest()
+ {
+ final Consumer consumer = new LocalConsumer();
+ consumer.addConsumerListener(new ConsumerAdapter() {
+ public void consumerStarted(ConsumerEvent e) {
+ new Thread(new Runnable() {
+ public void run() {
+ try {
+ testCleared(consumer, ANONYMOUS_AGGREGATION);
+ clearedStatus = 0;
+ } catch (Exception e) {
+ clearedStatus = 1;
+ e.printStackTrace();
+ } finally {
+ consumer.abort();
+ }
+ }
+ }).start();
+ }
+ });
+
+ try {
+ consumer.open();
+ consumer.setOption(Option.aggrate, Option.millis(TICK));
+ consumer.compile(programString);
+ consumer.enable();
+ consumer.go();
+ } catch (Exception e) {
+ clearedStatus = 1;
+ e.printStackTrace();
+ }
+ }
+
+ public static void
+ main(String[] args)
+ {
+ startIncludedTest();
+
+ do {
+ try {
+ Thread.sleep(TICK);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ } while (includedStatus == null);
+
+ startClearedTest();
+
+ do {
+ try {
+ Thread.sleep(TICK);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ } while (clearedStatus == null);
+
+ if (includedStatus != 0 || clearedStatus != 0) {
+ System.out.println("Failure");
+ System.exit(1);
+ }
+
+ System.out.println("Success");
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestMaxConsumers.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestMaxConsumers.java
new file mode 100644
index 000000000000..50eeac23b7a1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestMaxConsumers.java
@@ -0,0 +1,97 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+import org.opensolaris.os.dtrace.*;
+
+/**
+ * Regression for 6506495 -DJAVA_DTRACE_MAX_CONSUMERS=N for any N &lt; 8
+ * is treated as if it were 8.
+ */
+public class TestMaxConsumers {
+ static final String MAX_CONSUMERS_PROPERTY_NAME =
+ "JAVA_DTRACE_MAX_CONSUMERS";
+
+ static Integer
+ getIntegerProperty(String name)
+ {
+ Integer value = null;
+ String property = System.getProperty(name);
+ if (property != null && property.length() != 0) {
+ try {
+ value = Integer.parseInt(property);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ }
+ }
+ return value;
+ }
+
+ public static void
+ main(String[] args)
+ {
+ Integer property = getIntegerProperty(MAX_CONSUMERS_PROPERTY_NAME);
+ int max = (property == null ? 0 : property);
+ int n = (property == null ? 11 : (max < 1 ? 1 : max));
+
+ Consumer[] consumers = new Consumer[n];
+ try {
+ for (int i = 0; i < n; ++i) {
+ consumers[i] = new LocalConsumer();
+ consumers[i].open();
+ }
+ for (int i = 0; i < n; ++i) {
+ consumers[i].close();
+ }
+ for (int i = 0; i < n; ++i) {
+ consumers[i] = new LocalConsumer();
+ consumers[i].open();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+
+ try {
+ Consumer consumer = new LocalConsumer();
+ consumer.open();
+ if (max > 0) {
+ System.out.println("Error: " + (max + 1) + " > " +
+ MAX_CONSUMERS_PROPERTY_NAME);
+ } else {
+ System.out.println("Success");
+ }
+ consumer.close();
+ } catch (Exception e) {
+ System.out.println("Success");
+ } finally {
+ for (int i = 0; i < n; ++i) {
+ consumers[i].close();
+ }
+ }
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestMultiAggPrinta.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestMultiAggPrinta.java
new file mode 100644
index 000000000000..facdf7fad364
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestMultiAggPrinta.java
@@ -0,0 +1,144 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import org.opensolaris.os.dtrace.*;
+
+/**
+ * Regression for multi-aggregation printa() corner cases.
+ */
+public class TestMultiAggPrinta {
+ static int exitStatus;
+
+ // Gets a string representation of the given PrintaRecord minus the
+ // timestamp of the aggregate snapshot, so that the output is
+ // comparable across multiple test runs.
+ static String
+ printaRecordString(PrintaRecord rec)
+ {
+ StringBuffer buf = new StringBuffer();
+ buf.append(PrintaRecord.class.getName());
+ buf.append("[aggregations = ");
+ buf.append(rec.getAggregations());
+ buf.append(", formattedStrings = ");
+ buf.append(rec.getFormattedStrings());
+ buf.append(", tuples = ");
+ buf.append(rec.getTuples());
+ buf.append(", output = ");
+ buf.append(rec.getOutput());
+ buf.append(']');
+ return buf.toString();
+ }
+
+ static String
+ probeDataString(ProbeData data)
+ {
+ StringBuffer buf = new StringBuffer();
+ buf.append(ProbeData.class.getName());
+ buf.append("[epid = ");
+ buf.append(data.getEnabledProbeID());
+ // Do not include cpu, since it can change across test runs
+ buf.append(", enabledProbeDescription = ");
+ buf.append(data.getEnabledProbeDescription());
+ buf.append(", flow = ");
+ buf.append(data.getFlow());
+ buf.append(", records = ");
+
+ List <Record> records = data.getRecords();
+ Record record;
+ Object value;
+ buf.append('[');
+ for (int i = 0; i < records.size(); ++i) {
+ if (i > 0) {
+ buf.append(", ");
+ }
+ record = records.get(i);
+ if (record instanceof ValueRecord) {
+ value = ((ValueRecord)record).getValue();
+ if (value instanceof String) {
+ buf.append("\"");
+ buf.append((String)value);
+ buf.append("\"");
+ } else {
+ buf.append(record);
+ }
+ } else if (record instanceof PrintaRecord) {
+ PrintaRecord printa = (PrintaRecord)record;
+ buf.append(printaRecordString(printa));
+ } else {
+ buf.append(record);
+ }
+ }
+ buf.append(']');
+ return buf.toString();
+ }
+
+ public static void
+ main(String[] args)
+ {
+ if (args.length != 1) {
+ System.err.println("usage: java TestMultiAggPrinta <script>");
+ System.exit(2);
+ }
+
+ final Consumer consumer = new LocalConsumer();
+ consumer.addConsumerListener(new ConsumerAdapter() {
+ public void dataReceived(DataEvent e) {
+ ProbeData data = e.getProbeData();
+ List <Record> records = data.getRecords();
+ for (Record r : records) {
+ if (r instanceof ExitRecord) {
+ ExitRecord exitRecord = (ExitRecord)r;
+ exitStatus = exitRecord.getStatus();
+ }
+ }
+ System.out.println(probeDataString(e.getProbeData()));
+ }
+ public void consumerStopped(ConsumerEvent e) {
+ consumer.close();
+ System.exit(exitStatus);
+ }
+ });
+
+ File file = new File(args[0]);
+ try {
+ consumer.open();
+ consumer.compile(file);
+ consumer.enable();
+ consumer.go();
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ System.exit(1);
+ } catch (IOException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestProbeData.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestProbeData.java
new file mode 100644
index 000000000000..78a65f9e68ee
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestProbeData.java
@@ -0,0 +1,110 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+import java.util.*;
+import org.opensolaris.os.dtrace.*;
+
+/**
+ * Regression test verifies that ProbeData instances sort as expected
+ * with multiple enabled probe IDs and multiple records including byte
+ * array (sorted as unsigned bytes), stand-alone ufunc() action, and
+ * signed integer.
+ */
+public class TestProbeData {
+ public static final String PROGRAM =
+ "pid$target::fN:entry\n" +
+ "{\n" +
+ " tracemem(copyin(arg1, 6), 6);\n" +
+ " ufunc(arg0);\n" +
+ " trace((int)arg2);\n" +
+ "}" +
+ "" +
+ "pid$target::fN2:entry\n" +
+ "{\n" +
+ " tracemem(copyin(arg1, 6), 6);\n" +
+ " ufunc(arg0);\n" +
+ " trace((int)arg2);\n" +
+ "}";
+
+ static String
+ getString(ProbeData p)
+ {
+ StringBuilder buf = new StringBuilder();
+ buf.append("[probe ");
+ buf.append(p.getEnabledProbeID());
+ buf.append(' ');
+ ProbeDescription d = p.getEnabledProbeDescription();
+ buf.append("pid$target");
+ buf.append(':');
+ buf.append(d.getModule());
+ buf.append(':');
+ buf.append(d.getFunction());
+ buf.append(':');
+ buf.append(d.getName());
+ buf.append(' ');
+ buf.append(p.getRecords());
+ buf.append("]");
+ return buf.toString();
+ }
+
+ public static void
+ main(String[] args)
+ {
+ if (args.length != 1) {
+ System.err.println("usage: java TestProbedata <command>");
+ System.exit(2);
+ }
+
+ String command = args[0];
+ final Consumer consumer = new LocalConsumer();
+ final List <ProbeData> list = new ArrayList <ProbeData> ();
+ consumer.addConsumerListener(new ConsumerAdapter() {
+ public void dataReceived(DataEvent e) {
+ list.add(e.getProbeData());
+ }
+ public void consumerStopped(ConsumerEvent e) {
+ Collections.sort(list);
+ for (ProbeData p : list) {
+ System.out.println(getString(p));
+ System.out.println();
+ }
+ consumer.close();
+ }
+ });
+
+ try {
+ consumer.open();
+ consumer.createProcess(command);
+ consumer.compile(PROGRAM);
+ consumer.enable();
+ consumer.go();
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestProbeDescription.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestProbeDescription.java
new file mode 100644
index 000000000000..b9e95700278b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestProbeDescription.java
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+import org.opensolaris.os.dtrace.*;
+import java.util.logging.*;
+
+/**
+ * Regression for 6399915 ProbeDescription single arg constructor should
+ * parse probe descriptions.
+ */
+public class TestProbeDescription {
+ public static void
+ main(String[] args)
+ {
+ ProbeDescription p = null;
+ int len = args.length;
+ if (len == 0) {
+ p = new ProbeDescription("syscall:::entry");
+ } else if (len == 1) {
+ p = new ProbeDescription(args[0]);
+ } else if (len == 2) {
+ p = new ProbeDescription(args[0], args[1]);
+ } else if (len == 3) {
+ p = new ProbeDescription(args[0], args[1], args[2]);
+ } else if (len == 4) {
+ p = new ProbeDescription(args[0], args[1], args[2], args[3]);
+ }
+ System.out.println(p);
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestStateMachine.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestStateMachine.java
new file mode 100644
index 000000000000..8875d0665a79
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestStateMachine.java
@@ -0,0 +1,627 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+import org.opensolaris.os.dtrace.*;
+
+/**
+ * Regression test for the LocalConsumer state machine. Calls Consumer
+ * methods before and after open(), compile(), enable(), go(), stop(),
+ * and close() to verify that the calls succeed as expected or fail with
+ * the expected Java exception.
+ */
+public class TestStateMachine {
+ static Program program;
+
+ static void
+ exit(int status)
+ {
+ exit(status, null);
+ }
+
+ static void
+ exit(int status, String msg)
+ {
+ if (msg != null) {
+ System.out.println(msg);
+ }
+ System.out.flush();
+ System.err.flush();
+ System.exit(status);
+ }
+
+ static void
+ printState(Consumer consumer)
+ {
+ System.out.println("open: " + consumer.isOpen());
+ System.out.println("enabled: " + consumer.isEnabled());
+ System.out.println("closed: " + consumer.isClosed());
+ }
+
+ static void
+ beforeOpen(Consumer consumer)
+ {
+ System.out.println("before open");
+ printState(consumer);
+
+ // compile
+ try {
+ consumer.compile("syscall:::entry");
+ exit(1, "compile before open");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "compile before open");
+ }
+
+ // enable
+ try {
+ consumer.enable();
+ exit(1, "enable before open");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "enable before open");
+ }
+
+ // getOption, setOption, unsetOption
+ try {
+ consumer.getOption(Option.bufsize);
+ exit(1, "getOption before open");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getOption before open");
+ }
+ try {
+ consumer.setOption(Option.bufsize, Option.mb(1));
+ exit(1, "setOption before open");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "setOption before open");
+ }
+ try {
+ consumer.unsetOption(Option.quiet);
+ exit(1, "unsetOption before open");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "unsetOption before open");
+ }
+
+ // createProcess, grabProcess
+ try {
+ consumer.createProcess("date");
+ exit(1, "createProcess before open");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "createProcess before open");
+ }
+ try {
+ consumer.grabProcess(1);
+ exit(1, "grabProcess before open");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "grabProcess before open");
+ }
+
+ // listProbes
+ try {
+ consumer.listProbes(ProbeDescription.EMPTY);
+ exit(1, "listProbes before open");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "listProbes before open");
+ }
+
+ // getAggregate
+ try {
+ consumer.getAggregate();
+ exit(1, "getAggregate before open");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getAggregate before open");
+ }
+
+ // getVersion
+ try {
+ consumer.getVersion(); // allowed
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getVersion before open");
+ }
+ }
+
+ static void
+ beforeCompile(Consumer consumer)
+ {
+ System.out.println("before compile");
+ printState(consumer);
+
+ // open
+ try {
+ consumer.open();
+ exit(1, "open after open");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "open after open");
+ }
+
+ // enable
+ try {
+ consumer.enable();
+ exit(1, "enable before compile");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "enable before compile");
+ }
+ }
+
+ static void
+ beforeEnable(Consumer consumer)
+ {
+ System.out.println("before enable");
+ printState(consumer);
+
+ // go
+ try {
+ consumer.go();
+ exit(1, "go before enable");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "go before enable");
+ }
+ }
+
+ static void
+ beforeGo(Consumer consumer)
+ {
+ System.out.println("before go");
+ printState(consumer);
+
+ // getAggregate
+ try {
+ consumer.getAggregate();
+ exit(1, "getAggregate before go");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getAggregate before go");
+ }
+
+ // lookupKernelFunction, lookupUserFunction
+ try {
+ consumer.lookupKernelFunction(1);
+ exit(1, "lookupKernelFunction before go");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "lookupKernelFunction before go");
+ }
+ try {
+ consumer.lookupUserFunction(1, 1);
+ exit(1, "lookupUserFunction before go");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "lookupUserFunction before go");
+ }
+
+ // stop
+ try {
+ consumer.stop();
+ exit(1, "stop before go");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "stop before go");
+ }
+ }
+
+ static void
+ afterGo(Consumer consumer, Program program)
+ {
+ System.out.println("after go");
+ printState(consumer);
+
+ // go
+ try {
+ consumer.go();
+ exit(1, "go after go");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "go after go");
+ }
+
+ // createProcess, grabProcess
+ try {
+ consumer.createProcess("date");
+ exit(1, "createProcess after go");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "createProcess after go");
+ }
+ try {
+ consumer.grabProcess(1);
+ exit(1, "grabProcess after go");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "grabProcess after go");
+ }
+
+ // listProbes
+ try {
+ consumer.listProbes(ProbeDescription.EMPTY);
+ exit(1, "listProbes after go");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "listProbes after go");
+ }
+
+ // compile
+ try {
+ consumer.compile("syscall:::entry");
+ exit(1, "compile after go");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "compile after go");
+ }
+
+ // enable
+ try {
+ consumer.enable();
+ exit(1, "enable after go");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "enable after go");
+ }
+
+ // getAggregate
+ try {
+ consumer.getAggregate();
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getAggregate after go");
+ }
+
+ // getProgramInfo
+ try {
+ consumer.getProgramInfo(program);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getProgramInfo after go");
+ }
+
+ // getOption, setOption, unsetOption
+ try {
+ consumer.getOption(Option.quiet);
+ consumer.setOption(Option.quiet);
+ consumer.unsetOption(Option.quiet);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "get, set, unset option after go");
+ }
+ }
+
+ static void
+ afterStop(Consumer consumer, Program program)
+ {
+ System.out.println("after stop");
+ printState(consumer);
+
+ // stop
+ try {
+ consumer.stop();
+ exit(1, "stop after stop");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "stop after stop");
+ }
+
+ // getAggregate
+ try {
+ consumer.getAggregate();
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getAggregate after stop");
+ }
+
+ // getProgramInfo
+ try {
+ consumer.getProgramInfo(program);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getProgramInfo after stop");
+ }
+
+ // getOption, setOption, unsetOption
+ try {
+ consumer.getOption(Option.quiet);
+ consumer.setOption(Option.quiet);
+ consumer.unsetOption(Option.quiet);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "get, set, unset option after stop");
+ }
+ }
+
+ static void
+ afterClose(Consumer consumer, Program program)
+ {
+ System.out.println("after close");
+ printState(consumer);
+
+ // open
+ try {
+ consumer.open();
+ exit(1, "open after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "open after close");
+ }
+
+ // compile
+ try {
+ consumer.compile("syscall:::entry");
+ exit(1, "compile after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "compile after close");
+ }
+
+ // enable
+ try {
+ consumer.enable();
+ exit(1, "enable after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "enable after close");
+ }
+
+ // getOption, setOption, unsetOption
+ try {
+ consumer.getOption(Option.bufsize);
+ exit(1, "getOption after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getOption after close");
+ }
+ try {
+ consumer.setOption(Option.bufsize, Option.mb(1));
+ exit(1, "setOption after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "setOption after close");
+ }
+ try {
+ consumer.unsetOption(Option.quiet);
+ exit(1, "unsetOption after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "unsetOption after close");
+ }
+
+ // createProcess, grabProcess
+ try {
+ consumer.createProcess("date");
+ exit(1, "createProcess after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "createProcess after close");
+ }
+ try {
+ consumer.grabProcess(1);
+ exit(1, "grabProcess after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "grabProcess after close");
+ }
+
+ // listProbes
+ try {
+ consumer.listProbes(ProbeDescription.EMPTY);
+ exit(1, "listProbes after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "listProbes after close");
+ }
+
+ // getAggregate
+ try {
+ consumer.getAggregate();
+ exit(1, "getAggregate after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getAggregate after close");
+ }
+
+ // getVersion
+ try {
+ consumer.getVersion(); // allowed
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getVersion after close");
+ }
+
+ // go
+ try {
+ consumer.go();
+ exit(1, "go after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "go after close");
+ }
+
+ // lookupKernelFunction, lookupUserFunction
+ try {
+ consumer.lookupKernelFunction(1);
+ exit(1, "lookupKernelFunction after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "lookupKernelFunction after close");
+ }
+ try {
+ consumer.lookupUserFunction(1, 1);
+ exit(1, "lookupUserFunction after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "lookupUserFunction after close");
+ }
+
+ // stop
+ try {
+ consumer.stop();
+ exit(1, "stop after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "stop after close");
+ }
+
+ // getProgramInfo
+ try {
+ consumer.getProgramInfo(program);
+ exit(1, "getProgramInfo after close");
+ } catch (IllegalStateException e) {
+ System.out.println(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ exit(1, "getProgramInfo after close");
+ }
+ }
+
+ public static void
+ main(String[] args)
+ {
+ final Consumer consumer = new LocalConsumer();
+ consumer.addConsumerListener(new ConsumerAdapter() {
+ public void consumerStarted(ConsumerEvent e) {
+ System.out.println("consumerStarted, running: " +
+ consumer.isRunning());
+ afterGo(consumer, program);
+ }
+ public void consumerStopped(ConsumerEvent e) {
+ System.out.println("consumerStopped, running: " +
+ consumer.isRunning());
+ }
+ });
+
+ try {
+ beforeOpen(consumer);
+ consumer.open();
+ beforeCompile(consumer);
+ program = consumer.compile(
+ "syscall:::entry { @[execname] = count(); } " +
+ "tick-101ms { printa(@); }");
+ beforeEnable(consumer);
+ consumer.enable();
+ beforeGo(consumer);
+ System.out.println("before go, running: " + consumer.isRunning());
+ consumer.go();
+ // Avoid race, call afterGo() in ConsumerListener
+ try {
+ Thread.currentThread().sleep(300);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ consumer.stop();
+ System.out.println("after stop, running: " + consumer.isRunning());
+ afterStop(consumer, program);
+ consumer.close();
+ afterClose(consumer, program);
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ exit(1);
+ }
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestStopLock.java b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestStopLock.java
new file mode 100644
index 000000000000..f37c9cf1eb7d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestStopLock.java
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * ident "%Z%%M% %I% %E% SMI"
+ */
+
+import org.opensolaris.os.dtrace.*;
+
+/**
+ * Test for bug 6399888 stop() hangs if ConsumerListener calls
+ * synchronized Consumer method
+ */
+public class TestStopLock {
+ public static void
+ main(String[] args)
+ {
+ final Consumer consumer = new LocalConsumer();
+ consumer.addConsumerListener(new ConsumerAdapter() {
+ @Override
+ public void intervalBegan(ConsumerEvent e) {
+ consumer.isRunning();
+ }
+ });
+
+ try {
+ consumer.open();
+ consumer.compile("syscall:::entry { @[execname] = count(); } " +
+ "tick-101ms { printa(@); }");
+ consumer.enable();
+ consumer.go();
+ try {
+ Thread.currentThread().sleep(500);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ consumer.stop();
+ consumer.close();
+ } catch (DTraceException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ System.out.println("Successful");
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh
new file mode 100644
index 000000000000..85c2c706afc5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh
@@ -0,0 +1,39 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Fixed bug 6426129 abort() after close() throws
+# NoSuchElementException.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestAbort
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh.out
new file mode 100644
index 000000000000..628d78702724
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh.out
@@ -0,0 +1 @@
+Successful
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh
new file mode 100644
index 000000000000..99b232eb98b9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh
@@ -0,0 +1,41 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# All Serializable classes can be serializaed and deserialized,
+# also encoded in XML and decoded, and still remain equal and have
+# equal string values.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestBean TestBean.out
+rm -f TestBean.out
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out
new file mode 100644
index 000000000000..cf24c672645e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out
@@ -0,0 +1,722 @@
+ExitRecord:
+ serialized: 1
+ deserialized: 1
+ExitRecord:
+ encoded: 1
+ decoded: 1
+AggregationRecord:
+ serialized: org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]
+ deserialized: org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]
+AggregationRecord:
+ encoded: org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]
+ decoded: org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]
+Aggregation:
+ serialized: org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]
+ deserialized: org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]
+Aggregation:
+ encoded: org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]
+ decoded: org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]
+Tuple:
+ serialized: [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]
+ deserialized: [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]
+Tuple:
+ encoded: [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]
+ decoded: [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]
+ScalarRecord:
+ serialized: [1, 2, 3]
+ deserialized: [1, 2, 3]
+ScalarRecord:
+ encoded: [1, 2, 3]
+ decoded: [1, 2, 3]
+KernelStackRecord:
+ serialized:
+ Frame 1
+ Frame 2
+ Frame 3
+
+ deserialized:
+ Frame 1
+ Frame 2
+ Frame 3
+
+KernelStackRecord:
+ encoded:
+ Frame 1
+ Frame 2
+ Frame 3
+
+ decoded:
+ Frame 1
+ Frame 2
+ Frame 3
+
+LogDistribution:
+ serialized: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -4611686018427387904, max = -2305843009213693953, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2305843009213693952, max = -1152921504606846977, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1152921504606846976, max = -576460752303423489, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = -576460752303423488, max = -288230376151711745, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = -288230376151711744, max = -144115188075855873, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = -144115188075855872, max = -72057594037927937, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = -72057594037927936, max = -36028797018963969, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = -36028797018963968, max = -18014398509481985, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = -18014398509481984, max = -9007199254740993, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = -9007199254740992, max = -4503599627370497, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4503599627370496, max = -2251799813685249, frequency = 10], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2251799813685248, max = -1125899906842625, frequency = 11], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1125899906842624, max = -562949953421313, frequency = 12], org.opensolaris.os.dtrace.Distribution$Bucket[min = -562949953421312, max = -281474976710657, frequency = 13], org.opensolaris.os.dtrace.Distribution$Bucket[min = -281474976710656, max = -140737488355329, frequency = 14], org.opensolaris.os.dtrace.Distribution$Bucket[min = -140737488355328, max = -70368744177665, frequency = 15], org.opensolaris.os.dtrace.Distribution$Bucket[min = -70368744177664, max = -35184372088833, frequency = 16], org.opensolaris.os.dtrace.Distribution$Bucket[min = -35184372088832, max = -17592186044417, frequency = 17], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17592186044416, max = -8796093022209, frequency = 18], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8796093022208, max = -4398046511105, frequency = 19], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4398046511104, max = -2199023255553, frequency = 20], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2199023255552, max = -1099511627777, frequency = 21], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1099511627776, max = -549755813889, frequency = 22], org.opensolaris.os.dtrace.Distribution$Bucket[min = -549755813888, max = -274877906945, frequency = 23], org.opensolaris.os.dtrace.Distribution$Bucket[min = -274877906944, max = -137438953473, frequency = 24], org.opensolaris.os.dtrace.Distribution$Bucket[min = -137438953472, max = -68719476737, frequency = 25], org.opensolaris.os.dtrace.Distribution$Bucket[min = -68719476736, max = -34359738369, frequency = 26], org.opensolaris.os.dtrace.Distribution$Bucket[min = -34359738368, max = -17179869185, frequency = 27], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17179869184, max = -8589934593, frequency = 28], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8589934592, max = -4294967297, frequency = 29], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4294967296, max = -2147483649, frequency = 30], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2147483648, max = -1073741825, frequency = 31], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1073741824, max = -536870913, frequency = 32], org.opensolaris.os.dtrace.Distribution$Bucket[min = -536870912, max = -268435457, frequency = 33], org.opensolaris.os.dtrace.Distribution$Bucket[min = -268435456, max = -134217729, frequency = 34], org.opensolaris.os.dtrace.Distribution$Bucket[min = -134217728, max = -67108865, frequency = 35], org.opensolaris.os.dtrace.Distribution$Bucket[min = -67108864, max = -33554433, frequency = 36], org.opensolaris.os.dtrace.Distribution$Bucket[min = -33554432, max = -16777217, frequency = 37], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16777216, max = -8388609, frequency = 38], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8388608, max = -4194305, frequency = 39], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4194304, max = -2097153, frequency = 40], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2097152, max = -1048577, frequency = 41], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1048576, max = -524289, frequency = 42], org.opensolaris.os.dtrace.Distribution$Bucket[min = -524288, max = -262145, frequency = 43], org.opensolaris.os.dtrace.Distribution$Bucket[min = -262144, max = -131073, frequency = 44], org.opensolaris.os.dtrace.Distribution$Bucket[min = -131072, max = -65537, frequency = 45], org.opensolaris.os.dtrace.Distribution$Bucket[min = -65536, max = -32769, frequency = 46], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32768, max = -16385, frequency = 47], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16384, max = -8193, frequency = 48], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8192, max = -4097, frequency = 49], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4096, max = -2049, frequency = 50], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2048, max = -1025, frequency = 51], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1024, max = -513, frequency = 52], org.opensolaris.os.dtrace.Distribution$Bucket[min = -512, max = -257, frequency = 53], org.opensolaris.os.dtrace.Distribution$Bucket[min = -256, max = -129, frequency = 54], org.opensolaris.os.dtrace.Distribution$Bucket[min = -128, max = -65, frequency = 55], org.opensolaris.os.dtrace.Distribution$Bucket[min = -64, max = -33, frequency = 56], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32, max = -17, frequency = 57], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16, max = -9, frequency = 58], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8, max = -5, frequency = 59], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4, max = -3, frequency = 60], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2, max = -2, frequency = 61], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1, max = -1, frequency = 62], org.opensolaris.os.dtrace.Distribution$Bucket[min = 0, max = 0, frequency = 63], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 64], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 65], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 66], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 67], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 68], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 69], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 70], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 255, frequency = 71], org.opensolaris.os.dtrace.Distribution$Bucket[min = 256, max = 511, frequency = 72], org.opensolaris.os.dtrace.Distribution$Bucket[min = 512, max = 1023, frequency = 73], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1024, max = 2047, frequency = 74], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2048, max = 4095, frequency = 75], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4096, max = 8191, frequency = 76], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8192, max = 16383, frequency = 77], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16384, max = 32767, frequency = 78], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32768, max = 65535, frequency = 79], org.opensolaris.os.dtrace.Distribution$Bucket[min = 65536, max = 131071, frequency = 80], org.opensolaris.os.dtrace.Distribution$Bucket[min = 131072, max = 262143, frequency = 81], org.opensolaris.os.dtrace.Distribution$Bucket[min = 262144, max = 524287, frequency = 82], org.opensolaris.os.dtrace.Distribution$Bucket[min = 524288, max = 1048575, frequency = 83], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1048576, max = 2097151, frequency = 84], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2097152, max = 4194303, frequency = 85], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4194304, max = 8388607, frequency = 86], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8388608, max = 16777215, frequency = 87], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16777216, max = 33554431, frequency = 88], org.opensolaris.os.dtrace.Distribution$Bucket[min = 33554432, max = 67108863, frequency = 89], org.opensolaris.os.dtrace.Distribution$Bucket[min = 67108864, max = 134217727, frequency = 90], org.opensolaris.os.dtrace.Distribution$Bucket[min = 134217728, max = 268435455, frequency = 91], org.opensolaris.os.dtrace.Distribution$Bucket[min = 268435456, max = 536870911, frequency = 92], org.opensolaris.os.dtrace.Distribution$Bucket[min = 536870912, max = 1073741823, frequency = 93], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1073741824, max = 2147483647, frequency = 94], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2147483648, max = 4294967295, frequency = 95], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4294967296, max = 8589934591, frequency = 96], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8589934592, max = 17179869183, frequency = 97], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17179869184, max = 34359738367, frequency = 98], org.opensolaris.os.dtrace.Distribution$Bucket[min = 34359738368, max = 68719476735, frequency = 99], org.opensolaris.os.dtrace.Distribution$Bucket[min = 68719476736, max = 137438953471, frequency = 100], org.opensolaris.os.dtrace.Distribution$Bucket[min = 137438953472, max = 274877906943, frequency = 101], org.opensolaris.os.dtrace.Distribution$Bucket[min = 274877906944, max = 549755813887, frequency = 102], org.opensolaris.os.dtrace.Distribution$Bucket[min = 549755813888, max = 1099511627775, frequency = 103], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1099511627776, max = 2199023255551, frequency = 104], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2199023255552, max = 4398046511103, frequency = 105], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4398046511104, max = 8796093022207, frequency = 106], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8796093022208, max = 17592186044415, frequency = 107], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17592186044416, max = 35184372088831, frequency = 108], org.opensolaris.os.dtrace.Distribution$Bucket[min = 35184372088832, max = 70368744177663, frequency = 109], org.opensolaris.os.dtrace.Distribution$Bucket[min = 70368744177664, max = 140737488355327, frequency = 110], org.opensolaris.os.dtrace.Distribution$Bucket[min = 140737488355328, max = 281474976710655, frequency = 111], org.opensolaris.os.dtrace.Distribution$Bucket[min = 281474976710656, max = 562949953421311, frequency = 112], org.opensolaris.os.dtrace.Distribution$Bucket[min = 562949953421312, max = 1125899906842623, frequency = 113], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1125899906842624, max = 2251799813685247, frequency = 114], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2251799813685248, max = 4503599627370495, frequency = 115], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4503599627370496, max = 9007199254740991, frequency = 116], org.opensolaris.os.dtrace.Distribution$Bucket[min = 9007199254740992, max = 18014398509481983, frequency = 117], org.opensolaris.os.dtrace.Distribution$Bucket[min = 18014398509481984, max = 36028797018963967, frequency = 118], org.opensolaris.os.dtrace.Distribution$Bucket[min = 36028797018963968, max = 72057594037927935, frequency = 119], org.opensolaris.os.dtrace.Distribution$Bucket[min = 72057594037927936, max = 144115188075855871, frequency = 120], org.opensolaris.os.dtrace.Distribution$Bucket[min = 144115188075855872, max = 288230376151711743, frequency = 121], org.opensolaris.os.dtrace.Distribution$Bucket[min = 288230376151711744, max = 576460752303423487, frequency = 122], org.opensolaris.os.dtrace.Distribution$Bucket[min = 576460752303423488, max = 1152921504606846975, frequency = 123], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1152921504606846976, max = 2305843009213693951, frequency = 124], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2305843009213693952, max = 4611686018427387903, frequency = 125], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4611686018427387904, max = 9223372036854775807, frequency = 126]], total = 8001.0]
+ deserialized: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -4611686018427387904, max = -2305843009213693953, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2305843009213693952, max = -1152921504606846977, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1152921504606846976, max = -576460752303423489, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = -576460752303423488, max = -288230376151711745, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = -288230376151711744, max = -144115188075855873, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = -144115188075855872, max = -72057594037927937, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = -72057594037927936, max = -36028797018963969, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = -36028797018963968, max = -18014398509481985, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = -18014398509481984, max = -9007199254740993, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = -9007199254740992, max = -4503599627370497, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4503599627370496, max = -2251799813685249, frequency = 10], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2251799813685248, max = -1125899906842625, frequency = 11], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1125899906842624, max = -562949953421313, frequency = 12], org.opensolaris.os.dtrace.Distribution$Bucket[min = -562949953421312, max = -281474976710657, frequency = 13], org.opensolaris.os.dtrace.Distribution$Bucket[min = -281474976710656, max = -140737488355329, frequency = 14], org.opensolaris.os.dtrace.Distribution$Bucket[min = -140737488355328, max = -70368744177665, frequency = 15], org.opensolaris.os.dtrace.Distribution$Bucket[min = -70368744177664, max = -35184372088833, frequency = 16], org.opensolaris.os.dtrace.Distribution$Bucket[min = -35184372088832, max = -17592186044417, frequency = 17], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17592186044416, max = -8796093022209, frequency = 18], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8796093022208, max = -4398046511105, frequency = 19], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4398046511104, max = -2199023255553, frequency = 20], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2199023255552, max = -1099511627777, frequency = 21], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1099511627776, max = -549755813889, frequency = 22], org.opensolaris.os.dtrace.Distribution$Bucket[min = -549755813888, max = -274877906945, frequency = 23], org.opensolaris.os.dtrace.Distribution$Bucket[min = -274877906944, max = -137438953473, frequency = 24], org.opensolaris.os.dtrace.Distribution$Bucket[min = -137438953472, max = -68719476737, frequency = 25], org.opensolaris.os.dtrace.Distribution$Bucket[min = -68719476736, max = -34359738369, frequency = 26], org.opensolaris.os.dtrace.Distribution$Bucket[min = -34359738368, max = -17179869185, frequency = 27], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17179869184, max = -8589934593, frequency = 28], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8589934592, max = -4294967297, frequency = 29], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4294967296, max = -2147483649, frequency = 30], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2147483648, max = -1073741825, frequency = 31], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1073741824, max = -536870913, frequency = 32], org.opensolaris.os.dtrace.Distribution$Bucket[min = -536870912, max = -268435457, frequency = 33], org.opensolaris.os.dtrace.Distribution$Bucket[min = -268435456, max = -134217729, frequency = 34], org.opensolaris.os.dtrace.Distribution$Bucket[min = -134217728, max = -67108865, frequency = 35], org.opensolaris.os.dtrace.Distribution$Bucket[min = -67108864, max = -33554433, frequency = 36], org.opensolaris.os.dtrace.Distribution$Bucket[min = -33554432, max = -16777217, frequency = 37], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16777216, max = -8388609, frequency = 38], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8388608, max = -4194305, frequency = 39], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4194304, max = -2097153, frequency = 40], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2097152, max = -1048577, frequency = 41], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1048576, max = -524289, frequency = 42], org.opensolaris.os.dtrace.Distribution$Bucket[min = -524288, max = -262145, frequency = 43], org.opensolaris.os.dtrace.Distribution$Bucket[min = -262144, max = -131073, frequency = 44], org.opensolaris.os.dtrace.Distribution$Bucket[min = -131072, max = -65537, frequency = 45], org.opensolaris.os.dtrace.Distribution$Bucket[min = -65536, max = -32769, frequency = 46], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32768, max = -16385, frequency = 47], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16384, max = -8193, frequency = 48], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8192, max = -4097, frequency = 49], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4096, max = -2049, frequency = 50], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2048, max = -1025, frequency = 51], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1024, max = -513, frequency = 52], org.opensolaris.os.dtrace.Distribution$Bucket[min = -512, max = -257, frequency = 53], org.opensolaris.os.dtrace.Distribution$Bucket[min = -256, max = -129, frequency = 54], org.opensolaris.os.dtrace.Distribution$Bucket[min = -128, max = -65, frequency = 55], org.opensolaris.os.dtrace.Distribution$Bucket[min = -64, max = -33, frequency = 56], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32, max = -17, frequency = 57], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16, max = -9, frequency = 58], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8, max = -5, frequency = 59], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4, max = -3, frequency = 60], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2, max = -2, frequency = 61], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1, max = -1, frequency = 62], org.opensolaris.os.dtrace.Distribution$Bucket[min = 0, max = 0, frequency = 63], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 64], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 65], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 66], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 67], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 68], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 69], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 70], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 255, frequency = 71], org.opensolaris.os.dtrace.Distribution$Bucket[min = 256, max = 511, frequency = 72], org.opensolaris.os.dtrace.Distribution$Bucket[min = 512, max = 1023, frequency = 73], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1024, max = 2047, frequency = 74], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2048, max = 4095, frequency = 75], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4096, max = 8191, frequency = 76], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8192, max = 16383, frequency = 77], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16384, max = 32767, frequency = 78], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32768, max = 65535, frequency = 79], org.opensolaris.os.dtrace.Distribution$Bucket[min = 65536, max = 131071, frequency = 80], org.opensolaris.os.dtrace.Distribution$Bucket[min = 131072, max = 262143, frequency = 81], org.opensolaris.os.dtrace.Distribution$Bucket[min = 262144, max = 524287, frequency = 82], org.opensolaris.os.dtrace.Distribution$Bucket[min = 524288, max = 1048575, frequency = 83], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1048576, max = 2097151, frequency = 84], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2097152, max = 4194303, frequency = 85], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4194304, max = 8388607, frequency = 86], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8388608, max = 16777215, frequency = 87], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16777216, max = 33554431, frequency = 88], org.opensolaris.os.dtrace.Distribution$Bucket[min = 33554432, max = 67108863, frequency = 89], org.opensolaris.os.dtrace.Distribution$Bucket[min = 67108864, max = 134217727, frequency = 90], org.opensolaris.os.dtrace.Distribution$Bucket[min = 134217728, max = 268435455, frequency = 91], org.opensolaris.os.dtrace.Distribution$Bucket[min = 268435456, max = 536870911, frequency = 92], org.opensolaris.os.dtrace.Distribution$Bucket[min = 536870912, max = 1073741823, frequency = 93], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1073741824, max = 2147483647, frequency = 94], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2147483648, max = 4294967295, frequency = 95], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4294967296, max = 8589934591, frequency = 96], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8589934592, max = 17179869183, frequency = 97], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17179869184, max = 34359738367, frequency = 98], org.opensolaris.os.dtrace.Distribution$Bucket[min = 34359738368, max = 68719476735, frequency = 99], org.opensolaris.os.dtrace.Distribution$Bucket[min = 68719476736, max = 137438953471, frequency = 100], org.opensolaris.os.dtrace.Distribution$Bucket[min = 137438953472, max = 274877906943, frequency = 101], org.opensolaris.os.dtrace.Distribution$Bucket[min = 274877906944, max = 549755813887, frequency = 102], org.opensolaris.os.dtrace.Distribution$Bucket[min = 549755813888, max = 1099511627775, frequency = 103], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1099511627776, max = 2199023255551, frequency = 104], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2199023255552, max = 4398046511103, frequency = 105], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4398046511104, max = 8796093022207, frequency = 106], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8796093022208, max = 17592186044415, frequency = 107], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17592186044416, max = 35184372088831, frequency = 108], org.opensolaris.os.dtrace.Distribution$Bucket[min = 35184372088832, max = 70368744177663, frequency = 109], org.opensolaris.os.dtrace.Distribution$Bucket[min = 70368744177664, max = 140737488355327, frequency = 110], org.opensolaris.os.dtrace.Distribution$Bucket[min = 140737488355328, max = 281474976710655, frequency = 111], org.opensolaris.os.dtrace.Distribution$Bucket[min = 281474976710656, max = 562949953421311, frequency = 112], org.opensolaris.os.dtrace.Distribution$Bucket[min = 562949953421312, max = 1125899906842623, frequency = 113], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1125899906842624, max = 2251799813685247, frequency = 114], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2251799813685248, max = 4503599627370495, frequency = 115], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4503599627370496, max = 9007199254740991, frequency = 116], org.opensolaris.os.dtrace.Distribution$Bucket[min = 9007199254740992, max = 18014398509481983, frequency = 117], org.opensolaris.os.dtrace.Distribution$Bucket[min = 18014398509481984, max = 36028797018963967, frequency = 118], org.opensolaris.os.dtrace.Distribution$Bucket[min = 36028797018963968, max = 72057594037927935, frequency = 119], org.opensolaris.os.dtrace.Distribution$Bucket[min = 72057594037927936, max = 144115188075855871, frequency = 120], org.opensolaris.os.dtrace.Distribution$Bucket[min = 144115188075855872, max = 288230376151711743, frequency = 121], org.opensolaris.os.dtrace.Distribution$Bucket[min = 288230376151711744, max = 576460752303423487, frequency = 122], org.opensolaris.os.dtrace.Distribution$Bucket[min = 576460752303423488, max = 1152921504606846975, frequency = 123], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1152921504606846976, max = 2305843009213693951, frequency = 124], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2305843009213693952, max = 4611686018427387903, frequency = 125], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4611686018427387904, max = 9223372036854775807, frequency = 126]], total = 8001.0]
+LogDistribution:
+ encoded: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -4611686018427387904, max = -2305843009213693953, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2305843009213693952, max = -1152921504606846977, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1152921504606846976, max = -576460752303423489, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = -576460752303423488, max = -288230376151711745, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = -288230376151711744, max = -144115188075855873, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = -144115188075855872, max = -72057594037927937, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = -72057594037927936, max = -36028797018963969, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = -36028797018963968, max = -18014398509481985, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = -18014398509481984, max = -9007199254740993, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = -9007199254740992, max = -4503599627370497, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4503599627370496, max = -2251799813685249, frequency = 10], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2251799813685248, max = -1125899906842625, frequency = 11], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1125899906842624, max = -562949953421313, frequency = 12], org.opensolaris.os.dtrace.Distribution$Bucket[min = -562949953421312, max = -281474976710657, frequency = 13], org.opensolaris.os.dtrace.Distribution$Bucket[min = -281474976710656, max = -140737488355329, frequency = 14], org.opensolaris.os.dtrace.Distribution$Bucket[min = -140737488355328, max = -70368744177665, frequency = 15], org.opensolaris.os.dtrace.Distribution$Bucket[min = -70368744177664, max = -35184372088833, frequency = 16], org.opensolaris.os.dtrace.Distribution$Bucket[min = -35184372088832, max = -17592186044417, frequency = 17], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17592186044416, max = -8796093022209, frequency = 18], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8796093022208, max = -4398046511105, frequency = 19], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4398046511104, max = -2199023255553, frequency = 20], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2199023255552, max = -1099511627777, frequency = 21], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1099511627776, max = -549755813889, frequency = 22], org.opensolaris.os.dtrace.Distribution$Bucket[min = -549755813888, max = -274877906945, frequency = 23], org.opensolaris.os.dtrace.Distribution$Bucket[min = -274877906944, max = -137438953473, frequency = 24], org.opensolaris.os.dtrace.Distribution$Bucket[min = -137438953472, max = -68719476737, frequency = 25], org.opensolaris.os.dtrace.Distribution$Bucket[min = -68719476736, max = -34359738369, frequency = 26], org.opensolaris.os.dtrace.Distribution$Bucket[min = -34359738368, max = -17179869185, frequency = 27], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17179869184, max = -8589934593, frequency = 28], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8589934592, max = -4294967297, frequency = 29], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4294967296, max = -2147483649, frequency = 30], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2147483648, max = -1073741825, frequency = 31], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1073741824, max = -536870913, frequency = 32], org.opensolaris.os.dtrace.Distribution$Bucket[min = -536870912, max = -268435457, frequency = 33], org.opensolaris.os.dtrace.Distribution$Bucket[min = -268435456, max = -134217729, frequency = 34], org.opensolaris.os.dtrace.Distribution$Bucket[min = -134217728, max = -67108865, frequency = 35], org.opensolaris.os.dtrace.Distribution$Bucket[min = -67108864, max = -33554433, frequency = 36], org.opensolaris.os.dtrace.Distribution$Bucket[min = -33554432, max = -16777217, frequency = 37], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16777216, max = -8388609, frequency = 38], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8388608, max = -4194305, frequency = 39], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4194304, max = -2097153, frequency = 40], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2097152, max = -1048577, frequency = 41], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1048576, max = -524289, frequency = 42], org.opensolaris.os.dtrace.Distribution$Bucket[min = -524288, max = -262145, frequency = 43], org.opensolaris.os.dtrace.Distribution$Bucket[min = -262144, max = -131073, frequency = 44], org.opensolaris.os.dtrace.Distribution$Bucket[min = -131072, max = -65537, frequency = 45], org.opensolaris.os.dtrace.Distribution$Bucket[min = -65536, max = -32769, frequency = 46], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32768, max = -16385, frequency = 47], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16384, max = -8193, frequency = 48], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8192, max = -4097, frequency = 49], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4096, max = -2049, frequency = 50], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2048, max = -1025, frequency = 51], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1024, max = -513, frequency = 52], org.opensolaris.os.dtrace.Distribution$Bucket[min = -512, max = -257, frequency = 53], org.opensolaris.os.dtrace.Distribution$Bucket[min = -256, max = -129, frequency = 54], org.opensolaris.os.dtrace.Distribution$Bucket[min = -128, max = -65, frequency = 55], org.opensolaris.os.dtrace.Distribution$Bucket[min = -64, max = -33, frequency = 56], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32, max = -17, frequency = 57], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16, max = -9, frequency = 58], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8, max = -5, frequency = 59], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4, max = -3, frequency = 60], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2, max = -2, frequency = 61], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1, max = -1, frequency = 62], org.opensolaris.os.dtrace.Distribution$Bucket[min = 0, max = 0, frequency = 63], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 64], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 65], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 66], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 67], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 68], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 69], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 70], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 255, frequency = 71], org.opensolaris.os.dtrace.Distribution$Bucket[min = 256, max = 511, frequency = 72], org.opensolaris.os.dtrace.Distribution$Bucket[min = 512, max = 1023, frequency = 73], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1024, max = 2047, frequency = 74], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2048, max = 4095, frequency = 75], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4096, max = 8191, frequency = 76], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8192, max = 16383, frequency = 77], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16384, max = 32767, frequency = 78], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32768, max = 65535, frequency = 79], org.opensolaris.os.dtrace.Distribution$Bucket[min = 65536, max = 131071, frequency = 80], org.opensolaris.os.dtrace.Distribution$Bucket[min = 131072, max = 262143, frequency = 81], org.opensolaris.os.dtrace.Distribution$Bucket[min = 262144, max = 524287, frequency = 82], org.opensolaris.os.dtrace.Distribution$Bucket[min = 524288, max = 1048575, frequency = 83], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1048576, max = 2097151, frequency = 84], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2097152, max = 4194303, frequency = 85], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4194304, max = 8388607, frequency = 86], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8388608, max = 16777215, frequency = 87], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16777216, max = 33554431, frequency = 88], org.opensolaris.os.dtrace.Distribution$Bucket[min = 33554432, max = 67108863, frequency = 89], org.opensolaris.os.dtrace.Distribution$Bucket[min = 67108864, max = 134217727, frequency = 90], org.opensolaris.os.dtrace.Distribution$Bucket[min = 134217728, max = 268435455, frequency = 91], org.opensolaris.os.dtrace.Distribution$Bucket[min = 268435456, max = 536870911, frequency = 92], org.opensolaris.os.dtrace.Distribution$Bucket[min = 536870912, max = 1073741823, frequency = 93], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1073741824, max = 2147483647, frequency = 94], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2147483648, max = 4294967295, frequency = 95], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4294967296, max = 8589934591, frequency = 96], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8589934592, max = 17179869183, frequency = 97], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17179869184, max = 34359738367, frequency = 98], org.opensolaris.os.dtrace.Distribution$Bucket[min = 34359738368, max = 68719476735, frequency = 99], org.opensolaris.os.dtrace.Distribution$Bucket[min = 68719476736, max = 137438953471, frequency = 100], org.opensolaris.os.dtrace.Distribution$Bucket[min = 137438953472, max = 274877906943, frequency = 101], org.opensolaris.os.dtrace.Distribution$Bucket[min = 274877906944, max = 549755813887, frequency = 102], org.opensolaris.os.dtrace.Distribution$Bucket[min = 549755813888, max = 1099511627775, frequency = 103], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1099511627776, max = 2199023255551, frequency = 104], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2199023255552, max = 4398046511103, frequency = 105], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4398046511104, max = 8796093022207, frequency = 106], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8796093022208, max = 17592186044415, frequency = 107], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17592186044416, max = 35184372088831, frequency = 108], org.opensolaris.os.dtrace.Distribution$Bucket[min = 35184372088832, max = 70368744177663, frequency = 109], org.opensolaris.os.dtrace.Distribution$Bucket[min = 70368744177664, max = 140737488355327, frequency = 110], org.opensolaris.os.dtrace.Distribution$Bucket[min = 140737488355328, max = 281474976710655, frequency = 111], org.opensolaris.os.dtrace.Distribution$Bucket[min = 281474976710656, max = 562949953421311, frequency = 112], org.opensolaris.os.dtrace.Distribution$Bucket[min = 562949953421312, max = 1125899906842623, frequency = 113], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1125899906842624, max = 2251799813685247, frequency = 114], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2251799813685248, max = 4503599627370495, frequency = 115], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4503599627370496, max = 9007199254740991, frequency = 116], org.opensolaris.os.dtrace.Distribution$Bucket[min = 9007199254740992, max = 18014398509481983, frequency = 117], org.opensolaris.os.dtrace.Distribution$Bucket[min = 18014398509481984, max = 36028797018963967, frequency = 118], org.opensolaris.os.dtrace.Distribution$Bucket[min = 36028797018963968, max = 72057594037927935, frequency = 119], org.opensolaris.os.dtrace.Distribution$Bucket[min = 72057594037927936, max = 144115188075855871, frequency = 120], org.opensolaris.os.dtrace.Distribution$Bucket[min = 144115188075855872, max = 288230376151711743, frequency = 121], org.opensolaris.os.dtrace.Distribution$Bucket[min = 288230376151711744, max = 576460752303423487, frequency = 122], org.opensolaris.os.dtrace.Distribution$Bucket[min = 576460752303423488, max = 1152921504606846975, frequency = 123], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1152921504606846976, max = 2305843009213693951, frequency = 124], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2305843009213693952, max = 4611686018427387903, frequency = 125], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4611686018427387904, max = 9223372036854775807, frequency = 126]], total = 8001.0]
+ decoded: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -4611686018427387904, max = -2305843009213693953, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2305843009213693952, max = -1152921504606846977, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1152921504606846976, max = -576460752303423489, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = -576460752303423488, max = -288230376151711745, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = -288230376151711744, max = -144115188075855873, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = -144115188075855872, max = -72057594037927937, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = -72057594037927936, max = -36028797018963969, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = -36028797018963968, max = -18014398509481985, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = -18014398509481984, max = -9007199254740993, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = -9007199254740992, max = -4503599627370497, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4503599627370496, max = -2251799813685249, frequency = 10], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2251799813685248, max = -1125899906842625, frequency = 11], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1125899906842624, max = -562949953421313, frequency = 12], org.opensolaris.os.dtrace.Distribution$Bucket[min = -562949953421312, max = -281474976710657, frequency = 13], org.opensolaris.os.dtrace.Distribution$Bucket[min = -281474976710656, max = -140737488355329, frequency = 14], org.opensolaris.os.dtrace.Distribution$Bucket[min = -140737488355328, max = -70368744177665, frequency = 15], org.opensolaris.os.dtrace.Distribution$Bucket[min = -70368744177664, max = -35184372088833, frequency = 16], org.opensolaris.os.dtrace.Distribution$Bucket[min = -35184372088832, max = -17592186044417, frequency = 17], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17592186044416, max = -8796093022209, frequency = 18], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8796093022208, max = -4398046511105, frequency = 19], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4398046511104, max = -2199023255553, frequency = 20], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2199023255552, max = -1099511627777, frequency = 21], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1099511627776, max = -549755813889, frequency = 22], org.opensolaris.os.dtrace.Distribution$Bucket[min = -549755813888, max = -274877906945, frequency = 23], org.opensolaris.os.dtrace.Distribution$Bucket[min = -274877906944, max = -137438953473, frequency = 24], org.opensolaris.os.dtrace.Distribution$Bucket[min = -137438953472, max = -68719476737, frequency = 25], org.opensolaris.os.dtrace.Distribution$Bucket[min = -68719476736, max = -34359738369, frequency = 26], org.opensolaris.os.dtrace.Distribution$Bucket[min = -34359738368, max = -17179869185, frequency = 27], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17179869184, max = -8589934593, frequency = 28], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8589934592, max = -4294967297, frequency = 29], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4294967296, max = -2147483649, frequency = 30], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2147483648, max = -1073741825, frequency = 31], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1073741824, max = -536870913, frequency = 32], org.opensolaris.os.dtrace.Distribution$Bucket[min = -536870912, max = -268435457, frequency = 33], org.opensolaris.os.dtrace.Distribution$Bucket[min = -268435456, max = -134217729, frequency = 34], org.opensolaris.os.dtrace.Distribution$Bucket[min = -134217728, max = -67108865, frequency = 35], org.opensolaris.os.dtrace.Distribution$Bucket[min = -67108864, max = -33554433, frequency = 36], org.opensolaris.os.dtrace.Distribution$Bucket[min = -33554432, max = -16777217, frequency = 37], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16777216, max = -8388609, frequency = 38], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8388608, max = -4194305, frequency = 39], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4194304, max = -2097153, frequency = 40], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2097152, max = -1048577, frequency = 41], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1048576, max = -524289, frequency = 42], org.opensolaris.os.dtrace.Distribution$Bucket[min = -524288, max = -262145, frequency = 43], org.opensolaris.os.dtrace.Distribution$Bucket[min = -262144, max = -131073, frequency = 44], org.opensolaris.os.dtrace.Distribution$Bucket[min = -131072, max = -65537, frequency = 45], org.opensolaris.os.dtrace.Distribution$Bucket[min = -65536, max = -32769, frequency = 46], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32768, max = -16385, frequency = 47], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16384, max = -8193, frequency = 48], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8192, max = -4097, frequency = 49], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4096, max = -2049, frequency = 50], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2048, max = -1025, frequency = 51], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1024, max = -513, frequency = 52], org.opensolaris.os.dtrace.Distribution$Bucket[min = -512, max = -257, frequency = 53], org.opensolaris.os.dtrace.Distribution$Bucket[min = -256, max = -129, frequency = 54], org.opensolaris.os.dtrace.Distribution$Bucket[min = -128, max = -65, frequency = 55], org.opensolaris.os.dtrace.Distribution$Bucket[min = -64, max = -33, frequency = 56], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32, max = -17, frequency = 57], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16, max = -9, frequency = 58], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8, max = -5, frequency = 59], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4, max = -3, frequency = 60], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2, max = -2, frequency = 61], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1, max = -1, frequency = 62], org.opensolaris.os.dtrace.Distribution$Bucket[min = 0, max = 0, frequency = 63], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 64], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 65], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 66], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 67], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 68], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 69], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 70], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 255, frequency = 71], org.opensolaris.os.dtrace.Distribution$Bucket[min = 256, max = 511, frequency = 72], org.opensolaris.os.dtrace.Distribution$Bucket[min = 512, max = 1023, frequency = 73], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1024, max = 2047, frequency = 74], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2048, max = 4095, frequency = 75], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4096, max = 8191, frequency = 76], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8192, max = 16383, frequency = 77], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16384, max = 32767, frequency = 78], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32768, max = 65535, frequency = 79], org.opensolaris.os.dtrace.Distribution$Bucket[min = 65536, max = 131071, frequency = 80], org.opensolaris.os.dtrace.Distribution$Bucket[min = 131072, max = 262143, frequency = 81], org.opensolaris.os.dtrace.Distribution$Bucket[min = 262144, max = 524287, frequency = 82], org.opensolaris.os.dtrace.Distribution$Bucket[min = 524288, max = 1048575, frequency = 83], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1048576, max = 2097151, frequency = 84], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2097152, max = 4194303, frequency = 85], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4194304, max = 8388607, frequency = 86], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8388608, max = 16777215, frequency = 87], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16777216, max = 33554431, frequency = 88], org.opensolaris.os.dtrace.Distribution$Bucket[min = 33554432, max = 67108863, frequency = 89], org.opensolaris.os.dtrace.Distribution$Bucket[min = 67108864, max = 134217727, frequency = 90], org.opensolaris.os.dtrace.Distribution$Bucket[min = 134217728, max = 268435455, frequency = 91], org.opensolaris.os.dtrace.Distribution$Bucket[min = 268435456, max = 536870911, frequency = 92], org.opensolaris.os.dtrace.Distribution$Bucket[min = 536870912, max = 1073741823, frequency = 93], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1073741824, max = 2147483647, frequency = 94], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2147483648, max = 4294967295, frequency = 95], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4294967296, max = 8589934591, frequency = 96], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8589934592, max = 17179869183, frequency = 97], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17179869184, max = 34359738367, frequency = 98], org.opensolaris.os.dtrace.Distribution$Bucket[min = 34359738368, max = 68719476735, frequency = 99], org.opensolaris.os.dtrace.Distribution$Bucket[min = 68719476736, max = 137438953471, frequency = 100], org.opensolaris.os.dtrace.Distribution$Bucket[min = 137438953472, max = 274877906943, frequency = 101], org.opensolaris.os.dtrace.Distribution$Bucket[min = 274877906944, max = 549755813887, frequency = 102], org.opensolaris.os.dtrace.Distribution$Bucket[min = 549755813888, max = 1099511627775, frequency = 103], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1099511627776, max = 2199023255551, frequency = 104], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2199023255552, max = 4398046511103, frequency = 105], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4398046511104, max = 8796093022207, frequency = 106], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8796093022208, max = 17592186044415, frequency = 107], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17592186044416, max = 35184372088831, frequency = 108], org.opensolaris.os.dtrace.Distribution$Bucket[min = 35184372088832, max = 70368744177663, frequency = 109], org.opensolaris.os.dtrace.Distribution$Bucket[min = 70368744177664, max = 140737488355327, frequency = 110], org.opensolaris.os.dtrace.Distribution$Bucket[min = 140737488355328, max = 281474976710655, frequency = 111], org.opensolaris.os.dtrace.Distribution$Bucket[min = 281474976710656, max = 562949953421311, frequency = 112], org.opensolaris.os.dtrace.Distribution$Bucket[min = 562949953421312, max = 1125899906842623, frequency = 113], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1125899906842624, max = 2251799813685247, frequency = 114], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2251799813685248, max = 4503599627370495, frequency = 115], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4503599627370496, max = 9007199254740991, frequency = 116], org.opensolaris.os.dtrace.Distribution$Bucket[min = 9007199254740992, max = 18014398509481983, frequency = 117], org.opensolaris.os.dtrace.Distribution$Bucket[min = 18014398509481984, max = 36028797018963967, frequency = 118], org.opensolaris.os.dtrace.Distribution$Bucket[min = 36028797018963968, max = 72057594037927935, frequency = 119], org.opensolaris.os.dtrace.Distribution$Bucket[min = 72057594037927936, max = 144115188075855871, frequency = 120], org.opensolaris.os.dtrace.Distribution$Bucket[min = 144115188075855872, max = 288230376151711743, frequency = 121], org.opensolaris.os.dtrace.Distribution$Bucket[min = 288230376151711744, max = 576460752303423487, frequency = 122], org.opensolaris.os.dtrace.Distribution$Bucket[min = 576460752303423488, max = 1152921504606846975, frequency = 123], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1152921504606846976, max = 2305843009213693951, frequency = 124], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2305843009213693952, max = 4611686018427387903, frequency = 125], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4611686018427387904, max = 9223372036854775807, frequency = 126]], total = 8001.0]
+LinearDistribution:
+ serialized: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]
+ deserialized: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]
+LinearDistribution:
+ encoded: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]
+ decoded: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]
+Option:
+ serialized: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s]
+ deserialized: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s]
+Option:
+ encoded: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s]
+ decoded: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s]
+ProcessState:
+ serialized: org.opensolaris.os.dtrace.ProcessState[pid = 123456, state = UNDEAD, terminationSignal = 3, terminationSignalName = SIGSTOP, exitStatus = -2, message = Process stopped on dime]
+ deserialized: org.opensolaris.os.dtrace.ProcessState[pid = 123456, state = UNDEAD, terminationSignal = 3, terminationSignalName = SIGSTOP, exitStatus = -2, message = Process stopped on dime]
+ProcessState:
+ encoded: org.opensolaris.os.dtrace.ProcessState[pid = 123456, state = UNDEAD, terminationSignal = 3, terminationSignalName = SIGSTOP, exitStatus = -2, message = Process stopped on dime]
+ decoded: org.opensolaris.os.dtrace.ProcessState[pid = 123456, state = UNDEAD, terminationSignal = 3, terminationSignalName = SIGSTOP, exitStatus = -2, message = Process stopped on dime]
+ProbeDescription:
+ serialized: syscall::malloc:entry
+ deserialized: syscall::malloc:entry
+ProbeDescription:
+ encoded: syscall::malloc:entry
+ decoded: syscall::malloc:entry
+PrintaRecord:
+ serialized: org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]], formattedStrings = {[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!]=cat, [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]=cat}, tuples = [[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]], output = Yes, this is the formatted printa() output]
+ deserialized: org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]], formattedStrings = {[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!]=cat, [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]=cat}, tuples = [[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]], output = Yes, this is the formatted printa() output]
+PrintaRecord:
+ encoded: org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]], formattedStrings = {[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!]=cat, [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]=cat}, tuples = [[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]], output = Yes, this is the formatted printa() output]
+ decoded: org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]], formattedStrings = {[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!]=cat, [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]=cat}, tuples = [[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]], output = Yes, this is the formatted printa() output]
+PrintfRecord:
+ serialized: long formatted string
+ deserialized: long formatted string
+PrintfRecord:
+ encoded: long formatted string
+ decoded: long formatted string
+ProbeData:
+ serialized: org.opensolaris.os.dtrace.ProbeData[epid = 7, cpu = 1, enabledProbeDescription = syscall::malloc:entry, flow = org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3], records = [org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]], formattedStrings = {[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!]=cat, [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]=cat}, tuples = [[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]], output = Yes, this is the formatted printa() output], long formatted string,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, mod`func+0x4,
+ process ID: 123456
+ User Stack Frame 1
+ User Stack Frame 2
+ User Stack Frame 3
+, 1]]
+ deserialized: org.opensolaris.os.dtrace.ProbeData[epid = 7, cpu = 1, enabledProbeDescription = syscall::malloc:entry, flow = org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3], records = [org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]], formattedStrings = {[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!]=cat, [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]=cat}, tuples = [[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]], output = Yes, this is the formatted printa() output], long formatted string,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, mod`func+0x4,
+ process ID: 123456
+ User Stack Frame 1
+ User Stack Frame 2
+ User Stack Frame 3
+, 1]]
+ProbeData:
+ encoded: org.opensolaris.os.dtrace.ProbeData[epid = 7, cpu = 1, enabledProbeDescription = syscall::malloc:entry, flow = org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3], records = [org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]], formattedStrings = {[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!]=cat, [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]=cat}, tuples = [[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]], output = Yes, this is the formatted printa() output], long formatted string,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, mod`func+0x4,
+ process ID: 123456
+ User Stack Frame 1
+ User Stack Frame 2
+ User Stack Frame 3
+, 1]]
+ decoded: org.opensolaris.os.dtrace.ProbeData[epid = 7, cpu = 1, enabledProbeDescription = syscall::malloc:entry, flow = org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3], records = [org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]]], formattedStrings = {[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!]=cat, [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]=cat}, tuples = [[
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+]], output = Yes, this is the formatted printa() output], long formatted string,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, mod`func+0x4,
+ process ID: 123456
+ User Stack Frame 1
+ User Stack Frame 2
+ User Stack Frame 3
+, 1]]
+Aggregate:
+ serialized: org.opensolaris.os.dtrace.Aggregate[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = times, id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, dog, mouse, mouse, 67, 7], value = 9]]]]
+ deserialized: org.opensolaris.os.dtrace.Aggregate[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = times, id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, dog, mouse, mouse, 67, 7], value = 9]]]]
+Aggregate:
+ encoded: org.opensolaris.os.dtrace.Aggregate[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = times, id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, dog, mouse, mouse, 67, 7], value = 9]]]]
+ decoded: org.opensolaris.os.dtrace.Aggregate[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9,
+ has
+ nine
+ lives
+,
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 1 2 3 ...
+], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = times, id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, dog, mouse, mouse, 67, 7], value = 9]]]]
+UserStackRecord:
+ serialized:
+ process ID: 123456
+ User Stack Frame 1
+ User Stack Frame 2
+ User Stack Frame 3
+
+ deserialized:
+ process ID: 123456
+ User Stack Frame 1
+ User Stack Frame 2
+ User Stack Frame 3
+
+UserStackRecord:
+ encoded:
+ process ID: 123456
+ User Stack Frame 1
+ User Stack Frame 2
+ User Stack Frame 3
+
+ decoded:
+ process ID: 123456
+ User Stack Frame 1
+ User Stack Frame 2
+ User Stack Frame 3
+
+AvgValue:
+ serialized: 5
+ deserialized: 5
+AvgValue:
+ encoded: 5
+ decoded: 5
+CountValue:
+ serialized: 9
+ deserialized: 9
+CountValue:
+ encoded: 9
+ decoded: 9
+SumValue:
+ serialized: 25
+ deserialized: 25
+SumValue:
+ encoded: 25
+ decoded: 25
+MinValue:
+ serialized: 101
+ deserialized: 101
+MinValue:
+ encoded: 101
+ decoded: 101
+MaxValue:
+ serialized: 101
+ deserialized: 101
+MaxValue:
+ encoded: 101
+ decoded: 101
+Error:
+ serialized: org.opensolaris.os.dtrace.Error[probeDescription = syscall::malloc:entry, epid = 8, cpu = 3, action = 1, offset = 20, fault = DTRACEFLT_BADALIGN, address = -1, defaultMessage = error on enabled probe ID 8 (ID 256: syscall::malloc:entry): Bad alignment (0x33ef) in action #1 at DIF offset 20]
+ deserialized: org.opensolaris.os.dtrace.Error[probeDescription = syscall::malloc:entry, epid = 8, cpu = 3, action = 1, offset = 20, fault = DTRACEFLT_BADALIGN, address = -1, defaultMessage = error on enabled probe ID 8 (ID 256: syscall::malloc:entry): Bad alignment (0x33ef) in action #1 at DIF offset 20]
+Error:
+ encoded: org.opensolaris.os.dtrace.Error[probeDescription = syscall::malloc:entry, epid = 8, cpu = 3, action = 1, offset = 20, fault = DTRACEFLT_BADALIGN, address = -1, defaultMessage = error on enabled probe ID 8 (ID 256: syscall::malloc:entry): Bad alignment (0x33ef) in action #1 at DIF offset 20]
+ decoded: org.opensolaris.os.dtrace.Error[probeDescription = syscall::malloc:entry, epid = 8, cpu = 3, action = 1, offset = 20, fault = DTRACEFLT_BADALIGN, address = -1, defaultMessage = error on enabled probe ID 8 (ID 256: syscall::malloc:entry): Bad alignment (0x33ef) in action #1 at DIF offset 20]
+Drop:
+ serialized: org.opensolaris.os.dtrace.Drop[cpu = 2, kind = Speculation (busy), count = 72, total = 1041, defaultMessage = Guess we dropped stuff all over the place.]
+ deserialized: org.opensolaris.os.dtrace.Drop[cpu = 2, kind = Speculation (busy), count = 72, total = 1041, defaultMessage = Guess we dropped stuff all over the place.]
+Drop:
+ encoded: org.opensolaris.os.dtrace.Drop[cpu = 2, kind = Speculation (busy), count = 72, total = 1041, defaultMessage = Guess we dropped stuff all over the place.]
+ decoded: org.opensolaris.os.dtrace.Drop[cpu = 2, kind = Speculation (busy), count = 72, total = 1041, defaultMessage = Guess we dropped stuff all over the place.]
+InterfaceAttributes:
+ serialized: Unstable / Evolving / ISA
+ deserialized: Unstable / Evolving / ISA
+InterfaceAttributes:
+ encoded: Unstable / Evolving / ISA
+ decoded: Unstable / Evolving / ISA
+ProgramInfo:
+ serialized: org.opensolaris.os.dtrace.ProgramInfo[minimumProbeAttributes = Unstable / Evolving / ISA, minimumStatementAttributes = Unstable / Evolving / ISA, matchingProbeCount = 256]
+ deserialized: org.opensolaris.os.dtrace.ProgramInfo[minimumProbeAttributes = Unstable / Evolving / ISA, minimumStatementAttributes = Unstable / Evolving / ISA, matchingProbeCount = 256]
+ProgramInfo:
+ encoded: org.opensolaris.os.dtrace.ProgramInfo[minimumProbeAttributes = Unstable / Evolving / ISA, minimumStatementAttributes = Unstable / Evolving / ISA, matchingProbeCount = 256]
+ decoded: org.opensolaris.os.dtrace.ProgramInfo[minimumProbeAttributes = Unstable / Evolving / ISA, minimumStatementAttributes = Unstable / Evolving / ISA, matchingProbeCount = 256]
+ProbeInfo:
+ serialized: org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]
+ deserialized: org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]
+ProbeInfo:
+ encoded: org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]
+ decoded: org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]
+Probe:
+ serialized: org.opensolaris.os.dtrace.Probe[description = syscall::malloc:entry, info = org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]]
+ deserialized: org.opensolaris.os.dtrace.Probe[description = syscall::malloc:entry, info = org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]]
+Probe:
+ encoded: org.opensolaris.os.dtrace.Probe[description = syscall::malloc:entry, info = org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]]
+ decoded: org.opensolaris.os.dtrace.Probe[description = syscall::malloc:entry, info = org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]]
+Flow:
+ serialized: org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3]
+ deserialized: org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3]
+Flow:
+ encoded: org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3]
+ decoded: org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3]
+KernelSymbolRecord:
+ serialized: mod`func+0x4
+ deserialized: mod`func+0x4
+KernelSymbolRecord:
+ encoded: mod`func+0x4
+ decoded: mod`func+0x4
+UserSymbolRecord:
+ serialized: mod`func+0x4
+ deserialized: mod`func+0x4
+UserSymbolRecord:
+ encoded: mod`func+0x4
+ decoded: mod`func+0x4
+UserSymbolRecord$Value:
+ serialized: org.opensolaris.os.dtrace.UserSymbolRecord$Value[processID = 7, address = -1]
+ deserialized: org.opensolaris.os.dtrace.UserSymbolRecord$Value[processID = 7, address = -1]
+UserSymbolRecord$Value:
+ encoded: org.opensolaris.os.dtrace.UserSymbolRecord$Value[processID = 7, address = -1]
+ decoded: org.opensolaris.os.dtrace.UserSymbolRecord$Value[processID = 7, address = -1]
+Program:
+ serialized: org.opensolaris.os.dtrace.Program[contents = syscall:::entry { @[execname] = count(); }, info = null]
+ deserialized: org.opensolaris.os.dtrace.Program[contents = syscall:::entry { @[execname] = count(); }, info = null]
+Program$File:
+ serialized: org.opensolaris.os.dtrace.Program$File[super = org.opensolaris.os.dtrace.Program[contents = syscall:::entry { @[execname] = count(); }, info = null], file = TestBean.out]
+ deserialized: org.opensolaris.os.dtrace.Program$File[super = org.opensolaris.os.dtrace.Program[contents = syscall:::entry { @[execname] = count(); }, info = null], file = TestBean.out]
+StddevValue:
+ serialized: 37
+ deserialized: 37
+StddevValue:
+ encoded: 37
+ decoded: 37
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh
new file mode 100644
index 000000000000..299755c6638e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh
@@ -0,0 +1,38 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Fixed bug 6419880 close() hangs running consumer.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestClose
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh.out
new file mode 100644
index 000000000000..628d78702724
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh.out
@@ -0,0 +1 @@
+Successful
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh
new file mode 100644
index 000000000000..a03de9531ebb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh
@@ -0,0 +1,38 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Fixed bug 6521523 aggregation drops can hang the Java DTrace API.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestDrop 3
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh.out
new file mode 100644
index 000000000000..266c4d460880
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh.out
@@ -0,0 +1 @@
+Lock released
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh
new file mode 100644
index 000000000000..df1c11f0c2a9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh
@@ -0,0 +1,40 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Consumer enable() correctly handles multiple programs,
+# recognizing programs that have already been enabled or that were
+# compiled by another consumer.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestEnable
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh.out
new file mode 100644
index 000000000000..a13fb7090003
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh.out
@@ -0,0 +1,6 @@
+java.lang.IllegalStateException: Not all compiled probes are enabled. Compiled description dtrace:::END not enabled.
+java.lang.IllegalStateException: program already enabled
+java.lang.IllegalStateException: program already enabled
+java.lang.IllegalStateException: Not all compiled probes are enabled. Compiled description syscall:::return not enabled.
+java.lang.IllegalStateException: program already enabled
+java.lang.IllegalArgumentException: program not compiled by this consumer
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c
new file mode 100644
index 000000000000..0e6291f60912
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <stdio.h>
+
+typedef void f(int x);
+
+static void
+f1(int i)
+{
+ printf("%d\n", i);
+}
+
+static void
+f2(f func, int i)
+{
+ func(i);
+}
+
+int
+main()
+{
+ f2(f1, 3);
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh
new file mode 100644
index 000000000000..e1ffbdfa479f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh
@@ -0,0 +1,39 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Fixed bug 6413280 lookupKernelFunction() and
+# lookupUserFunction() truncate last character.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestFunctionLookup ./tst.FunctionLookup.exe
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh.out
new file mode 100644
index 000000000000..d42e9b59b6e1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh.out
@@ -0,0 +1,3 @@
+genunix`cv_wakeup
+3
+tst.FunctionLookup.exe`f1
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.GetAggregate.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.GetAggregate.ksh
new file mode 100644
index 000000000000..2fdd5a9eac44
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.GetAggregate.ksh
@@ -0,0 +1,36 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+############################################################################
+# ASSERTION:
+# getAggregate() can explicitly specify the anonymous aggregation
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestGetAggregate
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh
new file mode 100644
index 000000000000..992fcb5e8b09
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh
@@ -0,0 +1,47 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+# ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Fixed bug 6506495 -DJAVA_DTRACE_MAX_CONSUMERS=N for any N < 8 is
+# treated as if it were 8.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestMaxConsumers
+java -DJAVA_DTRACE_MAX_CONSUMERS=-1 -cp test.jar TestMaxConsumers
+java -DJAVA_DTRACE_MAX_CONSUMERS=0 -cp test.jar TestMaxConsumers
+java -DJAVA_DTRACE_MAX_CONSUMERS=1 -cp test.jar TestMaxConsumers
+java -DJAVA_DTRACE_MAX_CONSUMERS=2 -cp test.jar TestMaxConsumers
+java -DJAVA_DTRACE_MAX_CONSUMERS=7 -cp test.jar TestMaxConsumers
+java -DJAVA_DTRACE_MAX_CONSUMERS=8 -cp test.jar TestMaxConsumers
+java -DJAVA_DTRACE_MAX_CONSUMERS=9 -cp test.jar TestMaxConsumers
+java -DJAVA_DTRACE_MAX_CONSUMERS=19 -cp test.jar TestMaxConsumers
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh.out
new file mode 100644
index 000000000000..f68fc4ea5f7e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh.out
@@ -0,0 +1,17 @@
+Success
+JAVA_DTRACE_MAX_CONSUMERS=-1
+Success
+JAVA_DTRACE_MAX_CONSUMERS=0
+Success
+JAVA_DTRACE_MAX_CONSUMERS=1
+Success
+JAVA_DTRACE_MAX_CONSUMERS=2
+Success
+JAVA_DTRACE_MAX_CONSUMERS=7
+Success
+JAVA_DTRACE_MAX_CONSUMERS=8
+Success
+JAVA_DTRACE_MAX_CONSUMERS=9
+Success
+JAVA_DTRACE_MAX_CONSUMERS=19
+Success
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh
new file mode 100644
index 000000000000..6bb864a61eae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh
@@ -0,0 +1,38 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Regression for multi-aggregation printa() corner cases.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestMultiAggPrinta tst.printa.d
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh.out
new file mode 100644
index 000000000000..8b8fd6ef5040
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh.out
@@ -0,0 +1,78 @@
+org.opensolaris.os.dtrace.ProbeData[epid = 1, enabledProbeDescription = dtrace:::BEGIN, flow = null, records = [org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = , id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 1]]], formattedStrings = {[]=
+ 1
+}, tuples = [[]], output =
+ 1
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = , id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 1]]], formattedStrings = {[]=count: 1
+}, tuples = [[]], output = count: 1
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {[]= }, tuples = [[]], output = ], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3]]], formattedStrings = {[1, 3]=
+ 1 3 3
+, [1, 2]= 1 2 1
+}, tuples = [[1, 3], [1, 2]], output =
+ 1 3 3
+ 1 2 1
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=
+ 2 3 0 4
+, [1, 3]= 1 3 3 0
+, [1, 2]= 1 2 1 2
+}, tuples = [[2, 3], [1, 2], [1, 3]], output =
+ 2 3 0 4
+ 1 2 1 2
+ 1 3 3 0
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = c, id = 4, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 3]], org.opensolaris.os.dtrace.Aggregation[name = d, id = 5, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 4]]], formattedStrings = {[]=3 4
+}, tuples = [[]], output = 3 4
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = c, id = 4, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 3]], org.opensolaris.os.dtrace.Aggregation[name = d, id = 5, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 4]]], formattedStrings = {[]=3 4
+}, tuples = [[]], output = 3 4
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = c, id = 4, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 3]]], formattedStrings = {[]=3
+}, tuples = [[]], output = 3
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=[2, 3] 0 4
+, [1, 3]=[1, 3] 3 0
+, [1, 2]=[1, 2] 1 2
+}, tuples = [[2, 3], [1, 2], [1, 3]], output = [2, 3] 0 4
+[1, 2] 1 2
+[1, 3] 3 0
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=[2, 3] 0 4
+, [1, 3]=[1, 3] 3 0
+, [1, 2]=[1, 2] 1 2
+}, tuples = [[2, 3], [1, 3], [1, 2]], output = [2, 3] 0 4
+[1, 3] 3 0
+[1, 2] 1 2
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=[2, 3] 0 4
+, [1, 3]=[1, 3] 3 0
+, [1, 2]=[1, 2] 1 2
+}, tuples = [[2, 3], [1, 3], [1, 2]], output = [2, 3] 0 4
+[1, 3] 3 0
+[1, 2] 1 2
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=0 4 [2, 3]
+, [1, 3]=3 0 [1, 3]
+, [1, 2]=1 2 [1, 2]
+}, tuples = [[2, 3], [1, 3], [1, 2]], output = 0 4 [2, 3]
+3 0 [1, 3]
+1 2 [1, 2]
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {[2, 3]=[2, 3]
+, [1, 3]=[1, 3]
+, [1, 2]=[1, 2]
+}, tuples = [[2, 3], [1, 3], [1, 2]], output = [2, 3]
+[1, 3]
+[1, 2]
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {}, tuples = [], output = [2]
+[1]
+[1]
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {}, tuples = [], output = [2] 0 4
+[1] 3 0
+[1] 1 2
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {}, tuples = [], output = 0 4
+3 0
+1 2
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {}, tuples = [], output = 0 4 4
+3 0 0
+1 2 2
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {}, tuples = [], output = [2] 0 4 4
+[1] 3 0 0
+[1] 1 2 2
+], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=[2, 3] 0 4 4
+, [1, 3]=[1, 3] 3 0 0
+, [1, 2]=[1, 2] 1 2 2
+}, tuples = [[2, 3], [1, 3], [1, 2]], output = [2, 3] 0 4 4
+[1, 3] 3 0 0
+[1, 2] 1 2 2
+], 0]
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c
new file mode 100644
index 000000000000..0833912ad94c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c
@@ -0,0 +1,93 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+typedef void f(char *);
+
+static void
+f_a(char *a)
+{
+}
+
+static void
+f_b(char *a)
+{
+}
+
+static void
+f_c(char *a)
+{
+}
+
+static void
+f_d(char *a)
+{
+}
+
+static void
+f_e(char *a)
+{
+}
+
+static void
+fN(f func, char *a, int i)
+{
+ func(a);
+}
+
+static void
+fN2(f func, char *a, int i)
+{
+ func(a);
+}
+
+int
+main()
+{
+ /*
+ * Avoid length of 1, 2, 4, or 8 bytes so DTrace will treat the data as
+ * a byte array.
+ */
+ char a[] = {(char)-7, (char)201, (char)0, (char)0, (char)28, (char)1};
+ char b[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)0};
+ char c[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)1};
+ char d[] = {(char)-7, (char)201, (char)0, (char)0, (char)29, (char)0};
+ char e[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)0};
+
+ fN(f_a, a, 1);
+ fN(f_b, b, 0);
+ fN(f_d, d, 102);
+ fN2(f_e, e, -2);
+ fN(f_c, c, 0);
+ fN(f_a, a, -1);
+ fN(f_d, d, 101);
+ fN(f_e, e, -2);
+ fN(f_e, e, 2);
+ fN2(f_e, e, 2);
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh
new file mode 100644
index 000000000000..97f49454e9ae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh
@@ -0,0 +1,38 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# ProbeData instances sort as expected with multiple enabled probe
+# IDs and multiple records including byte array (sorted as
+# unsigned bytes), stand-alone ufunc() action, and signed integer.
+#
+############################################################################
+
+java -cp test.jar TestProbeData ./tst.ProbeData.exe
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh.out
new file mode 100644
index 000000000000..6789514f6897
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh.out
@@ -0,0 +1,50 @@
+[probe 1 pid$target:tst.ProbeData.exe:fN:entry [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 54 45 0 0 1c 0 TE....
+, tst.ProbeData.exe`f_b , 0]]
+
+[probe 1 pid$target:tst.ProbeData.exe:fN:entry [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 54 45 0 0 1c 0 TE....
+, tst.ProbeData.exe`f_e , -2]]
+
+[probe 2 pid$target:tst.ProbeData.exe:fN2:entry [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 54 45 0 0 1c 0 TE....
+, tst.ProbeData.exe`f_e , -2]]
+
+[probe 1 pid$target:tst.ProbeData.exe:fN:entry [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 54 45 0 0 1c 0 TE....
+, tst.ProbeData.exe`f_e , 2]]
+
+[probe 2 pid$target:tst.ProbeData.exe:fN2:entry [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 54 45 0 0 1c 0 TE....
+, tst.ProbeData.exe`f_e , 2]]
+
+[probe 1 pid$target:tst.ProbeData.exe:fN:entry [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 54 45 0 0 1c 1 TE....
+, tst.ProbeData.exe`f_c , 0]]
+
+[probe 1 pid$target:tst.ProbeData.exe:fN:entry [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: f9 c9 0 0 1c 1 ......
+, tst.ProbeData.exe`f_a , -1]]
+
+[probe 1 pid$target:tst.ProbeData.exe:fN:entry [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: f9 c9 0 0 1c 1 ......
+, tst.ProbeData.exe`f_a , 1]]
+
+[probe 1 pid$target:tst.ProbeData.exe:fN:entry [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: f9 c9 0 0 1d 0 ......
+, tst.ProbeData.exe`f_d , 101]]
+
+[probe 1 pid$target:tst.ProbeData.exe:fN:entry [
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: f9 c9 0 0 1d 0 ......
+, tst.ProbeData.exe`f_d , 102]]
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh
new file mode 100644
index 000000000000..bee1cca6a371
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh
@@ -0,0 +1,45 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# ProbeDescription constructors function as expected.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestProbeDescription syscall:::entry
+java -cp test.jar TestProbeDescription BEGIN
+java -cp test.jar TestProbeDescription isdigit entry
+java -cp test.jar TestProbeDescription genunix isdigit entry
+java -cp test.jar TestProbeDescription fbt genunix isdigit entry
+java -cp test.jar TestProbeDescription fbt:genunix:isdigit:entry
+java -cp test.jar TestProbeDescription syscall::entry
+java -cp test.jar TestProbeDescription syscall:entry
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh.out
new file mode 100644
index 000000000000..326018a5e908
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh.out
@@ -0,0 +1,8 @@
+syscall:::entry
+:::BEGIN
+::isdigit:entry
+:genunix:isdigit:entry
+fbt:genunix:isdigit:entry
+fbt:genunix:isdigit:entry
+:syscall::entry
+::syscall:entry
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh
new file mode 100644
index 000000000000..638ce7ace8fa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh
@@ -0,0 +1,40 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Consumer state machine prevents illegal calls, allows legal
+# ones; consumer behaves predictably when methods called out of
+# order.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestStateMachine
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh.out
new file mode 100644
index 000000000000..5ddb528f7995
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh.out
@@ -0,0 +1,70 @@
+before open
+open: false
+enabled: false
+closed: false
+java.lang.IllegalStateException: consumer not open
+java.lang.IllegalStateException: consumer not open
+java.lang.IllegalStateException: consumer not open
+java.lang.IllegalStateException: consumer not open
+java.lang.IllegalStateException: consumer not open
+java.lang.IllegalStateException: consumer not open
+java.lang.IllegalStateException: consumer not open
+java.lang.IllegalStateException: consumer not open
+java.lang.IllegalStateException: consumer not open
+before compile
+open: true
+enabled: false
+closed: false
+java.lang.IllegalStateException: consumer already open
+java.lang.IllegalStateException: no compiled program
+before enable
+open: true
+enabled: false
+closed: false
+java.lang.IllegalStateException: Not all compiled probes are enabled. Compiled description syscall:::entry { @[execname] = count(); } tick-101ms { printa(@); } not enabled.
+before go
+open: true
+enabled: true
+closed: false
+java.lang.IllegalStateException: go() not called
+java.lang.IllegalStateException: go() not called
+java.lang.IllegalStateException: go() not called
+java.lang.IllegalStateException: go() not called
+before go, running: false
+consumerStarted, running: true
+after go
+open: true
+enabled: false
+closed: false
+java.lang.IllegalStateException: go() already called
+java.lang.IllegalStateException: go() already called
+java.lang.IllegalStateException: go() already called
+java.lang.IllegalStateException: go() already called
+java.lang.IllegalStateException: go() already called
+java.lang.IllegalStateException: go() already called
+consumerStopped, running: false
+after stop, running: false
+after stop
+open: true
+enabled: false
+closed: false
+java.lang.IllegalStateException: consumer already stopped
+after close
+open: false
+enabled: false
+closed: true
+java.lang.IllegalStateException: cannot reopen a closed consumer
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
+java.lang.IllegalStateException: consumer closed
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh
new file mode 100644
index 000000000000..4637a7adc70d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh
@@ -0,0 +1,39 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Fixed bug 6399888 stop() hangs if ConsumerListener calls
+# synchronized Consumer method.
+#
+# SECTION: Java API
+#
+############################################################################
+
+java -cp test.jar TestStopLock
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh.out
new file mode 100644
index 000000000000..628d78702724
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh.out
@@ -0,0 +1 @@
+Successful
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.printa.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.printa.d
new file mode 100644
index 000000000000..574a9eab3eba
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.printa.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * printa() test with/without tuple, with multiple aggregations and
+ * mismatched format strings, and sorting options.
+ *
+ * SECTION: Aggregations/Aggregations; Output Formatting, printa()
+ *
+ * NOTES: This test attempts to cover all multi-agg printa() corner cases.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @ = count();
+ @a[1, 2] = sum(1);
+ @b[1, 2] = sum(2);
+ @a[1, 3] = sum(3);
+ @b[2, 3] = sum(4);
+ @c = sum(3);
+ @d = sum(4);
+ setopt("aggsortpos", "1");
+ setopt("aggsortrev");
+ printa(@);
+ printa("count: %@d\n", @);
+ printa(" ", @);
+ printa(@a);
+ printa(@a, @b);
+ printa("%@d %@d\n", @c, @d);
+ printa("%@d %@d\n", @c, @d);
+ printa("%@d\n", @c, @d);
+
+ printa("[%d, %d] %@d %@d\n", @a, @b);
+ setopt("aggsortkey");
+ printa("[%d, %d] %@d %@d\n", @a, @b);
+ setopt("aggsortpos", "0");
+ setopt("aggsortkeypos", "1");
+ printa("[%d, %d] %@d %@d\n", @a, @b);
+
+ printa("%@d %@d [%d, %d]\n", @a, @b);
+ printa("[%d, %d]\n", @a, @b);
+ printa("[%d]\n", @a, @b);
+ printa("[%d] %@d %@d\n", @a, @b);
+ printa("%@d %@d\n", @a, @b);
+ printa("%@d %@d %@d\n", @a, @b);
+ printa("[%d] %@d %@d %@d\n", @a, @b);
+ printa("[%d, %d] %@d %@d %@d\n", @a, @b);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.printa.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.printa.d.out
new file mode 100644
index 000000000000..10b90b3c9b61
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.printa.d.out
@@ -0,0 +1,47 @@
+
+ 1
+count: 1
+
+ 1 3 3
+ 1 2 1
+
+ 2 3 0 4
+ 1 2 1 2
+ 1 3 3 0
+3 4
+3 4
+3
+[2, 3] 0 4
+[1, 2] 1 2
+[1, 3] 3 0
+[2, 3] 0 4
+[1, 3] 3 0
+[1, 2] 1 2
+[2, 3] 0 4
+[1, 3] 3 0
+[1, 2] 1 2
+0 4 [2, 3]
+3 0 [1, 3]
+1 2 [1, 2]
+[2, 3]
+[1, 3]
+[1, 2]
+[2]
+[1]
+[1]
+[2] 0 4
+[1] 3 0
+[1] 1 2
+0 4
+3 0
+1 2
+0 4 4
+3 0 0
+1 2 2
+[2] 0 4 4
+[1] 3 0 0
+[1] 1 2 2
+[2, 3] 0 4 4
+[1, 3] 3 0 0
+[1, 2] 1 2 2
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NL.char.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NL.char.d
new file mode 100644
index 000000000000..9c0280c97964
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NL.char.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Newlines may not be embedded in character constants..
+ *
+ * SECTION: Lexer
+ */
+
+
+BEGIN
+{
+
+ h = '
+ ';
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NULL.char.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NULL.char.d
new file mode 100644
index 000000000000..aef5dab6f4fe
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NULL.char.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Char constants may not be empty
+ *
+ * SECTION: Lexer
+ */
+
+
+BEGIN
+{
+
+ h = '';
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_INT_DIGIT.InvalidDigit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_INT_DIGIT.InvalidDigit.d
new file mode 100644
index 000000000000..4fac03bc575e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_INT_DIGIT.InvalidDigit.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: If an integer representation contains an invalid digit
+ * a D_INT_DIGIT is thrown.
+ *
+ * SECTION: Errtags/D_INT_DIGIT
+ */
+
+BEGIN
+{
+ 0128;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_INT_OFLOW.BigInt.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_INT_OFLOW.BigInt.d
new file mode 100644
index 000000000000..1ec8be8f1075
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_INT_OFLOW.BigInt.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Using an integer constant that cannot be represented in any of the
+ * builtin integral types throws a D_INT_OFLOW error.
+ *
+ * SECTION: Errtags/D_INT_OFLOW
+ */
+
+BEGIN
+{
+ 0x12345678123456781;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_STR_NL.string.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_STR_NL.string.d
new file mode 100644
index 000000000000..68b4cd42e4df
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_STR_NL.string.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Newlines may not be embedded in string literals.
+ *
+ * SECTION: Lexer
+ */
+
+
+BEGIN
+{
+
+ h = "hello
+
+ there";
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace1.d
new file mode 100644
index 000000000000..ae6dc6ceb1e0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace1.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test detection of extra curly braces.
+ *
+ * SECTION: Lexer
+ */
+
+BEGIN
+{
+ trace(epid);
+}
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace2.d
new file mode 100644
index 000000000000..196f7d7ca606
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace2.d
@@ -0,0 +1,37 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: * Test detection of missing curly braces.
+ *
+ * SECTION: Lexer
+ */
+
+BEGIN
+{
+ trace(epid);
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack1.d
new file mode 100644
index 000000000000..8e4c97dad6da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack1.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test detection of extra square brackets
+ *
+ * SECTION: Lexer
+ */
+
+BEGIN
+{
+ trace(args[0]]);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack2.d
new file mode 100644
index 000000000000..307bd08d6cb5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack2.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test detection of missing square brackets
+ *
+ * SECTION: Lexer
+ */
+
+BEGIN
+{
+ args[0
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack3.d
new file mode 100644
index 000000000000..2d66828ced2d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack3.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test detection of missing square brackets
+ *
+ * SECTION: Lexer
+ */
+
+BEGIN
+/args[0/
+{
+ trace(epid);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren1.d
new file mode 100644
index 000000000000..812dbb7d753f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren1.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test detection of extra parentheses
+ *
+ * SECTION: Lexer
+ */
+
+BEGIN
+{
+ trace(epid));
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren2.d
new file mode 100644
index 000000000000..078d08c61294
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren2.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test detection of missing parentheses
+ *
+ * SECTION: Lexer
+ */
+
+BEGIN
+{
+ rand(
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren3.d
new file mode 100644
index 000000000000..38cdb7e8269e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren3.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test detection of missing parentheses
+ *
+ * SECTION: Lexer
+ */
+
+BEGIN
+/rand(/
+{
+ trace(epid);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh
new file mode 100644
index 000000000000..ad124ea9367d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh
@@ -0,0 +1,54 @@
+#!/bin/ksh -p
+
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+#
+# ASSERTION:
+# If a macro argument results in an integer overflow, a D_MACRO_OFLOW is
+# thrown.
+#
+# SECTION: Errtags/D_MACRO_OFLOW
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -n 'BEGIN { $1; }' 0x12345678123456781
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ exit 0
+fi
+
+echo dtrace failed
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d
new file mode 100644
index 000000000000..b11d2828bb7f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, 0, 10, 25);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d
new file mode 100644
index 000000000000..c8af7d920f3c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.notfactor.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, 0, 10, 30);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d
new file mode 100644
index 000000000000..0404b4ffbdcf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORMATCH.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, 0, 10, 10);
+ @ = llquantize(0, 3, 0, 10, 81);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d
new file mode 100644
index 000000000000..fd6b0e67f261
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORNSTEPS.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, 0, 10, 7);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d
new file mode 100644
index 000000000000..7074f5f66501
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORSMALL.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 1, 0, 10, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d
new file mode 100644
index 000000000000..ea39c7e38ca9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORTYPE.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ this->doogle = 10;
+ @ = llquantize(0, this->doogle, 0, 10, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d
new file mode 100644
index 000000000000..a1ad20f28a62
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTORVAL.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 65537, 0, 10, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d
new file mode 100644
index 000000000000..46bf0e6fc206
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHMATCH.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, 0, 10, 10);
+ @ = llquantize(0, 10, 0, 11, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d
new file mode 100644
index 000000000000..fee786d39e0d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHTYPE.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ this->doogle = 10;
+ @ = llquantize(0, 10, 0, this->doogle, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d
new file mode 100644
index 000000000000..531ab0b6641f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_HIGHVAL.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, 0, -1, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d
new file mode 100644
index 000000000000..126429a2996d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWMATCH.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, 0, 10, 10);
+ @ = llquantize(0, 10, 1, 10, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d
new file mode 100644
index 000000000000..2a9b2efdc8d1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWTYPE.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ this->doogle = 0;
+ @ = llquantize(0, 10, this->doogle, 10, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d
new file mode 100644
index 000000000000..e1045d83bdcf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, -1, 10, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d
new file mode 100644
index 000000000000..9852c1ab9532
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGRANGE.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, 10, 0, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d
new file mode 100644
index 000000000000..c7076308446b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, 0, 100, 10);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d
new file mode 100644
index 000000000000..77b4d8a84d20
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPMATCH.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(0, 10, 0, 10, 10);
+ @ = llquantize(0, 10, 0, 10, 100);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d
new file mode 100644
index 000000000000..4eb9b2f06d0a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPTYPE.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ this->doogle = 10;
+ @ = llquantize(0, 10, 0, 10, this->doogle);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d
new file mode 100644
index 000000000000..3855beb4adc2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_NSTEPVAL.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = llquantize(123, 10, 0, 10, 123456);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d
new file mode 100644
index 000000000000..e3a6ff1a8cde
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ <= 100/
+{
+ @two = llquantize(i, 2, 0, 6, 2);
+ @three = llquantize(i, 3, 0, 1, 9);
+ @four = llquantize(i, 4, 0, 1, 4);
+ @five = llquantize(i, 5, 0, 1, 25);
+ @six = llquantize(i, 6, 0, 3, 12);
+ @seven = llquantize(i, 7, 0, 1, 7);
+ @eight = llquantize(i, 8, 0, 1, 16);
+ @nine = llquantize(i, 9, 0, 1, 9);
+ @ten = llquantize(i, 10, 0, 1, 10);
+}
+
+tick-1ms
+/i > 100/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out
new file mode 100644
index 000000000000..1b207bf6f292
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out
@@ -0,0 +1,177 @@
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 |@ 2
+ 4 |@@ 4
+ 8 |@@@ 8
+ 16 |@@@@@@ 16
+ 32 |@@@@@@@@@@@@@ 32
+ 64 |@@@@@@@@@@@@@@@ 38
+ >= 128 | 0
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 5 | 1
+ 6 | 1
+ 7 | 1
+ 8 | 1
+ >= 9 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 93
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 1
+ 4 |@@ 4
+ 8 |@@ 4
+ 12 |@@ 4
+ >= 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 86
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 5 | 1
+ 6 | 1
+ 7 | 1
+ 8 | 1
+ 9 | 1
+ 10 | 1
+ 11 | 1
+ 12 | 1
+ 13 | 1
+ 14 | 1
+ 15 | 1
+ 16 | 1
+ 17 | 1
+ 18 | 1
+ 19 | 1
+ 20 | 1
+ 21 | 1
+ 22 | 1
+ 23 | 1
+ 24 | 1
+ >= 25 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 77
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 5 | 1
+ 6 |@ 3
+ 9 |@ 3
+ 12 |@ 3
+ 15 |@ 3
+ 18 |@ 3
+ 21 |@ 3
+ 24 |@ 3
+ 27 |@ 3
+ 30 |@ 3
+ 33 |@ 3
+ 36 |@@@@@@@ 18
+ 54 |@@@@@@@ 18
+ 72 |@@@@@@@ 18
+ 90 |@@@@@ 12
+ 108 | 0
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 5 | 1
+ 6 | 1
+ 7 |@@@ 7
+ 14 |@@@ 7
+ 21 |@@@ 7
+ 28 |@@@ 7
+ 35 |@@@ 7
+ 42 |@@@ 7
+ >= 49 |@@@@@@@@@@@@@@@@@@@@@ 53
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 5 | 1
+ 6 | 1
+ 7 | 1
+ 8 |@@ 4
+ 12 |@@ 4
+ 16 |@@ 4
+ 20 |@@ 4
+ 24 |@@ 4
+ 28 |@@ 4
+ 32 |@@ 4
+ 36 |@@ 4
+ 40 |@@ 4
+ 44 |@@ 4
+ 48 |@@ 4
+ 52 |@@ 4
+ 56 |@@ 4
+ 60 |@@ 4
+ >= 64 |@@@@@@@@@@@@@@@ 38
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 5 | 1
+ 6 | 1
+ 7 | 1
+ 8 | 1
+ 9 |@@@@ 9
+ 18 |@@@@ 9
+ 27 |@@@@ 9
+ 36 |@@@@ 9
+ 45 |@@@@ 9
+ 54 |@@@@ 9
+ 63 |@@@@ 9
+ 72 |@@@@ 9
+ >= 81 |@@@@@@@@ 21
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 5 | 1
+ 6 | 1
+ 7 | 1
+ 8 | 1
+ 9 | 1
+ 10 |@@@@ 10
+ 20 |@@@@ 10
+ 30 |@@@@ 10
+ 40 |@@@@ 10
+ 50 |@@@@ 10
+ 60 |@@@@ 10
+ 70 |@@@@ 10
+ 80 |@@@@ 10
+ 90 |@@@@ 10
+ >= 100 |@ 2
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d
new file mode 100644
index 000000000000..57b6ed881b7f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ <= 100/
+{
+ @ = llquantize(i, 10, 0, 10, 10);
+}
+
+tick-1ms
+/i > 100/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out
new file mode 100644
index 000000000000..9a7b288966f3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out
@@ -0,0 +1,25 @@
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 5 | 1
+ 6 | 1
+ 7 | 1
+ 8 | 1
+ 9 | 1
+ 10 |@@@@ 10
+ 20 |@@@@ 10
+ 30 |@@@@ 10
+ 40 |@@@@ 10
+ 50 |@@@@ 10
+ 60 |@@@@ 10
+ 70 |@@@@ 10
+ 80 |@@@@ 10
+ 90 |@@@@ 10
+ 100 |@ 2
+ 200 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d
new file mode 100644
index 000000000000..b18c688bc750
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ a = 7;
+ b = 13;
+ val = (-a * b) + a;
+}
+
+tick-1ms
+{
+ incr = val % b;
+ val += a;
+}
+
+tick-1ms
+/val == 0/
+{
+ val += a;
+}
+
+tick-1ms
+/incr != 0/
+{
+ i++;
+ @llquanty[i] = llquantize(1, 10, 0, 10, 10, incr);
+}
+
+tick-1ms
+/incr == 0/
+{
+ printf("Ordering of llquantize() with some negative weights:\n");
+ printa(@llquanty);
+ printf("\n");
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out
new file mode 100644
index 000000000000..ac0f3cb300e1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out
@@ -0,0 +1,148 @@
+Ordering of llquantize() with some negative weights:
+
+ 2
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
+ 2 | 0
+
+ 4
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
+ 2 | 0
+
+ 6
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
+ 2 | 0
+
+ 8
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
+ 2 | 0
+
+ 10
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
+ 2 | 0
+
+ 12
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
+ 2 | 0
+
+ 1
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
+ 2 | 0
+
+ 3
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
+ 2 | 0
+
+ 5
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
+ 2 | 0
+
+ 7
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
+ 2 | 0
+
+ 9
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
+ 2 | 0
+
+ 11
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
+ 2 | 0
+
+ 14
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 2 | 0
+
+ 16
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
+ 2 | 0
+
+ 18
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
+ 2 | 0
+
+ 20
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
+ 2 | 0
+
+ 22
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 2 | 0
+
+ 24
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+ 2 | 0
+
+ 13
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
+ 2 | 0
+
+ 15
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
+ 2 | 0
+
+ 17
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
+ 2 | 0
+
+ 19
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
+ 2 | 0
+
+ 21
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
+ 2 | 0
+
+ 23
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
+ 2 | 0
+
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d
new file mode 100644
index 000000000000..c74d019cb186
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ <= 100/
+{
+ @ = llquantize(i, 10, 0, 10, 10, 50 - i);
+}
+
+tick-1ms
+/i > 100/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out
new file mode 100644
index 000000000000..04b0d5e1bded
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out
@@ -0,0 +1,25 @@
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 49
+ 2 | 48
+ 3 | 47
+ 4 | 46
+ 5 | 45
+ 6 | 44
+ 7 | 43
+ 8 | 42
+ 9 | 41
+ 10 |@@@ 355
+ 20 |@@ 255
+ 30 |@ 155
+ 40 | 55
+ 50 | -45
+ 60 @| -145
+ 70 @@| -245
+ 80 @@@| -345
+ 90 @@@| -445
+ 100 @| -101
+ 200 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.normal.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.normal.d
new file mode 100644
index 000000000000..7097ba7d33c7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.normal.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ <= 100/
+{
+ @ = llquantize(i, 10, 0, 10, 10);
+}
+
+tick-1ms
+/i > 100/
+{
+ normalize(@, 10);
+ printa(@);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out
new file mode 100644
index 000000000000..3b1f41b218fc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out
@@ -0,0 +1,26 @@
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 0
+ 2 | 0
+ 3 | 0
+ 4 | 0
+ 5 | 0
+ 6 | 0
+ 7 | 0
+ 8 | 0
+ 9 | 0
+ 10 |@@@@ 1
+ 20 |@@@@ 1
+ 30 |@@@@ 1
+ 40 |@@@@ 1
+ 50 |@@@@ 1
+ 60 |@@@@ 1
+ 70 |@@@@ 1
+ 80 |@@@@ 1
+ 90 |@@@@ 1
+ 100 |@ 0
+ 200 | 0
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.range.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.range.d
new file mode 100644
index 000000000000..e2882b3f8e3f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.range.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @["Screven"] = llquantize(0, 10, 1, 2, 20, 25);
+ @["Katz"] = llquantize(1, 10, 1, 2, 20, -100);
+ @["Kurian"] = llquantize(7, 10, 1, 2, 20, 15);
+ @["Rozwat"] = llquantize(49, 10, 1, 2, 20, 15);
+ @["Fowler"] = llquantize(343, 10, 1, 2, 20, 150);
+
+ printa(@);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.range.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.range.d.out
new file mode 100644
index 000000000000..c6736c6fc153
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.range.d.out
@@ -0,0 +1,29 @@
+
+ Katz
+ value ------------- Distribution ------------- count
+ < 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100
+ 10 | 0
+
+ Kurian
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 15
+ 10 | 0
+
+ Screven
+ value ------------- Distribution ------------- count
+ < 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 25
+ 10 | 0
+
+ Rozwat
+ value ------------- Distribution ------------- count
+ 40 | 0
+ 45 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 15
+ 50 | 0
+
+ Fowler
+ value ------------- Distribution ------------- count
+ 250 | 0
+ 300 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 150
+ 350 | 0
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.steps.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.steps.d
new file mode 100644
index 000000000000..f00659e57513
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.steps.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ <= 100/
+{
+ @ = llquantize(i, 10, 0, 10, 20);
+ @hunid = llquantize(i * 10, 10, 0, 10, 100);
+ @large = llquantize(i * 100, 10, 0, 10, 1000);
+}
+
+tick-1ms
+/i > 100/
+{
+ exit(0);
+}
+
+END
+{
+ printf("20 steps:\n");
+ printa(@);
+
+ printf("100 steps:\n");
+ printa(@hunid);
+
+ printf("1000 steps:\n");
+ printa(@large);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out
new file mode 100644
index 000000000000..08885515c002
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out
@@ -0,0 +1,2033 @@
+20 steps:
+
+
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 | 1
+ 2 | 1
+ 3 | 1
+ 4 | 1
+ 5 | 1
+ 6 | 1
+ 7 | 1
+ 8 | 1
+ 9 | 1
+ 10 |@@ 5
+ 15 |@@ 5
+ 20 |@@ 5
+ 25 |@@ 5
+ 30 |@@ 5
+ 35 |@@ 5
+ 40 |@@ 5
+ 45 |@@ 5
+ 50 |@@ 5
+ 55 |@@ 5
+ 60 |@@ 5
+ 65 |@@ 5
+ 70 |@@ 5
+ 75 |@@ 5
+ 80 |@@ 5
+ 85 |@@ 5
+ 90 |@@ 5
+ 95 |@@ 5
+ 100 |@ 2
+ 150 | 0
+
+100 steps:
+
+
+ value ------------- Distribution ------------- count
+ 9 | 0
+ 10 | 1
+ 11 | 0
+ 12 | 0
+ 13 | 0
+ 14 | 0
+ 15 | 0
+ 16 | 0
+ 17 | 0
+ 18 | 0
+ 19 | 0
+ 20 | 1
+ 21 | 0
+ 22 | 0
+ 23 | 0
+ 24 | 0
+ 25 | 0
+ 26 | 0
+ 27 | 0
+ 28 | 0
+ 29 | 0
+ 30 | 1
+ 31 | 0
+ 32 | 0
+ 33 | 0
+ 34 | 0
+ 35 | 0
+ 36 | 0
+ 37 | 0
+ 38 | 0
+ 39 | 0
+ 40 | 1
+ 41 | 0
+ 42 | 0
+ 43 | 0
+ 44 | 0
+ 45 | 0
+ 46 | 0
+ 47 | 0
+ 48 | 0
+ 49 | 0
+ 50 | 1
+ 51 | 0
+ 52 | 0
+ 53 | 0
+ 54 | 0
+ 55 | 0
+ 56 | 0
+ 57 | 0
+ 58 | 0
+ 59 | 0
+ 60 | 1
+ 61 | 0
+ 62 | 0
+ 63 | 0
+ 64 | 0
+ 65 | 0
+ 66 | 0
+ 67 | 0
+ 68 | 0
+ 69 | 0
+ 70 | 1
+ 71 | 0
+ 72 | 0
+ 73 | 0
+ 74 | 0
+ 75 | 0
+ 76 | 0
+ 77 | 0
+ 78 | 0
+ 79 | 0
+ 80 | 1
+ 81 | 0
+ 82 | 0
+ 83 | 0
+ 84 | 0
+ 85 | 0
+ 86 | 0
+ 87 | 0
+ 88 | 0
+ 89 | 0
+ 90 | 1
+ 91 | 0
+ 92 | 0
+ 93 | 0
+ 94 | 0
+ 95 | 0
+ 96 | 0
+ 97 | 0
+ 98 | 0
+ 99 | 0
+ 100 | 1
+ 110 | 1
+ 120 | 1
+ 130 | 1
+ 140 | 1
+ 150 | 1
+ 160 | 1
+ 170 | 1
+ 180 | 1
+ 190 | 1
+ 200 | 1
+ 210 | 1
+ 220 | 1
+ 230 | 1
+ 240 | 1
+ 250 | 1
+ 260 | 1
+ 270 | 1
+ 280 | 1
+ 290 | 1
+ 300 | 1
+ 310 | 1
+ 320 | 1
+ 330 | 1
+ 340 | 1
+ 350 | 1
+ 360 | 1
+ 370 | 1
+ 380 | 1
+ 390 | 1
+ 400 | 1
+ 410 | 1
+ 420 | 1
+ 430 | 1
+ 440 | 1
+ 450 | 1
+ 460 | 1
+ 470 | 1
+ 480 | 1
+ 490 | 1
+ 500 | 1
+ 510 | 1
+ 520 | 1
+ 530 | 1
+ 540 | 1
+ 550 | 1
+ 560 | 1
+ 570 | 1
+ 580 | 1
+ 590 | 1
+ 600 | 1
+ 610 | 1
+ 620 | 1
+ 630 | 1
+ 640 | 1
+ 650 | 1
+ 660 | 1
+ 670 | 1
+ 680 | 1
+ 690 | 1
+ 700 | 1
+ 710 | 1
+ 720 | 1
+ 730 | 1
+ 740 | 1
+ 750 | 1
+ 760 | 1
+ 770 | 1
+ 780 | 1
+ 790 | 1
+ 800 | 1
+ 810 | 1
+ 820 | 1
+ 830 | 1
+ 840 | 1
+ 850 | 1
+ 860 | 1
+ 870 | 1
+ 880 | 1
+ 890 | 1
+ 900 | 1
+ 910 | 1
+ 920 | 1
+ 930 | 1
+ 940 | 1
+ 950 | 1
+ 960 | 1
+ 970 | 1
+ 980 | 1
+ 990 | 1
+ 1000 |@ 2
+ 1100 | 0
+
+1000 steps:
+
+
+ value ------------- Distribution ------------- count
+ 99 | 0
+ 100 | 1
+ 101 | 0
+ 102 | 0
+ 103 | 0
+ 104 | 0
+ 105 | 0
+ 106 | 0
+ 107 | 0
+ 108 | 0
+ 109 | 0
+ 110 | 0
+ 111 | 0
+ 112 | 0
+ 113 | 0
+ 114 | 0
+ 115 | 0
+ 116 | 0
+ 117 | 0
+ 118 | 0
+ 119 | 0
+ 120 | 0
+ 121 | 0
+ 122 | 0
+ 123 | 0
+ 124 | 0
+ 125 | 0
+ 126 | 0
+ 127 | 0
+ 128 | 0
+ 129 | 0
+ 130 | 0
+ 131 | 0
+ 132 | 0
+ 133 | 0
+ 134 | 0
+ 135 | 0
+ 136 | 0
+ 137 | 0
+ 138 | 0
+ 139 | 0
+ 140 | 0
+ 141 | 0
+ 142 | 0
+ 143 | 0
+ 144 | 0
+ 145 | 0
+ 146 | 0
+ 147 | 0
+ 148 | 0
+ 149 | 0
+ 150 | 0
+ 151 | 0
+ 152 | 0
+ 153 | 0
+ 154 | 0
+ 155 | 0
+ 156 | 0
+ 157 | 0
+ 158 | 0
+ 159 | 0
+ 160 | 0
+ 161 | 0
+ 162 | 0
+ 163 | 0
+ 164 | 0
+ 165 | 0
+ 166 | 0
+ 167 | 0
+ 168 | 0
+ 169 | 0
+ 170 | 0
+ 171 | 0
+ 172 | 0
+ 173 | 0
+ 174 | 0
+ 175 | 0
+ 176 | 0
+ 177 | 0
+ 178 | 0
+ 179 | 0
+ 180 | 0
+ 181 | 0
+ 182 | 0
+ 183 | 0
+ 184 | 0
+ 185 | 0
+ 186 | 0
+ 187 | 0
+ 188 | 0
+ 189 | 0
+ 190 | 0
+ 191 | 0
+ 192 | 0
+ 193 | 0
+ 194 | 0
+ 195 | 0
+ 196 | 0
+ 197 | 0
+ 198 | 0
+ 199 | 0
+ 200 | 1
+ 201 | 0
+ 202 | 0
+ 203 | 0
+ 204 | 0
+ 205 | 0
+ 206 | 0
+ 207 | 0
+ 208 | 0
+ 209 | 0
+ 210 | 0
+ 211 | 0
+ 212 | 0
+ 213 | 0
+ 214 | 0
+ 215 | 0
+ 216 | 0
+ 217 | 0
+ 218 | 0
+ 219 | 0
+ 220 | 0
+ 221 | 0
+ 222 | 0
+ 223 | 0
+ 224 | 0
+ 225 | 0
+ 226 | 0
+ 227 | 0
+ 228 | 0
+ 229 | 0
+ 230 | 0
+ 231 | 0
+ 232 | 0
+ 233 | 0
+ 234 | 0
+ 235 | 0
+ 236 | 0
+ 237 | 0
+ 238 | 0
+ 239 | 0
+ 240 | 0
+ 241 | 0
+ 242 | 0
+ 243 | 0
+ 244 | 0
+ 245 | 0
+ 246 | 0
+ 247 | 0
+ 248 | 0
+ 249 | 0
+ 250 | 0
+ 251 | 0
+ 252 | 0
+ 253 | 0
+ 254 | 0
+ 255 | 0
+ 256 | 0
+ 257 | 0
+ 258 | 0
+ 259 | 0
+ 260 | 0
+ 261 | 0
+ 262 | 0
+ 263 | 0
+ 264 | 0
+ 265 | 0
+ 266 | 0
+ 267 | 0
+ 268 | 0
+ 269 | 0
+ 270 | 0
+ 271 | 0
+ 272 | 0
+ 273 | 0
+ 274 | 0
+ 275 | 0
+ 276 | 0
+ 277 | 0
+ 278 | 0
+ 279 | 0
+ 280 | 0
+ 281 | 0
+ 282 | 0
+ 283 | 0
+ 284 | 0
+ 285 | 0
+ 286 | 0
+ 287 | 0
+ 288 | 0
+ 289 | 0
+ 290 | 0
+ 291 | 0
+ 292 | 0
+ 293 | 0
+ 294 | 0
+ 295 | 0
+ 296 | 0
+ 297 | 0
+ 298 | 0
+ 299 | 0
+ 300 | 1
+ 301 | 0
+ 302 | 0
+ 303 | 0
+ 304 | 0
+ 305 | 0
+ 306 | 0
+ 307 | 0
+ 308 | 0
+ 309 | 0
+ 310 | 0
+ 311 | 0
+ 312 | 0
+ 313 | 0
+ 314 | 0
+ 315 | 0
+ 316 | 0
+ 317 | 0
+ 318 | 0
+ 319 | 0
+ 320 | 0
+ 321 | 0
+ 322 | 0
+ 323 | 0
+ 324 | 0
+ 325 | 0
+ 326 | 0
+ 327 | 0
+ 328 | 0
+ 329 | 0
+ 330 | 0
+ 331 | 0
+ 332 | 0
+ 333 | 0
+ 334 | 0
+ 335 | 0
+ 336 | 0
+ 337 | 0
+ 338 | 0
+ 339 | 0
+ 340 | 0
+ 341 | 0
+ 342 | 0
+ 343 | 0
+ 344 | 0
+ 345 | 0
+ 346 | 0
+ 347 | 0
+ 348 | 0
+ 349 | 0
+ 350 | 0
+ 351 | 0
+ 352 | 0
+ 353 | 0
+ 354 | 0
+ 355 | 0
+ 356 | 0
+ 357 | 0
+ 358 | 0
+ 359 | 0
+ 360 | 0
+ 361 | 0
+ 362 | 0
+ 363 | 0
+ 364 | 0
+ 365 | 0
+ 366 | 0
+ 367 | 0
+ 368 | 0
+ 369 | 0
+ 370 | 0
+ 371 | 0
+ 372 | 0
+ 373 | 0
+ 374 | 0
+ 375 | 0
+ 376 | 0
+ 377 | 0
+ 378 | 0
+ 379 | 0
+ 380 | 0
+ 381 | 0
+ 382 | 0
+ 383 | 0
+ 384 | 0
+ 385 | 0
+ 386 | 0
+ 387 | 0
+ 388 | 0
+ 389 | 0
+ 390 | 0
+ 391 | 0
+ 392 | 0
+ 393 | 0
+ 394 | 0
+ 395 | 0
+ 396 | 0
+ 397 | 0
+ 398 | 0
+ 399 | 0
+ 400 | 1
+ 401 | 0
+ 402 | 0
+ 403 | 0
+ 404 | 0
+ 405 | 0
+ 406 | 0
+ 407 | 0
+ 408 | 0
+ 409 | 0
+ 410 | 0
+ 411 | 0
+ 412 | 0
+ 413 | 0
+ 414 | 0
+ 415 | 0
+ 416 | 0
+ 417 | 0
+ 418 | 0
+ 419 | 0
+ 420 | 0
+ 421 | 0
+ 422 | 0
+ 423 | 0
+ 424 | 0
+ 425 | 0
+ 426 | 0
+ 427 | 0
+ 428 | 0
+ 429 | 0
+ 430 | 0
+ 431 | 0
+ 432 | 0
+ 433 | 0
+ 434 | 0
+ 435 | 0
+ 436 | 0
+ 437 | 0
+ 438 | 0
+ 439 | 0
+ 440 | 0
+ 441 | 0
+ 442 | 0
+ 443 | 0
+ 444 | 0
+ 445 | 0
+ 446 | 0
+ 447 | 0
+ 448 | 0
+ 449 | 0
+ 450 | 0
+ 451 | 0
+ 452 | 0
+ 453 | 0
+ 454 | 0
+ 455 | 0
+ 456 | 0
+ 457 | 0
+ 458 | 0
+ 459 | 0
+ 460 | 0
+ 461 | 0
+ 462 | 0
+ 463 | 0
+ 464 | 0
+ 465 | 0
+ 466 | 0
+ 467 | 0
+ 468 | 0
+ 469 | 0
+ 470 | 0
+ 471 | 0
+ 472 | 0
+ 473 | 0
+ 474 | 0
+ 475 | 0
+ 476 | 0
+ 477 | 0
+ 478 | 0
+ 479 | 0
+ 480 | 0
+ 481 | 0
+ 482 | 0
+ 483 | 0
+ 484 | 0
+ 485 | 0
+ 486 | 0
+ 487 | 0
+ 488 | 0
+ 489 | 0
+ 490 | 0
+ 491 | 0
+ 492 | 0
+ 493 | 0
+ 494 | 0
+ 495 | 0
+ 496 | 0
+ 497 | 0
+ 498 | 0
+ 499 | 0
+ 500 | 1
+ 501 | 0
+ 502 | 0
+ 503 | 0
+ 504 | 0
+ 505 | 0
+ 506 | 0
+ 507 | 0
+ 508 | 0
+ 509 | 0
+ 510 | 0
+ 511 | 0
+ 512 | 0
+ 513 | 0
+ 514 | 0
+ 515 | 0
+ 516 | 0
+ 517 | 0
+ 518 | 0
+ 519 | 0
+ 520 | 0
+ 521 | 0
+ 522 | 0
+ 523 | 0
+ 524 | 0
+ 525 | 0
+ 526 | 0
+ 527 | 0
+ 528 | 0
+ 529 | 0
+ 530 | 0
+ 531 | 0
+ 532 | 0
+ 533 | 0
+ 534 | 0
+ 535 | 0
+ 536 | 0
+ 537 | 0
+ 538 | 0
+ 539 | 0
+ 540 | 0
+ 541 | 0
+ 542 | 0
+ 543 | 0
+ 544 | 0
+ 545 | 0
+ 546 | 0
+ 547 | 0
+ 548 | 0
+ 549 | 0
+ 550 | 0
+ 551 | 0
+ 552 | 0
+ 553 | 0
+ 554 | 0
+ 555 | 0
+ 556 | 0
+ 557 | 0
+ 558 | 0
+ 559 | 0
+ 560 | 0
+ 561 | 0
+ 562 | 0
+ 563 | 0
+ 564 | 0
+ 565 | 0
+ 566 | 0
+ 567 | 0
+ 568 | 0
+ 569 | 0
+ 570 | 0
+ 571 | 0
+ 572 | 0
+ 573 | 0
+ 574 | 0
+ 575 | 0
+ 576 | 0
+ 577 | 0
+ 578 | 0
+ 579 | 0
+ 580 | 0
+ 581 | 0
+ 582 | 0
+ 583 | 0
+ 584 | 0
+ 585 | 0
+ 586 | 0
+ 587 | 0
+ 588 | 0
+ 589 | 0
+ 590 | 0
+ 591 | 0
+ 592 | 0
+ 593 | 0
+ 594 | 0
+ 595 | 0
+ 596 | 0
+ 597 | 0
+ 598 | 0
+ 599 | 0
+ 600 | 1
+ 601 | 0
+ 602 | 0
+ 603 | 0
+ 604 | 0
+ 605 | 0
+ 606 | 0
+ 607 | 0
+ 608 | 0
+ 609 | 0
+ 610 | 0
+ 611 | 0
+ 612 | 0
+ 613 | 0
+ 614 | 0
+ 615 | 0
+ 616 | 0
+ 617 | 0
+ 618 | 0
+ 619 | 0
+ 620 | 0
+ 621 | 0
+ 622 | 0
+ 623 | 0
+ 624 | 0
+ 625 | 0
+ 626 | 0
+ 627 | 0
+ 628 | 0
+ 629 | 0
+ 630 | 0
+ 631 | 0
+ 632 | 0
+ 633 | 0
+ 634 | 0
+ 635 | 0
+ 636 | 0
+ 637 | 0
+ 638 | 0
+ 639 | 0
+ 640 | 0
+ 641 | 0
+ 642 | 0
+ 643 | 0
+ 644 | 0
+ 645 | 0
+ 646 | 0
+ 647 | 0
+ 648 | 0
+ 649 | 0
+ 650 | 0
+ 651 | 0
+ 652 | 0
+ 653 | 0
+ 654 | 0
+ 655 | 0
+ 656 | 0
+ 657 | 0
+ 658 | 0
+ 659 | 0
+ 660 | 0
+ 661 | 0
+ 662 | 0
+ 663 | 0
+ 664 | 0
+ 665 | 0
+ 666 | 0
+ 667 | 0
+ 668 | 0
+ 669 | 0
+ 670 | 0
+ 671 | 0
+ 672 | 0
+ 673 | 0
+ 674 | 0
+ 675 | 0
+ 676 | 0
+ 677 | 0
+ 678 | 0
+ 679 | 0
+ 680 | 0
+ 681 | 0
+ 682 | 0
+ 683 | 0
+ 684 | 0
+ 685 | 0
+ 686 | 0
+ 687 | 0
+ 688 | 0
+ 689 | 0
+ 690 | 0
+ 691 | 0
+ 692 | 0
+ 693 | 0
+ 694 | 0
+ 695 | 0
+ 696 | 0
+ 697 | 0
+ 698 | 0
+ 699 | 0
+ 700 | 1
+ 701 | 0
+ 702 | 0
+ 703 | 0
+ 704 | 0
+ 705 | 0
+ 706 | 0
+ 707 | 0
+ 708 | 0
+ 709 | 0
+ 710 | 0
+ 711 | 0
+ 712 | 0
+ 713 | 0
+ 714 | 0
+ 715 | 0
+ 716 | 0
+ 717 | 0
+ 718 | 0
+ 719 | 0
+ 720 | 0
+ 721 | 0
+ 722 | 0
+ 723 | 0
+ 724 | 0
+ 725 | 0
+ 726 | 0
+ 727 | 0
+ 728 | 0
+ 729 | 0
+ 730 | 0
+ 731 | 0
+ 732 | 0
+ 733 | 0
+ 734 | 0
+ 735 | 0
+ 736 | 0
+ 737 | 0
+ 738 | 0
+ 739 | 0
+ 740 | 0
+ 741 | 0
+ 742 | 0
+ 743 | 0
+ 744 | 0
+ 745 | 0
+ 746 | 0
+ 747 | 0
+ 748 | 0
+ 749 | 0
+ 750 | 0
+ 751 | 0
+ 752 | 0
+ 753 | 0
+ 754 | 0
+ 755 | 0
+ 756 | 0
+ 757 | 0
+ 758 | 0
+ 759 | 0
+ 760 | 0
+ 761 | 0
+ 762 | 0
+ 763 | 0
+ 764 | 0
+ 765 | 0
+ 766 | 0
+ 767 | 0
+ 768 | 0
+ 769 | 0
+ 770 | 0
+ 771 | 0
+ 772 | 0
+ 773 | 0
+ 774 | 0
+ 775 | 0
+ 776 | 0
+ 777 | 0
+ 778 | 0
+ 779 | 0
+ 780 | 0
+ 781 | 0
+ 782 | 0
+ 783 | 0
+ 784 | 0
+ 785 | 0
+ 786 | 0
+ 787 | 0
+ 788 | 0
+ 789 | 0
+ 790 | 0
+ 791 | 0
+ 792 | 0
+ 793 | 0
+ 794 | 0
+ 795 | 0
+ 796 | 0
+ 797 | 0
+ 798 | 0
+ 799 | 0
+ 800 | 1
+ 801 | 0
+ 802 | 0
+ 803 | 0
+ 804 | 0
+ 805 | 0
+ 806 | 0
+ 807 | 0
+ 808 | 0
+ 809 | 0
+ 810 | 0
+ 811 | 0
+ 812 | 0
+ 813 | 0
+ 814 | 0
+ 815 | 0
+ 816 | 0
+ 817 | 0
+ 818 | 0
+ 819 | 0
+ 820 | 0
+ 821 | 0
+ 822 | 0
+ 823 | 0
+ 824 | 0
+ 825 | 0
+ 826 | 0
+ 827 | 0
+ 828 | 0
+ 829 | 0
+ 830 | 0
+ 831 | 0
+ 832 | 0
+ 833 | 0
+ 834 | 0
+ 835 | 0
+ 836 | 0
+ 837 | 0
+ 838 | 0
+ 839 | 0
+ 840 | 0
+ 841 | 0
+ 842 | 0
+ 843 | 0
+ 844 | 0
+ 845 | 0
+ 846 | 0
+ 847 | 0
+ 848 | 0
+ 849 | 0
+ 850 | 0
+ 851 | 0
+ 852 | 0
+ 853 | 0
+ 854 | 0
+ 855 | 0
+ 856 | 0
+ 857 | 0
+ 858 | 0
+ 859 | 0
+ 860 | 0
+ 861 | 0
+ 862 | 0
+ 863 | 0
+ 864 | 0
+ 865 | 0
+ 866 | 0
+ 867 | 0
+ 868 | 0
+ 869 | 0
+ 870 | 0
+ 871 | 0
+ 872 | 0
+ 873 | 0
+ 874 | 0
+ 875 | 0
+ 876 | 0
+ 877 | 0
+ 878 | 0
+ 879 | 0
+ 880 | 0
+ 881 | 0
+ 882 | 0
+ 883 | 0
+ 884 | 0
+ 885 | 0
+ 886 | 0
+ 887 | 0
+ 888 | 0
+ 889 | 0
+ 890 | 0
+ 891 | 0
+ 892 | 0
+ 893 | 0
+ 894 | 0
+ 895 | 0
+ 896 | 0
+ 897 | 0
+ 898 | 0
+ 899 | 0
+ 900 | 1
+ 901 | 0
+ 902 | 0
+ 903 | 0
+ 904 | 0
+ 905 | 0
+ 906 | 0
+ 907 | 0
+ 908 | 0
+ 909 | 0
+ 910 | 0
+ 911 | 0
+ 912 | 0
+ 913 | 0
+ 914 | 0
+ 915 | 0
+ 916 | 0
+ 917 | 0
+ 918 | 0
+ 919 | 0
+ 920 | 0
+ 921 | 0
+ 922 | 0
+ 923 | 0
+ 924 | 0
+ 925 | 0
+ 926 | 0
+ 927 | 0
+ 928 | 0
+ 929 | 0
+ 930 | 0
+ 931 | 0
+ 932 | 0
+ 933 | 0
+ 934 | 0
+ 935 | 0
+ 936 | 0
+ 937 | 0
+ 938 | 0
+ 939 | 0
+ 940 | 0
+ 941 | 0
+ 942 | 0
+ 943 | 0
+ 944 | 0
+ 945 | 0
+ 946 | 0
+ 947 | 0
+ 948 | 0
+ 949 | 0
+ 950 | 0
+ 951 | 0
+ 952 | 0
+ 953 | 0
+ 954 | 0
+ 955 | 0
+ 956 | 0
+ 957 | 0
+ 958 | 0
+ 959 | 0
+ 960 | 0
+ 961 | 0
+ 962 | 0
+ 963 | 0
+ 964 | 0
+ 965 | 0
+ 966 | 0
+ 967 | 0
+ 968 | 0
+ 969 | 0
+ 970 | 0
+ 971 | 0
+ 972 | 0
+ 973 | 0
+ 974 | 0
+ 975 | 0
+ 976 | 0
+ 977 | 0
+ 978 | 0
+ 979 | 0
+ 980 | 0
+ 981 | 0
+ 982 | 0
+ 983 | 0
+ 984 | 0
+ 985 | 0
+ 986 | 0
+ 987 | 0
+ 988 | 0
+ 989 | 0
+ 990 | 0
+ 991 | 0
+ 992 | 0
+ 993 | 0
+ 994 | 0
+ 995 | 0
+ 996 | 0
+ 997 | 0
+ 998 | 0
+ 999 | 0
+ 1000 | 1
+ 1010 | 0
+ 1020 | 0
+ 1030 | 0
+ 1040 | 0
+ 1050 | 0
+ 1060 | 0
+ 1070 | 0
+ 1080 | 0
+ 1090 | 0
+ 1100 | 1
+ 1110 | 0
+ 1120 | 0
+ 1130 | 0
+ 1140 | 0
+ 1150 | 0
+ 1160 | 0
+ 1170 | 0
+ 1180 | 0
+ 1190 | 0
+ 1200 | 1
+ 1210 | 0
+ 1220 | 0
+ 1230 | 0
+ 1240 | 0
+ 1250 | 0
+ 1260 | 0
+ 1270 | 0
+ 1280 | 0
+ 1290 | 0
+ 1300 | 1
+ 1310 | 0
+ 1320 | 0
+ 1330 | 0
+ 1340 | 0
+ 1350 | 0
+ 1360 | 0
+ 1370 | 0
+ 1380 | 0
+ 1390 | 0
+ 1400 | 1
+ 1410 | 0
+ 1420 | 0
+ 1430 | 0
+ 1440 | 0
+ 1450 | 0
+ 1460 | 0
+ 1470 | 0
+ 1480 | 0
+ 1490 | 0
+ 1500 | 1
+ 1510 | 0
+ 1520 | 0
+ 1530 | 0
+ 1540 | 0
+ 1550 | 0
+ 1560 | 0
+ 1570 | 0
+ 1580 | 0
+ 1590 | 0
+ 1600 | 1
+ 1610 | 0
+ 1620 | 0
+ 1630 | 0
+ 1640 | 0
+ 1650 | 0
+ 1660 | 0
+ 1670 | 0
+ 1680 | 0
+ 1690 | 0
+ 1700 | 1
+ 1710 | 0
+ 1720 | 0
+ 1730 | 0
+ 1740 | 0
+ 1750 | 0
+ 1760 | 0
+ 1770 | 0
+ 1780 | 0
+ 1790 | 0
+ 1800 | 1
+ 1810 | 0
+ 1820 | 0
+ 1830 | 0
+ 1840 | 0
+ 1850 | 0
+ 1860 | 0
+ 1870 | 0
+ 1880 | 0
+ 1890 | 0
+ 1900 | 1
+ 1910 | 0
+ 1920 | 0
+ 1930 | 0
+ 1940 | 0
+ 1950 | 0
+ 1960 | 0
+ 1970 | 0
+ 1980 | 0
+ 1990 | 0
+ 2000 | 1
+ 2010 | 0
+ 2020 | 0
+ 2030 | 0
+ 2040 | 0
+ 2050 | 0
+ 2060 | 0
+ 2070 | 0
+ 2080 | 0
+ 2090 | 0
+ 2100 | 1
+ 2110 | 0
+ 2120 | 0
+ 2130 | 0
+ 2140 | 0
+ 2150 | 0
+ 2160 | 0
+ 2170 | 0
+ 2180 | 0
+ 2190 | 0
+ 2200 | 1
+ 2210 | 0
+ 2220 | 0
+ 2230 | 0
+ 2240 | 0
+ 2250 | 0
+ 2260 | 0
+ 2270 | 0
+ 2280 | 0
+ 2290 | 0
+ 2300 | 1
+ 2310 | 0
+ 2320 | 0
+ 2330 | 0
+ 2340 | 0
+ 2350 | 0
+ 2360 | 0
+ 2370 | 0
+ 2380 | 0
+ 2390 | 0
+ 2400 | 1
+ 2410 | 0
+ 2420 | 0
+ 2430 | 0
+ 2440 | 0
+ 2450 | 0
+ 2460 | 0
+ 2470 | 0
+ 2480 | 0
+ 2490 | 0
+ 2500 | 1
+ 2510 | 0
+ 2520 | 0
+ 2530 | 0
+ 2540 | 0
+ 2550 | 0
+ 2560 | 0
+ 2570 | 0
+ 2580 | 0
+ 2590 | 0
+ 2600 | 1
+ 2610 | 0
+ 2620 | 0
+ 2630 | 0
+ 2640 | 0
+ 2650 | 0
+ 2660 | 0
+ 2670 | 0
+ 2680 | 0
+ 2690 | 0
+ 2700 | 1
+ 2710 | 0
+ 2720 | 0
+ 2730 | 0
+ 2740 | 0
+ 2750 | 0
+ 2760 | 0
+ 2770 | 0
+ 2780 | 0
+ 2790 | 0
+ 2800 | 1
+ 2810 | 0
+ 2820 | 0
+ 2830 | 0
+ 2840 | 0
+ 2850 | 0
+ 2860 | 0
+ 2870 | 0
+ 2880 | 0
+ 2890 | 0
+ 2900 | 1
+ 2910 | 0
+ 2920 | 0
+ 2930 | 0
+ 2940 | 0
+ 2950 | 0
+ 2960 | 0
+ 2970 | 0
+ 2980 | 0
+ 2990 | 0
+ 3000 | 1
+ 3010 | 0
+ 3020 | 0
+ 3030 | 0
+ 3040 | 0
+ 3050 | 0
+ 3060 | 0
+ 3070 | 0
+ 3080 | 0
+ 3090 | 0
+ 3100 | 1
+ 3110 | 0
+ 3120 | 0
+ 3130 | 0
+ 3140 | 0
+ 3150 | 0
+ 3160 | 0
+ 3170 | 0
+ 3180 | 0
+ 3190 | 0
+ 3200 | 1
+ 3210 | 0
+ 3220 | 0
+ 3230 | 0
+ 3240 | 0
+ 3250 | 0
+ 3260 | 0
+ 3270 | 0
+ 3280 | 0
+ 3290 | 0
+ 3300 | 1
+ 3310 | 0
+ 3320 | 0
+ 3330 | 0
+ 3340 | 0
+ 3350 | 0
+ 3360 | 0
+ 3370 | 0
+ 3380 | 0
+ 3390 | 0
+ 3400 | 1
+ 3410 | 0
+ 3420 | 0
+ 3430 | 0
+ 3440 | 0
+ 3450 | 0
+ 3460 | 0
+ 3470 | 0
+ 3480 | 0
+ 3490 | 0
+ 3500 | 1
+ 3510 | 0
+ 3520 | 0
+ 3530 | 0
+ 3540 | 0
+ 3550 | 0
+ 3560 | 0
+ 3570 | 0
+ 3580 | 0
+ 3590 | 0
+ 3600 | 1
+ 3610 | 0
+ 3620 | 0
+ 3630 | 0
+ 3640 | 0
+ 3650 | 0
+ 3660 | 0
+ 3670 | 0
+ 3680 | 0
+ 3690 | 0
+ 3700 | 1
+ 3710 | 0
+ 3720 | 0
+ 3730 | 0
+ 3740 | 0
+ 3750 | 0
+ 3760 | 0
+ 3770 | 0
+ 3780 | 0
+ 3790 | 0
+ 3800 | 1
+ 3810 | 0
+ 3820 | 0
+ 3830 | 0
+ 3840 | 0
+ 3850 | 0
+ 3860 | 0
+ 3870 | 0
+ 3880 | 0
+ 3890 | 0
+ 3900 | 1
+ 3910 | 0
+ 3920 | 0
+ 3930 | 0
+ 3940 | 0
+ 3950 | 0
+ 3960 | 0
+ 3970 | 0
+ 3980 | 0
+ 3990 | 0
+ 4000 | 1
+ 4010 | 0
+ 4020 | 0
+ 4030 | 0
+ 4040 | 0
+ 4050 | 0
+ 4060 | 0
+ 4070 | 0
+ 4080 | 0
+ 4090 | 0
+ 4100 | 1
+ 4110 | 0
+ 4120 | 0
+ 4130 | 0
+ 4140 | 0
+ 4150 | 0
+ 4160 | 0
+ 4170 | 0
+ 4180 | 0
+ 4190 | 0
+ 4200 | 1
+ 4210 | 0
+ 4220 | 0
+ 4230 | 0
+ 4240 | 0
+ 4250 | 0
+ 4260 | 0
+ 4270 | 0
+ 4280 | 0
+ 4290 | 0
+ 4300 | 1
+ 4310 | 0
+ 4320 | 0
+ 4330 | 0
+ 4340 | 0
+ 4350 | 0
+ 4360 | 0
+ 4370 | 0
+ 4380 | 0
+ 4390 | 0
+ 4400 | 1
+ 4410 | 0
+ 4420 | 0
+ 4430 | 0
+ 4440 | 0
+ 4450 | 0
+ 4460 | 0
+ 4470 | 0
+ 4480 | 0
+ 4490 | 0
+ 4500 | 1
+ 4510 | 0
+ 4520 | 0
+ 4530 | 0
+ 4540 | 0
+ 4550 | 0
+ 4560 | 0
+ 4570 | 0
+ 4580 | 0
+ 4590 | 0
+ 4600 | 1
+ 4610 | 0
+ 4620 | 0
+ 4630 | 0
+ 4640 | 0
+ 4650 | 0
+ 4660 | 0
+ 4670 | 0
+ 4680 | 0
+ 4690 | 0
+ 4700 | 1
+ 4710 | 0
+ 4720 | 0
+ 4730 | 0
+ 4740 | 0
+ 4750 | 0
+ 4760 | 0
+ 4770 | 0
+ 4780 | 0
+ 4790 | 0
+ 4800 | 1
+ 4810 | 0
+ 4820 | 0
+ 4830 | 0
+ 4840 | 0
+ 4850 | 0
+ 4860 | 0
+ 4870 | 0
+ 4880 | 0
+ 4890 | 0
+ 4900 | 1
+ 4910 | 0
+ 4920 | 0
+ 4930 | 0
+ 4940 | 0
+ 4950 | 0
+ 4960 | 0
+ 4970 | 0
+ 4980 | 0
+ 4990 | 0
+ 5000 | 1
+ 5010 | 0
+ 5020 | 0
+ 5030 | 0
+ 5040 | 0
+ 5050 | 0
+ 5060 | 0
+ 5070 | 0
+ 5080 | 0
+ 5090 | 0
+ 5100 | 1
+ 5110 | 0
+ 5120 | 0
+ 5130 | 0
+ 5140 | 0
+ 5150 | 0
+ 5160 | 0
+ 5170 | 0
+ 5180 | 0
+ 5190 | 0
+ 5200 | 1
+ 5210 | 0
+ 5220 | 0
+ 5230 | 0
+ 5240 | 0
+ 5250 | 0
+ 5260 | 0
+ 5270 | 0
+ 5280 | 0
+ 5290 | 0
+ 5300 | 1
+ 5310 | 0
+ 5320 | 0
+ 5330 | 0
+ 5340 | 0
+ 5350 | 0
+ 5360 | 0
+ 5370 | 0
+ 5380 | 0
+ 5390 | 0
+ 5400 | 1
+ 5410 | 0
+ 5420 | 0
+ 5430 | 0
+ 5440 | 0
+ 5450 | 0
+ 5460 | 0
+ 5470 | 0
+ 5480 | 0
+ 5490 | 0
+ 5500 | 1
+ 5510 | 0
+ 5520 | 0
+ 5530 | 0
+ 5540 | 0
+ 5550 | 0
+ 5560 | 0
+ 5570 | 0
+ 5580 | 0
+ 5590 | 0
+ 5600 | 1
+ 5610 | 0
+ 5620 | 0
+ 5630 | 0
+ 5640 | 0
+ 5650 | 0
+ 5660 | 0
+ 5670 | 0
+ 5680 | 0
+ 5690 | 0
+ 5700 | 1
+ 5710 | 0
+ 5720 | 0
+ 5730 | 0
+ 5740 | 0
+ 5750 | 0
+ 5760 | 0
+ 5770 | 0
+ 5780 | 0
+ 5790 | 0
+ 5800 | 1
+ 5810 | 0
+ 5820 | 0
+ 5830 | 0
+ 5840 | 0
+ 5850 | 0
+ 5860 | 0
+ 5870 | 0
+ 5880 | 0
+ 5890 | 0
+ 5900 | 1
+ 5910 | 0
+ 5920 | 0
+ 5930 | 0
+ 5940 | 0
+ 5950 | 0
+ 5960 | 0
+ 5970 | 0
+ 5980 | 0
+ 5990 | 0
+ 6000 | 1
+ 6010 | 0
+ 6020 | 0
+ 6030 | 0
+ 6040 | 0
+ 6050 | 0
+ 6060 | 0
+ 6070 | 0
+ 6080 | 0
+ 6090 | 0
+ 6100 | 1
+ 6110 | 0
+ 6120 | 0
+ 6130 | 0
+ 6140 | 0
+ 6150 | 0
+ 6160 | 0
+ 6170 | 0
+ 6180 | 0
+ 6190 | 0
+ 6200 | 1
+ 6210 | 0
+ 6220 | 0
+ 6230 | 0
+ 6240 | 0
+ 6250 | 0
+ 6260 | 0
+ 6270 | 0
+ 6280 | 0
+ 6290 | 0
+ 6300 | 1
+ 6310 | 0
+ 6320 | 0
+ 6330 | 0
+ 6340 | 0
+ 6350 | 0
+ 6360 | 0
+ 6370 | 0
+ 6380 | 0
+ 6390 | 0
+ 6400 | 1
+ 6410 | 0
+ 6420 | 0
+ 6430 | 0
+ 6440 | 0
+ 6450 | 0
+ 6460 | 0
+ 6470 | 0
+ 6480 | 0
+ 6490 | 0
+ 6500 | 1
+ 6510 | 0
+ 6520 | 0
+ 6530 | 0
+ 6540 | 0
+ 6550 | 0
+ 6560 | 0
+ 6570 | 0
+ 6580 | 0
+ 6590 | 0
+ 6600 | 1
+ 6610 | 0
+ 6620 | 0
+ 6630 | 0
+ 6640 | 0
+ 6650 | 0
+ 6660 | 0
+ 6670 | 0
+ 6680 | 0
+ 6690 | 0
+ 6700 | 1
+ 6710 | 0
+ 6720 | 0
+ 6730 | 0
+ 6740 | 0
+ 6750 | 0
+ 6760 | 0
+ 6770 | 0
+ 6780 | 0
+ 6790 | 0
+ 6800 | 1
+ 6810 | 0
+ 6820 | 0
+ 6830 | 0
+ 6840 | 0
+ 6850 | 0
+ 6860 | 0
+ 6870 | 0
+ 6880 | 0
+ 6890 | 0
+ 6900 | 1
+ 6910 | 0
+ 6920 | 0
+ 6930 | 0
+ 6940 | 0
+ 6950 | 0
+ 6960 | 0
+ 6970 | 0
+ 6980 | 0
+ 6990 | 0
+ 7000 | 1
+ 7010 | 0
+ 7020 | 0
+ 7030 | 0
+ 7040 | 0
+ 7050 | 0
+ 7060 | 0
+ 7070 | 0
+ 7080 | 0
+ 7090 | 0
+ 7100 | 1
+ 7110 | 0
+ 7120 | 0
+ 7130 | 0
+ 7140 | 0
+ 7150 | 0
+ 7160 | 0
+ 7170 | 0
+ 7180 | 0
+ 7190 | 0
+ 7200 | 1
+ 7210 | 0
+ 7220 | 0
+ 7230 | 0
+ 7240 | 0
+ 7250 | 0
+ 7260 | 0
+ 7270 | 0
+ 7280 | 0
+ 7290 | 0
+ 7300 | 1
+ 7310 | 0
+ 7320 | 0
+ 7330 | 0
+ 7340 | 0
+ 7350 | 0
+ 7360 | 0
+ 7370 | 0
+ 7380 | 0
+ 7390 | 0
+ 7400 | 1
+ 7410 | 0
+ 7420 | 0
+ 7430 | 0
+ 7440 | 0
+ 7450 | 0
+ 7460 | 0
+ 7470 | 0
+ 7480 | 0
+ 7490 | 0
+ 7500 | 1
+ 7510 | 0
+ 7520 | 0
+ 7530 | 0
+ 7540 | 0
+ 7550 | 0
+ 7560 | 0
+ 7570 | 0
+ 7580 | 0
+ 7590 | 0
+ 7600 | 1
+ 7610 | 0
+ 7620 | 0
+ 7630 | 0
+ 7640 | 0
+ 7650 | 0
+ 7660 | 0
+ 7670 | 0
+ 7680 | 0
+ 7690 | 0
+ 7700 | 1
+ 7710 | 0
+ 7720 | 0
+ 7730 | 0
+ 7740 | 0
+ 7750 | 0
+ 7760 | 0
+ 7770 | 0
+ 7780 | 0
+ 7790 | 0
+ 7800 | 1
+ 7810 | 0
+ 7820 | 0
+ 7830 | 0
+ 7840 | 0
+ 7850 | 0
+ 7860 | 0
+ 7870 | 0
+ 7880 | 0
+ 7890 | 0
+ 7900 | 1
+ 7910 | 0
+ 7920 | 0
+ 7930 | 0
+ 7940 | 0
+ 7950 | 0
+ 7960 | 0
+ 7970 | 0
+ 7980 | 0
+ 7990 | 0
+ 8000 | 1
+ 8010 | 0
+ 8020 | 0
+ 8030 | 0
+ 8040 | 0
+ 8050 | 0
+ 8060 | 0
+ 8070 | 0
+ 8080 | 0
+ 8090 | 0
+ 8100 | 1
+ 8110 | 0
+ 8120 | 0
+ 8130 | 0
+ 8140 | 0
+ 8150 | 0
+ 8160 | 0
+ 8170 | 0
+ 8180 | 0
+ 8190 | 0
+ 8200 | 1
+ 8210 | 0
+ 8220 | 0
+ 8230 | 0
+ 8240 | 0
+ 8250 | 0
+ 8260 | 0
+ 8270 | 0
+ 8280 | 0
+ 8290 | 0
+ 8300 | 1
+ 8310 | 0
+ 8320 | 0
+ 8330 | 0
+ 8340 | 0
+ 8350 | 0
+ 8360 | 0
+ 8370 | 0
+ 8380 | 0
+ 8390 | 0
+ 8400 | 1
+ 8410 | 0
+ 8420 | 0
+ 8430 | 0
+ 8440 | 0
+ 8450 | 0
+ 8460 | 0
+ 8470 | 0
+ 8480 | 0
+ 8490 | 0
+ 8500 | 1
+ 8510 | 0
+ 8520 | 0
+ 8530 | 0
+ 8540 | 0
+ 8550 | 0
+ 8560 | 0
+ 8570 | 0
+ 8580 | 0
+ 8590 | 0
+ 8600 | 1
+ 8610 | 0
+ 8620 | 0
+ 8630 | 0
+ 8640 | 0
+ 8650 | 0
+ 8660 | 0
+ 8670 | 0
+ 8680 | 0
+ 8690 | 0
+ 8700 | 1
+ 8710 | 0
+ 8720 | 0
+ 8730 | 0
+ 8740 | 0
+ 8750 | 0
+ 8760 | 0
+ 8770 | 0
+ 8780 | 0
+ 8790 | 0
+ 8800 | 1
+ 8810 | 0
+ 8820 | 0
+ 8830 | 0
+ 8840 | 0
+ 8850 | 0
+ 8860 | 0
+ 8870 | 0
+ 8880 | 0
+ 8890 | 0
+ 8900 | 1
+ 8910 | 0
+ 8920 | 0
+ 8930 | 0
+ 8940 | 0
+ 8950 | 0
+ 8960 | 0
+ 8970 | 0
+ 8980 | 0
+ 8990 | 0
+ 9000 | 1
+ 9010 | 0
+ 9020 | 0
+ 9030 | 0
+ 9040 | 0
+ 9050 | 0
+ 9060 | 0
+ 9070 | 0
+ 9080 | 0
+ 9090 | 0
+ 9100 | 1
+ 9110 | 0
+ 9120 | 0
+ 9130 | 0
+ 9140 | 0
+ 9150 | 0
+ 9160 | 0
+ 9170 | 0
+ 9180 | 0
+ 9190 | 0
+ 9200 | 1
+ 9210 | 0
+ 9220 | 0
+ 9230 | 0
+ 9240 | 0
+ 9250 | 0
+ 9260 | 0
+ 9270 | 0
+ 9280 | 0
+ 9290 | 0
+ 9300 | 1
+ 9310 | 0
+ 9320 | 0
+ 9330 | 0
+ 9340 | 0
+ 9350 | 0
+ 9360 | 0
+ 9370 | 0
+ 9380 | 0
+ 9390 | 0
+ 9400 | 1
+ 9410 | 0
+ 9420 | 0
+ 9430 | 0
+ 9440 | 0
+ 9450 | 0
+ 9460 | 0
+ 9470 | 0
+ 9480 | 0
+ 9490 | 0
+ 9500 | 1
+ 9510 | 0
+ 9520 | 0
+ 9530 | 0
+ 9540 | 0
+ 9550 | 0
+ 9560 | 0
+ 9570 | 0
+ 9580 | 0
+ 9590 | 0
+ 9600 | 1
+ 9610 | 0
+ 9620 | 0
+ 9630 | 0
+ 9640 | 0
+ 9650 | 0
+ 9660 | 0
+ 9670 | 0
+ 9680 | 0
+ 9690 | 0
+ 9700 | 1
+ 9710 | 0
+ 9720 | 0
+ 9730 | 0
+ 9740 | 0
+ 9750 | 0
+ 9760 | 0
+ 9770 | 0
+ 9780 | 0
+ 9790 | 0
+ 9800 | 1
+ 9810 | 0
+ 9820 | 0
+ 9830 | 0
+ 9840 | 0
+ 9850 | 0
+ 9860 | 0
+ 9870 | 0
+ 9880 | 0
+ 9890 | 0
+ 9900 | 1
+ 9910 | 0
+ 9920 | 0
+ 9930 | 0
+ 9940 | 0
+ 9950 | 0
+ 9960 | 0
+ 9970 | 0
+ 9980 | 0
+ 9990 | 0
+ 10000 | 1
+ 10100 | 1
+ 10200 | 0
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d
new file mode 100644
index 000000000000..e3db03002c46
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+int i;
+
+tick-10ms
+/i < 100/
+{
+ @[i] = llquantize(i, 10, 1, 2, 10, 150);
+ @[i] = llquantize(i + 1, 10, 1, 2, 10, 150);
+ @[i] = llquantize(i + 2, 10, 1, 2, 10, 150);
+ @[i] = llquantize(i + 3, 10, 1, 2, 10, 150);
+ i++;
+}
+
+tick-10ms
+/i == 100/
+{
+ exit(0);
+}
+
+END
+{
+ trunc(@, 5);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out
new file mode 100644
index 000000000000..941c62679b07
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out
@@ -0,0 +1,34 @@
+
+ 95
+ value ------------- Distribution ------------- count
+ 80 | 0
+ 90 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 600
+ 100 | 0
+
+ 96
+ value ------------- Distribution ------------- count
+ 80 | 0
+ 90 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 600
+ 100 | 0
+
+ 97
+ value ------------- Distribution ------------- count
+ 80 | 0
+ 90 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 450
+ 100 |@@@@@@@@@@ 150
+ 200 | 0
+
+ 98
+ value ------------- Distribution ------------- count
+ 80 | 0
+ 90 |@@@@@@@@@@@@@@@@@@@@ 300
+ 100 |@@@@@@@@@@@@@@@@@@@@ 300
+ 200 | 0
+
+ 99
+ value ------------- Distribution ------------- count
+ 80 | 0
+ 90 |@@@@@@@@@@ 150
+ 100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 450
+ 200 | 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh
new file mode 100644
index 000000000000..561f8549d924
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh
@@ -0,0 +1,85 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+#
+# This script primarily tests that the ::dtrace dcmd is not dumping
+# core. We don't try to make sense of the output of the dcmd nor
+# do we check to see if any output is produced. We merely see if
+# mdb fails with a fatal failure.
+#
+
+script()
+{
+ $dtrace -o $dtraceout -s /dev/stdin <<EOF
+ syscall:::entry
+ {
+ @[probefunc] = count();
+ }
+EOF
+}
+
+mdbdoit()
+{
+ mdb -k <<EOF
+ ::walk dtrace_state | ::dtrace
+EOF
+ status=$?
+ kill $script
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+dtraceout=/tmp/dtrace.out.$$
+script &
+script=$!
+timeout=15
+
+#
+# Sleep while the above script fires into life. To guard against dtrace dying
+# and us sleeping forever we allow 15 secs for this to happen. This should be
+# enough for even the slowest systems.
+#
+while [ ! -f $dtraceout ]; do
+ sleep 1
+ timeout=$(($timeout-1))
+ if [ $timeout -eq 0 ]; then
+ echo "dtrace failed to start. Exiting."
+ exit 1
+ fi
+done
+
+mdbdoit
+
+rm $dtraceout
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh
new file mode 100644
index 000000000000..b1cac20fc8db
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh
@@ -0,0 +1,79 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that several of the the mib:::icmp* probes fire and fire
+# with a valid args[0].
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ mib:::icmpInEchos
+ {
+ in = args[0];
+ }
+
+ mib:::icmpOutEchoReps
+ {
+ reps = args[0];
+ }
+
+ mib:::icmpOutMsgs
+ {
+ msgs = args[0];
+ }
+
+ profile:::tick-10msec
+ /in && reps && msgs/
+ {
+ exit(0);
+ }
+EOF
+}
+
+pinger()
+{
+ while true; do
+ ping -A inet localhost
+ /usr/bin/sleep 1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+pinger &
+pinger=$!
+script
+status=$?
+
+kill $pinger
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.tcp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.tcp.ksh
new file mode 100644
index 000000000000..ee602e86112c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.tcp.ksh
@@ -0,0 +1,155 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that several of the the mib:::tcp* probes fire and fire
+# with a valid args[0].
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+dtraceout=/tmp/dtrace.out.$$
+timeout=15
+port=2000
+
+if [ -f $dtraceout ]; then
+ rm -f $dtraceout
+fi
+
+script()
+{
+ $dtrace -o $dtraceout -s /dev/stdin <<EOF
+ mib:::tcpActiveOpens
+ {
+ opens = args[0];
+ }
+
+ mib:::tcpOutDataBytes
+ {
+ bytes = args[0];
+ }
+
+ mib:::tcpOutDataSegs
+ {
+ segs = args[0];
+ }
+
+ profile:::tick-10msec
+ /opens && bytes && segs/
+ {
+ exit(0);
+ }
+
+ profile:::tick-1s
+ /n++ >= 10/
+ {
+ exit(1);
+ }
+EOF
+}
+
+server()
+{
+ perl /dev/stdin /dev/stdout << EOF
+ use strict;
+ use Socket;
+
+ socket(S, AF_INET, SOCK_STREAM, getprotobyname('tcp'))
+ or die "socket() failed: \$!";
+
+ setsockopt(S, SOL_SOCKET, SO_REUSEADDR, 1)
+ or die "setsockopt() failed: \$!";
+
+ my \$addr = sockaddr_in($port, INADDR_ANY);
+ bind(S, \$addr) or die "bind() failed: \$!";
+ listen(S, SOMAXCONN) or die "listen() failed: \$!";
+
+ while (1) {
+ next unless my \$raddr = accept(SESSION, S);
+
+ while (<SESSION>) {
+ }
+
+ close SESSION;
+ }
+EOF
+}
+
+client()
+{
+ perl /dev/stdin /dev/stdout <<EOF
+ use strict;
+ use Socket;
+
+ my \$peer = sockaddr_in($port, INADDR_ANY);
+
+ socket(S, AF_INET, SOCK_STREAM, getprotobyname('tcp'))
+ or die "socket() failed: \$!";
+
+ connect(S, \$peer) or die "connect failed: \$!";
+
+ for (my \$i = 0; \$i < 10; \$i++) {
+ send(S, "There!", 0) or die "send() failed: \$!";
+ sleep (1);
+ }
+EOF
+}
+
+script &
+dtrace_pid=$!
+
+#
+# Sleep while the above script fires into life. To guard against dtrace dying
+# and us sleeping forever we allow 15 secs for this to happen. This should be
+# enough for even the slowest systems.
+#
+while [ ! -f $dtraceout ]; do
+ sleep 1
+ timeout=$(($timeout-1))
+ if [ $timeout -eq 0 ]; then
+ echo "dtrace failed to start. Exiting."
+ exit 1
+ fi
+done
+
+server &
+server_pid=$!
+sleep 2
+client &
+client_pid=$!
+
+wait $dtrace_pid
+status=$?
+
+kill $server_pid
+kill $client_pid
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.udp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.udp.ksh
new file mode 100644
index 000000000000..a492124c9c17
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.udp.ksh
@@ -0,0 +1,74 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that several of the the mib:::udp* probes fire and fire
+# with a valid args[0].
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ mib:::udpHCOutDatagrams
+ {
+ out = args[0];
+ }
+
+ mib:::udpHCInDatagrams
+ {
+ in = args[0];
+ }
+
+ profile:::tick-10msec
+ /in && out/
+ {
+ exit(0);
+ }
+EOF
+}
+
+rupper()
+{
+ while true; do
+ rup localhost
+ /usr/bin/sleep 1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+rupper &
+rupper=$!
+script
+status=$?
+
+kill $rupper
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/err.D_PRAGMA_OPTSET.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/err.D_PRAGMA_OPTSET.d
new file mode 100644
index 000000000000..5238e3f3b1ce
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/err.D_PRAGMA_OPTSET.d
@@ -0,0 +1,34 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet=please
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.badopt.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.badopt.d
new file mode 100644
index 000000000000..868b756f61d2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.badopt.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ setopt("Nixon");
+ setopt("Harding");
+ setopt("Hoover");
+ setopt("Bush");
+ setopt("quiet", "hell no");
+ setopt("aggrate", "0.5hz");
+ setopt("bufsize", "1m");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.boolopt.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.boolopt.d
new file mode 100644
index 000000000000..0755271f7672
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.boolopt.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet=yes
+#pragma D option quiet=YES
+#pragma D option quiet=true
+#pragma D option quiet=enable
+#pragma D option quiet=enabled
+#pragma D option quiet=on
+#pragma D option quiet=set
+#pragma D option quiet=SeT
+
+#pragma D option flowindent=no
+#pragma D option flowindent=NO
+#pragma D option flowindent=false
+#pragma D option flowindent=disable
+#pragma D option flowindent=disabled
+#pragma D option flowindent=off
+#pragma D option flowindent=UnSeT
+
+BEGIN
+{
+ printf(".lived eht si paTmetsyS, lived eht si paTmetsyS\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.boolopt.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.boolopt.d.out
new file mode 100644
index 000000000000..2554be5cd397
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.boolopt.d.out
@@ -0,0 +1,2 @@
+.lived eht si paTmetsyS, lived eht si paTmetsyS
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dynopt.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dynopt.d
new file mode 100644
index 000000000000..cb98d73375c1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dynopt.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+#pragma D option switchrate=1ms
+#pragma D option aggrate=1ms
+
+tick-100ms
+{
+ i++;
+}
+
+tick-100ms
+/i > 1/
+{
+ setopt("quiet", "no");
+ setopt("quiet");
+ setopt("quiet");
+ setopt("quiet", "yes");
+ @["abc"] = count();
+ printa("%@d\n", @);
+}
+
+tick-100ms
+/i == 5/
+{
+ setopt("switchrate", "5sec");
+ setopt("aggrate", "5sec");
+}
+
+tick-100ms
+/i == 31/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dynopt.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dynopt.d.out
new file mode 100644
index 000000000000..092a0426f7f3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dynopt.d.out
@@ -0,0 +1,31 @@
+1
+2
+3
+4
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.enablerace.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.enablerace.ksh
new file mode 100644
index 000000000000..b4d56bb6eedd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.enablerace.ksh
@@ -0,0 +1,89 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script attempts to tease out a race when probes are initially enabled.
+#
+script()
+{
+ #
+ # Nauseatingly, the #defines below must be in the 0th column to
+ # satisfy the ancient cpp that -C defaults to.
+ #
+ $dtrace -C -s /dev/stdin <<EOF
+#define PROF1 profile:::profile-4000hz
+#define PROF4 PROF1, PROF1, PROF1, PROF1
+#define PROF16 PROF4, PROF4, PROF4, PROF4
+#define PROF64 PROF16, PROF16, PROF16, PROF16
+#define PROF256 PROF64, PROF64, PROF64, PROF64
+#define PROF512 PROF256, PROF256
+
+ PROF1
+ {
+ this->x = 0;
+ }
+
+ PROF512
+ {
+ this->x++;
+ }
+
+ PROF1
+ /this->x != 512/
+ {
+ printf("failed! x is %d (expected 512)", this->x);
+ exit(1);
+ }
+
+ tick-1sec
+ /secs++/
+ {
+ exit(0);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+let i=0
+
+while [ "$i" -lt 20 ]; do
+ script
+ status=$?
+
+ if [ "$status" -ne 0 ]; then
+ exit $status
+ fi
+
+ let i=i+1
+done
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.haslam.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.haslam.d
new file mode 100644
index 000000000000..a0b437b4efaa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.haslam.d
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: test for off-by-one error in the format lookup code
+ *
+ * SECTION: Aggregations/Aggregations; Misc
+ */
+
+/*
+ * A script from Jon Haslam that induced an off-by-one error in the
+ * format lookup code.
+ */
+BEGIN
+{
+ start = timestamp;
+ allocd = 0;
+ numallocs = 0;
+ numfrees = 0;
+ numtids = 0;
+}
+
+syscall:::entry
+{
+ @sys[tid] = sum(tid);
+}
+
+END
+{
+ printf("%s, %s, %s, %d numtids", "hhh", "jjj", "ggg", numtids );
+ printa(@sys);
+}
+
+tick-1sec
+/n++ == 5/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh
new file mode 100644
index 000000000000..30a2ce4175b3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh
@@ -0,0 +1,135 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+CC=/usr/bin/gcc
+CFLAGS=
+
+doit()
+{
+ file=$1
+ ofile=$2
+ errfile=$3
+ cfile=${TMPDIR:-/tmp}/inc.$$.$file.c
+ cofile=${TMPDIR:-/tmp}/inc.$$.$file
+ cat > $cfile <<EOF
+#include <sys/$file>
+void
+main()
+{}
+EOF
+ if $CC $CFLAGS -o $cofile $cfile >/dev/null 2>&1; then
+ $dtrace -xerrtags -C -s /dev/stdin \
+ >/dev/null 2>$errfile <<EOF
+#include <sys/$file>
+BEGIN
+{
+ exit(0);
+}
+EOF
+ if [ $? -ne 0 ]; then
+ echo $inc failed: `cat $errfile | head -1` > $ofile
+ else
+ echo $inc succeeded > $ofile
+ fi
+ rm -f $errfile
+ fi
+
+ rm -f $cofile $cfile 2>/dev/null
+}
+
+if [ ! -x $CC ]; then
+ echo "$0: bad compiler: $CC" >& 2
+ exit 1
+fi
+
+concurrency=`psrinfo | wc -l`
+let concurrency=concurrency*4
+let i=0
+
+files=/usr/include/sys/*.h
+
+#
+# There are a few files in /usr/include/sys that are known to be bad -- usually
+# because they include static globals (!) or function bodies (!!) in the header
+# file. Hopefully these remain sufficiently few that the O(#files * #badfiles)
+# algorithm, below, doesn't become a problem. (And yes, writing scripts in
+# something other than ksh1888 would probably be a good idea.) If this script
+# becomes a problem, kindly fix it by reducing the number of bad files! (That
+# is, fix it by fixing the broken file, not the broken script.)
+#
+badfiles="ctype.h eri_msg.h ser_sync.h sbpro.h neti.h hook_event.h \
+ bootconf.h bootstat.h dtrace.h dumphdr.h exacct_impl.h fasttrap.h \
+ kobj.h kobj_impl.h ksyms.h lockstat.h smedia.h stat.h utsname.h"
+
+for inc in $files; do
+ file=`basename $inc`
+ for bad in $badfiles; do
+ if [ "$file" = "$bad" ]; then
+ continue 2
+ fi
+ done
+
+ ofile=${TMPDIR:-/tmp}/inc.$file.$$.out
+ errfile=${TMPDIR:-/tmp}/inc.$file.$$.err
+ doit $file $ofile $errfile &
+ let i=i+1
+
+ if [ $i -eq $concurrency ]; then
+ #
+ # This isn't optimal -- it creates a highly fluctuating load
+ # as we wait for all work to complete -- but it's an easy
+ # way of parallelizing work.
+ #
+ wait
+ let i=0
+ fi
+done
+
+wait
+
+bigofile=${TMPDIR:-/tmp}/inc.$$.out
+
+for inc in $files; do
+ file=`basename $inc`
+ ofile=${TMPDIR:-/tmp}/inc.$file.$$.out
+
+ if [ -f $ofile ]; then
+ cat $ofile >> $bigofile
+ rm $ofile
+ fi
+done
+
+status=$(grep "failed:" $bigofile | wc -l)
+cat $bigofile
+rm -f $bigofile
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh
new file mode 100644
index 000000000000..a5114f4917e5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh
@@ -0,0 +1,41 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -ln 'syscall::*$1:entry' read | awk '{print $(NF-1),$NF}' | sort
+$dtrace -ln 'syscall::$1*:entry' read | awk '{print $(NF-1),$NF}' | sort
+$dtrace -ln 'syscall::re$1*:entry' ad | awk '{print $(NF-1),$NF}' | sort
+$dtrace -ln 'syscall::$1l*:entry' read | awk '{print $(NF-1),$NF}' | sort
+$dtrace -ln 'syscall::p$1[0-9][0-9]:entry' read | awk '{print $(NF-1),$NF}' | \
+ sort
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out
new file mode 100644
index 000000000000..8a9ac6d96c5a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out
@@ -0,0 +1,15 @@
+FUNCTION NAME
+pread entry
+read entry
+FUNCTION NAME
+read entry
+readlink entry
+readv entry
+FUNCTION NAME
+read entry
+readlink entry
+readv entry
+FUNCTION NAME
+readlink entry
+FUNCTION NAME
+pread64 entry
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.roch.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.roch.d
new file mode 100644
index 000000000000..67f446223462
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.roch.d
@@ -0,0 +1,93 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: test for assertion failure in the ring buffer code
+ *
+ * SECTION: Buffers and Buffering/ring Policy; Misc
+ */
+
+#pragma ident "@(#)tst.roch.d 1.2 03/08/11 SMI"
+
+/*
+ * A script from Roch Bourbonnais that induced an assertion failure in the
+ * ring buffer code.
+ */
+#pragma D option strsize=16
+#pragma D option bufsize=10K
+#pragma D option bufpolicy=ring
+
+fbt:::entry
+/(self->done == 0) && (curthread->t_cpu->cpu_intr_actv == 0) /
+{
+ self->done = 1;
+ printf(" %u 0x%llX %d %d comm:%s csathr:%lld", timestamp,
+ (long long)curthread, pid, tid,
+ execname, (long long)stackdepth);
+ stack(20);
+}
+
+fbt:::return
+/(self->done == 0) && (curthread->t_cpu->cpu_intr_actv == 0) /
+{
+ self->done = 1;
+ printf(" %u 0x%llX %d %d comm:%s csathr:%lld", timestamp,
+ (long long) curthread, pid, tid,
+ execname, (long long) stackdepth);
+ stack(20);
+}
+
+fbt:::entry
+{
+ printf(" %u 0x%llX %d %d ", timestamp,
+ (long long)curthread, pid, tid);
+}
+
+fbt:::return
+{
+ printf(" %u 0x%llX %d %d tag:%d off:%d ", timestamp,
+ (long long)curthread, pid, tid, (int)arg1, (int)arg0);
+}
+
+mutex_enter:adaptive-acquire
+{
+ printf(" %u 0x%llX %d %d lock:0x%llX", timestamp,
+ (long long)curthread, pid, tid, arg0);
+}
+
+mutex_exit:adaptive-release
+{
+ printf(" %u 0x%llX %d %d lock:0x%llX", timestamp,
+ (long long) curthread, pid, tid, arg0);
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh
new file mode 100644
index 000000000000..197bd8dd5f32
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh
@@ -0,0 +1,79 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+#
+# /usr/ccs/bin/nm execs a 64-bit version of itself. DTrace uses libproc
+# (which uses /proc) to find out when the traced process exits, but a
+# 32-bit process can't examine a 64-bit one with libproc. The
+# LD_NOEXEC_64 variable prevents nm from re-execing itself.
+#
+LD_NOEXEC_64=tomeeisrad $dtrace -F -s /dev/stdin -c \
+ '/usr/bin/nm /bin/ls' stat <<EOF
+
+pid\$target::\$1:entry
+{
+ self->start = vtimestamp;
+}
+
+pid\$target:::entry
+/self->start/
+{
+ trace(vtimestamp - self->start);
+}
+
+pid\$target:::return
+/self->start/
+{
+ trace(vtimestamp - self->start);
+}
+
+pid\$target::\$1:return
+/self->start/
+{
+ self->start = 0;
+ exit(0);
+}
+
+syscall:::
+/self->start/
+{
+ trace(vtimestamp - self->start);
+}
+
+fbt:::
+/self->start/
+{
+ trace(vtimestamp - self->start);
+}
+EOF
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGKEY.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGKEY.d
new file mode 100644
index 000000000000..8074e6e37151
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGKEY.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ @foo[123] = sum(123);
+ @bar = sum(456);
+
+ printa("%10d %@10d %@10d\n", @foo, @bar);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGPROTO.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGPROTO.d
new file mode 100644
index 000000000000..dc65947aa397
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGPROTO.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ @foo[123] = sum(123);
+ @bar["fooey"] = sum(456);
+
+ printa("%10d %@10d %@10d\n", @foo, @bar);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.many.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.many.d
new file mode 100644
index 000000000000..00588c66d789
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.many.d
@@ -0,0 +1,311 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option destructive
+#pragma D option quiet
+
+BEGIN
+/0/
+{
+ @agg996[996] = quantize(998);
+ @agg997[997] = count();
+ @agg998[998] = min(998);
+ @agg999[999] = lquantize(0, -10, 10, 1);
+}
+
+BEGIN
+{
+ @agg0[0] = sum(0);
+ @agg1[1] = sum(1);
+ @agg2[2] = sum(2);
+ @agg3[3] = sum(3);
+ @agg4[4] = sum(4);
+ @agg5[5] = sum(5);
+ @agg6[6] = sum(6);
+ @agg7[7] = sum(7);
+ @agg8[8] = sum(8);
+ @agg9[9] = sum(9);
+ @agg10[10] = sum(10);
+ @agg11[11] = sum(11);
+ @agg12[12] = sum(12);
+ @agg13[13] = sum(13);
+ @agg14[14] = sum(14);
+ @agg15[15] = sum(15);
+ @agg16[16] = sum(16);
+ @agg17[17] = sum(17);
+ @agg18[18] = sum(18);
+ @agg19[19] = sum(19);
+ @agg20[20] = sum(20);
+ @agg21[21] = sum(21);
+ @agg22[22] = sum(22);
+ @agg23[23] = sum(23);
+ @agg24[24] = sum(24);
+ @agg25[25] = sum(25);
+ @agg26[26] = sum(26);
+ @agg27[27] = sum(27);
+ @agg28[28] = sum(28);
+ @agg29[29] = sum(29);
+ @agg30[30] = sum(30);
+ @agg31[31] = sum(31);
+ @agg32[32] = sum(32);
+ @agg33[33] = sum(33);
+ @agg34[34] = sum(34);
+ @agg35[35] = sum(35);
+ @agg36[36] = sum(36);
+ @agg37[37] = sum(37);
+ @agg38[38] = sum(38);
+ @agg39[39] = sum(39);
+ @agg40[40] = sum(40);
+ @agg41[41] = sum(41);
+ @agg42[42] = sum(42);
+ @agg43[43] = sum(43);
+ @agg44[44] = sum(44);
+ @agg45[45] = sum(45);
+ @agg46[46] = sum(46);
+ @agg47[47] = sum(47);
+ @agg48[48] = sum(48);
+ @agg49[49] = sum(49);
+ @agg50[50] = sum(50);
+ @agg51[51] = sum(51);
+ @agg52[52] = sum(52);
+ @agg53[53] = sum(53);
+ @agg54[54] = sum(54);
+ @agg55[55] = sum(55);
+ @agg56[56] = sum(56);
+ @agg57[57] = sum(57);
+ @agg58[58] = sum(58);
+ @agg59[59] = sum(59);
+ @agg60[60] = sum(60);
+ @agg61[61] = sum(61);
+ @agg62[62] = sum(62);
+ @agg63[63] = sum(63);
+ @agg64[64] = sum(64);
+ @agg65[65] = sum(65);
+ @agg66[66] = sum(66);
+ @agg67[67] = sum(67);
+ @agg68[68] = sum(68);
+ @agg69[69] = sum(69);
+ @agg70[70] = sum(70);
+ @agg71[71] = sum(71);
+ @agg72[72] = sum(72);
+ @agg73[73] = sum(73);
+ @agg74[74] = sum(74);
+ @agg75[75] = sum(75);
+ @agg76[76] = sum(76);
+ @agg77[77] = sum(77);
+ @agg78[78] = sum(78);
+ @agg79[79] = sum(79);
+ @agg80[80] = sum(80);
+ @agg81[81] = sum(81);
+ @agg82[82] = sum(82);
+ @agg83[83] = sum(83);
+ @agg84[84] = sum(84);
+ @agg85[85] = sum(85);
+ @agg86[86] = sum(86);
+ @agg87[87] = sum(87);
+ @agg88[88] = sum(88);
+ @agg89[89] = sum(89);
+ @agg90[90] = sum(90);
+ @agg91[91] = sum(91);
+ @agg92[92] = sum(92);
+ @agg93[93] = sum(93);
+ @agg94[94] = sum(94);
+ @agg95[95] = sum(95);
+ @agg96[96] = sum(96);
+ @agg97[97] = sum(97);
+ @agg98[98] = sum(98);
+ @agg99[99] = sum(99);
+ @agg100[100] = sum(100);
+ @agg101[101] = sum(101);
+ @agg102[102] = sum(102);
+ @agg103[103] = sum(103);
+ @agg104[104] = sum(104);
+ @agg105[105] = sum(105);
+ @agg106[106] = sum(106);
+ @agg107[107] = sum(107);
+ @agg108[108] = sum(108);
+ @agg109[109] = sum(109);
+ @agg110[110] = sum(110);
+ @agg111[111] = sum(111);
+ @agg112[112] = sum(112);
+ @agg113[113] = sum(113);
+ @agg114[114] = sum(114);
+ @agg115[115] = sum(115);
+ @agg116[116] = sum(116);
+ @agg117[117] = sum(117);
+ @agg118[118] = sum(118);
+ @agg119[119] = sum(119);
+ @agg120[120] = sum(120);
+ @agg121[121] = sum(121);
+ @agg122[122] = sum(122);
+ @agg123[123] = sum(123);
+ @agg124[124] = sum(124);
+ @agg125[125] = sum(125);
+ @agg126[126] = sum(126);
+ @agg127[127] = sum(127);
+ @agg128[128] = sum(128);
+ @agg129[129] = sum(129);
+ @agg130[130] = sum(130);
+ @agg131[131] = sum(131);
+ @agg132[132] = sum(132);
+ @agg133[133] = sum(133);
+ @agg134[134] = sum(134);
+ @agg135[135] = sum(135);
+ @agg136[136] = sum(136);
+ @agg137[137] = sum(137);
+ @agg138[138] = sum(138);
+ @agg139[139] = sum(139);
+ @agg140[140] = sum(140);
+ @agg141[141] = sum(141);
+ @agg142[142] = sum(142);
+ @agg143[143] = sum(143);
+ @agg144[144] = sum(144);
+ @agg145[145] = sum(145);
+ @agg146[146] = sum(146);
+ @agg147[147] = sum(147);
+ @agg148[148] = sum(148);
+ @agg149[149] = sum(149);
+ @agg150[150] = sum(150);
+ @agg151[151] = sum(151);
+ @agg152[152] = sum(152);
+ @agg153[153] = sum(153);
+ @agg154[154] = sum(154);
+ @agg155[155] = sum(155);
+ @agg156[156] = sum(156);
+ @agg157[157] = sum(157);
+ @agg158[158] = sum(158);
+ @agg159[159] = sum(159);
+ @agg160[160] = sum(160);
+ @agg161[161] = sum(161);
+ @agg162[162] = sum(162);
+ @agg163[163] = sum(163);
+ @agg164[164] = sum(164);
+ @agg165[165] = sum(165);
+ @agg166[166] = sum(166);
+ @agg167[167] = sum(167);
+ @agg168[168] = sum(168);
+ @agg169[169] = sum(169);
+ @agg170[170] = sum(170);
+ @agg171[171] = sum(171);
+ @agg172[172] = sum(172);
+ @agg173[173] = sum(173);
+ @agg174[174] = sum(174);
+ @agg175[175] = sum(175);
+ @agg176[176] = sum(176);
+ @agg177[177] = sum(177);
+ @agg178[178] = sum(178);
+ @agg179[179] = sum(179);
+ @agg180[180] = sum(180);
+ @agg181[181] = sum(181);
+ @agg182[182] = sum(182);
+ @agg183[183] = sum(183);
+ @agg184[184] = sum(184);
+ @agg185[185] = sum(185);
+ @agg186[186] = sum(186);
+ @agg187[187] = sum(187);
+ @agg188[188] = sum(188);
+ @agg189[189] = sum(189);
+ @agg190[190] = sum(190);
+ @agg191[191] = sum(191);
+ @agg192[192] = sum(192);
+ @agg193[193] = sum(193);
+ @agg194[194] = sum(194);
+ @agg195[195] = sum(195);
+ @agg196[196] = sum(196);
+ @agg197[197] = sum(197);
+ @agg198[198] = sum(198);
+ @agg199[199] = sum(199);
+ @agg200[200] = sum(200);
+ @agg201[201] = sum(201);
+ @agg202[202] = sum(202);
+ @agg203[203] = sum(203);
+ @agg204[204] = sum(204);
+ @agg205[205] = sum(205);
+ @agg206[206] = sum(206);
+ @agg207[207] = sum(207);
+ @agg208[208] = sum(208);
+ @agg209[209] = sum(209);
+ @agg210[210] = sum(210);
+ @agg211[211] = sum(211);
+ @agg212[212] = sum(212);
+ @agg213[213] = sum(213);
+ @agg214[214] = sum(214);
+ @agg215[215] = sum(215);
+ @agg216[216] = sum(216);
+ @agg217[217] = sum(217);
+ @agg218[218] = sum(218);
+ @agg219[219] = sum(219);
+ @agg220[220] = sum(220);
+ @agg221[221] = sum(221);
+ @agg222[222] = sum(222);
+ @agg223[223] = sum(223);
+ @agg224[224] = sum(224);
+ @agg225[225] = sum(225);
+ @agg226[226] = sum(226);
+ @agg227[227] = sum(227);
+ @agg228[228] = sum(228);
+ @agg229[229] = sum(229);
+ @agg230[230] = sum(230);
+ @agg231[231] = sum(231);
+ @agg232[232] = sum(232);
+ @agg233[233] = sum(233);
+ @agg234[234] = sum(234);
+ @agg235[235] = sum(235);
+ @agg236[236] = sum(236);
+ @agg237[237] = sum(237);
+ @agg238[238] = sum(238);
+ @agg239[239] = sum(239);
+ @agg240[240] = sum(240);
+ @agg241[241] = sum(241);
+ @agg242[242] = sum(242);
+ @agg243[243] = sum(243);
+ @agg244[244] = sum(244);
+ @agg245[245] = sum(245);
+ @agg246[246] = sum(246);
+
+ printa("%8d %8@d %8@d\n", @agg0, @agg1);
+ printf("\n");
+
+ printa("%8d %8@d %8@d\n", @agg0, @agg996);
+ printf("\n");
+
+ printa("%4d %4@d %4@d %4@d %4@d %4@d %4@d %4@d %4@d %4@d %4@d %4@d\n",
+ @agg12, @agg3, @agg73, @agg997,
+ @agg9, @agg9, @agg4, @agg998,
+ @agg11, @agg23, @agg69);
+
+ printf("\n");
+
+ printa("%8d %8@d %8@d\n", @agg245, @agg246);
+ printf("\n");
+
+ printa("%8d %8@d %8@d\n", @agg999, @agg246);
+ printf("\n");
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.many.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.many.d.out
new file mode 100644
index 000000000000..e048d4321e0a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.many.d.out
@@ -0,0 +1,265 @@
+ 0 0 0
+ 1 0 1
+
+ 0 0
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+
+ 69 0 0 0 0 0 0 0 0 0 0 69
+ 23 0 0 0 0 0 0 0 0 0 23 0
+ 11 0 0 0 0 0 0 0 0 11 0 0
+ 4 0 0 0 0 0 0 4 0 0 0 0
+ 9 0 0 0 0 9 9 0 0 0 0 0
+ 73 0 0 73 0 0 0 0 0 0 0 0
+ 3 0 3 0 0 0 0 0 0 0 0 0
+ 12 12 0 0 0 0 0 0 0 0 0 0
+
+ 246 0 246
+ 245 245 0
+
+ 246
+ value ------------- Distribution ------------- count
+ < -10 | 0
+ -10 | 0
+ -9 | 0
+ 246
+
+
+ 2 2
+ 5 5
+ 6 6
+ 7 7
+ 8 8
+ 10 10
+ 13 13
+ 14 14
+ 15 15
+ 16 16
+ 17 17
+ 18 18
+ 19 19
+ 20 20
+ 21 21
+ 22 22
+ 24 24
+ 25 25
+ 26 26
+ 27 27
+ 28 28
+ 29 29
+ 30 30
+ 31 31
+ 32 32
+ 33 33
+ 34 34
+ 35 35
+ 36 36
+ 37 37
+ 38 38
+ 39 39
+ 40 40
+ 41 41
+ 42 42
+ 43 43
+ 44 44
+ 45 45
+ 46 46
+ 47 47
+ 48 48
+ 49 49
+ 50 50
+ 51 51
+ 52 52
+ 53 53
+ 54 54
+ 55 55
+ 56 56
+ 57 57
+ 58 58
+ 59 59
+ 60 60
+ 61 61
+ 62 62
+ 63 63
+ 64 64
+ 65 65
+ 66 66
+ 67 67
+ 68 68
+ 70 70
+ 71 71
+ 72 72
+ 74 74
+ 75 75
+ 76 76
+ 77 77
+ 78 78
+ 79 79
+ 80 80
+ 81 81
+ 82 82
+ 83 83
+ 84 84
+ 85 85
+ 86 86
+ 87 87
+ 88 88
+ 89 89
+ 90 90
+ 91 91
+ 92 92
+ 93 93
+ 94 94
+ 95 95
+ 96 96
+ 97 97
+ 98 98
+ 99 99
+ 100 100
+ 101 101
+ 102 102
+ 103 103
+ 104 104
+ 105 105
+ 106 106
+ 107 107
+ 108 108
+ 109 109
+ 110 110
+ 111 111
+ 112 112
+ 113 113
+ 114 114
+ 115 115
+ 116 116
+ 117 117
+ 118 118
+ 119 119
+ 120 120
+ 121 121
+ 122 122
+ 123 123
+ 124 124
+ 125 125
+ 126 126
+ 127 127
+ 128 128
+ 129 129
+ 130 130
+ 131 131
+ 132 132
+ 133 133
+ 134 134
+ 135 135
+ 136 136
+ 137 137
+ 138 138
+ 139 139
+ 140 140
+ 141 141
+ 142 142
+ 143 143
+ 144 144
+ 145 145
+ 146 146
+ 147 147
+ 148 148
+ 149 149
+ 150 150
+ 151 151
+ 152 152
+ 153 153
+ 154 154
+ 155 155
+ 156 156
+ 157 157
+ 158 158
+ 159 159
+ 160 160
+ 161 161
+ 162 162
+ 163 163
+ 164 164
+ 165 165
+ 166 166
+ 167 167
+ 168 168
+ 169 169
+ 170 170
+ 171 171
+ 172 172
+ 173 173
+ 174 174
+ 175 175
+ 176 176
+ 177 177
+ 178 178
+ 179 179
+ 180 180
+ 181 181
+ 182 182
+ 183 183
+ 184 184
+ 185 185
+ 186 186
+ 187 187
+ 188 188
+ 189 189
+ 190 190
+ 191 191
+ 192 192
+ 193 193
+ 194 194
+ 195 195
+ 196 196
+ 197 197
+ 198 198
+ 199 199
+ 200 200
+ 201 201
+ 202 202
+ 203 203
+ 204 204
+ 205 205
+ 206 206
+ 207 207
+ 208 208
+ 209 209
+ 210 210
+ 211 211
+ 212 212
+ 213 213
+ 214 214
+ 215 215
+ 216 216
+ 217 217
+ 218 218
+ 219 219
+ 220 220
+ 221 221
+ 222 222
+ 223 223
+ 224 224
+ 225 225
+ 226 226
+ 227 227
+ 228 228
+ 229 229
+ 230 230
+ 231 231
+ 232 232
+ 233 233
+ 234 234
+ 235 235
+ 236 236
+ 237 237
+ 238 238
+ 239 239
+ 240 240
+ 241 241
+ 242 242
+ 243 243
+ 244 244
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.same.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.same.d
new file mode 100644
index 000000000000..0e675579e53d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.same.d
@@ -0,0 +1,37 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ @ = sum(90904);
+ printa("%@d %@d %@d\n", @, @, @);
+ printa("%@d %@d %@d\n", @);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.same.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.same.d.out
new file mode 100644
index 000000000000..b382c35a3cae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.same.d.out
@@ -0,0 +1,3 @@
+90904 90904 90904
+90904 90904 90904
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d
new file mode 100644
index 000000000000..7bfd9e5781d6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+tick-1ms
+{
+ i++;
+ @a[i] = sum(100 - (i / 2));
+ @b[i] = sum(100 - (i / 4));
+ @c[i] = sum(100 - (i / 8));
+ @d[i] = sum(100 - (i / 16));
+}
+
+tick-1ms
+/i == 100/
+{
+ printa("%10d %@10d %@10d %@10d %@10d\n", @a, @b, @c, @d);
+ printa("%10d %@10d %@10d %@10d %@10d\n", @d, @c, @b, @a);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d.out
new file mode 100644
index 000000000000..8c79190f10fc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d.out
@@ -0,0 +1,201 @@
+ 100 50 75 88 94
+ 98 51 76 88 94
+ 99 51 76 88 94
+ 96 52 76 88 94
+ 97 52 76 88 94
+ 94 53 77 89 95
+ 95 53 77 89 95
+ 92 54 77 89 95
+ 93 54 77 89 95
+ 90 55 78 89 95
+ 91 55 78 89 95
+ 88 56 78 89 95
+ 89 56 78 89 95
+ 86 57 79 90 95
+ 87 57 79 90 95
+ 84 58 79 90 95
+ 85 58 79 90 95
+ 82 59 80 90 95
+ 83 59 80 90 95
+ 80 60 80 90 95
+ 81 60 80 90 95
+ 78 61 81 91 96
+ 79 61 81 91 96
+ 76 62 81 91 96
+ 77 62 81 91 96
+ 74 63 82 91 96
+ 75 63 82 91 96
+ 72 64 82 91 96
+ 73 64 82 91 96
+ 70 65 83 92 96
+ 71 65 83 92 96
+ 68 66 83 92 96
+ 69 66 83 92 96
+ 66 67 84 92 96
+ 67 67 84 92 96
+ 64 68 84 92 96
+ 65 68 84 92 96
+ 62 69 85 93 97
+ 63 69 85 93 97
+ 60 70 85 93 97
+ 61 70 85 93 97
+ 58 71 86 93 97
+ 59 71 86 93 97
+ 56 72 86 93 97
+ 57 72 86 93 97
+ 54 73 87 94 97
+ 55 73 87 94 97
+ 52 74 87 94 97
+ 53 74 87 94 97
+ 50 75 88 94 97
+ 51 75 88 94 97
+ 48 76 88 94 97
+ 49 76 88 94 97
+ 46 77 89 95 98
+ 47 77 89 95 98
+ 44 78 89 95 98
+ 45 78 89 95 98
+ 42 79 90 95 98
+ 43 79 90 95 98
+ 40 80 90 95 98
+ 41 80 90 95 98
+ 38 81 91 96 98
+ 39 81 91 96 98
+ 36 82 91 96 98
+ 37 82 91 96 98
+ 34 83 92 96 98
+ 35 83 92 96 98
+ 32 84 92 96 98
+ 33 84 92 96 98
+ 30 85 93 97 99
+ 31 85 93 97 99
+ 28 86 93 97 99
+ 29 86 93 97 99
+ 26 87 94 97 99
+ 27 87 94 97 99
+ 24 88 94 97 99
+ 25 88 94 97 99
+ 22 89 95 98 99
+ 23 89 95 98 99
+ 20 90 95 98 99
+ 21 90 95 98 99
+ 18 91 96 98 99
+ 19 91 96 98 99
+ 16 92 96 98 99
+ 17 92 96 98 99
+ 14 93 97 99 100
+ 15 93 97 99 100
+ 12 94 97 99 100
+ 13 94 97 99 100
+ 10 95 98 99 100
+ 11 95 98 99 100
+ 8 96 98 99 100
+ 9 96 98 99 100
+ 6 97 99 100 100
+ 7 97 99 100 100
+ 4 98 99 100 100
+ 5 98 99 100 100
+ 2 99 100 100 100
+ 3 99 100 100 100
+ 1 100 100 100 100
+ 100 94 88 75 50
+ 98 94 88 76 51
+ 99 94 88 76 51
+ 96 94 88 76 52
+ 97 94 88 76 52
+ 94 95 89 77 53
+ 95 95 89 77 53
+ 92 95 89 77 54
+ 93 95 89 77 54
+ 90 95 89 78 55
+ 91 95 89 78 55
+ 88 95 89 78 56
+ 89 95 89 78 56
+ 86 95 90 79 57
+ 87 95 90 79 57
+ 84 95 90 79 58
+ 85 95 90 79 58
+ 82 95 90 80 59
+ 83 95 90 80 59
+ 80 95 90 80 60
+ 81 95 90 80 60
+ 78 96 91 81 61
+ 79 96 91 81 61
+ 76 96 91 81 62
+ 77 96 91 81 62
+ 74 96 91 82 63
+ 75 96 91 82 63
+ 72 96 91 82 64
+ 73 96 91 82 64
+ 70 96 92 83 65
+ 71 96 92 83 65
+ 68 96 92 83 66
+ 69 96 92 83 66
+ 66 96 92 84 67
+ 67 96 92 84 67
+ 64 96 92 84 68
+ 65 96 92 84 68
+ 62 97 93 85 69
+ 63 97 93 85 69
+ 60 97 93 85 70
+ 61 97 93 85 70
+ 58 97 93 86 71
+ 59 97 93 86 71
+ 56 97 93 86 72
+ 57 97 93 86 72
+ 54 97 94 87 73
+ 55 97 94 87 73
+ 52 97 94 87 74
+ 53 97 94 87 74
+ 50 97 94 88 75
+ 51 97 94 88 75
+ 48 97 94 88 76
+ 49 97 94 88 76
+ 46 98 95 89 77
+ 47 98 95 89 77
+ 44 98 95 89 78
+ 45 98 95 89 78
+ 42 98 95 90 79
+ 43 98 95 90 79
+ 40 98 95 90 80
+ 41 98 95 90 80
+ 38 98 96 91 81
+ 39 98 96 91 81
+ 36 98 96 91 82
+ 37 98 96 91 82
+ 34 98 96 92 83
+ 35 98 96 92 83
+ 32 98 96 92 84
+ 33 98 96 92 84
+ 30 99 97 93 85
+ 31 99 97 93 85
+ 28 99 97 93 86
+ 29 99 97 93 86
+ 26 99 97 94 87
+ 27 99 97 94 87
+ 24 99 97 94 88
+ 25 99 97 94 88
+ 22 99 98 95 89
+ 23 99 98 95 89
+ 20 99 98 95 90
+ 21 99 98 95 90
+ 18 99 98 96 91
+ 19 99 98 96 91
+ 16 99 98 96 92
+ 17 99 98 96 92
+ 14 100 99 97 93
+ 15 100 99 97 93
+ 12 100 99 97 94
+ 13 100 99 97 94
+ 10 100 99 98 95
+ 11 100 99 98 95
+ 8 100 99 98 96
+ 9 100 99 98 96
+ 6 100 100 99 97
+ 7 100 100 99 97
+ 4 100 100 99 98
+ 5 100 100 99 98
+ 2 100 100 100 99
+ 3 100 100 100 99
+ 1 100 100 100 100
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d
new file mode 100644
index 000000000000..ddb297f9ce18
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ j = 0;
+}
+
+tick-1ms
+/i < 100/
+{
+ i++;
+ @a[i] = sum(i);
+ @b[i] = sum((25 + i) % 100);
+ @c[i] = sum((50 + i) % 100);
+ @d[i] = sum((75 + i) % 100);
+}
+
+tick-1ms
+/i == 100 && j < 10/
+{
+ printf("Sorted at position %d:\n", j);
+ setopt("aggsortpos", lltostr(j));
+ printa("%9d %@9d %@9d %@9d %@9d %@9d %@9d\n", @a, @b, @c, @a, @d, @a);
+ printf("\n");
+ j++;
+}
+
+tick-1ms
+/i == 100 && j == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d.out
new file mode 100644
index 000000000000..ce175391fc14
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d.out
@@ -0,0 +1,1021 @@
+Sorted at position 0:
+ 1 1 26 51 1 76 1
+ 2 2 27 52 2 77 2
+ 3 3 28 53 3 78 3
+ 4 4 29 54 4 79 4
+ 5 5 30 55 5 80 5
+ 6 6 31 56 6 81 6
+ 7 7 32 57 7 82 7
+ 8 8 33 58 8 83 8
+ 9 9 34 59 9 84 9
+ 10 10 35 60 10 85 10
+ 11 11 36 61 11 86 11
+ 12 12 37 62 12 87 12
+ 13 13 38 63 13 88 13
+ 14 14 39 64 14 89 14
+ 15 15 40 65 15 90 15
+ 16 16 41 66 16 91 16
+ 17 17 42 67 17 92 17
+ 18 18 43 68 18 93 18
+ 19 19 44 69 19 94 19
+ 20 20 45 70 20 95 20
+ 21 21 46 71 21 96 21
+ 22 22 47 72 22 97 22
+ 23 23 48 73 23 98 23
+ 24 24 49 74 24 99 24
+ 25 25 50 75 25 0 25
+ 26 26 51 76 26 1 26
+ 27 27 52 77 27 2 27
+ 28 28 53 78 28 3 28
+ 29 29 54 79 29 4 29
+ 30 30 55 80 30 5 30
+ 31 31 56 81 31 6 31
+ 32 32 57 82 32 7 32
+ 33 33 58 83 33 8 33
+ 34 34 59 84 34 9 34
+ 35 35 60 85 35 10 35
+ 36 36 61 86 36 11 36
+ 37 37 62 87 37 12 37
+ 38 38 63 88 38 13 38
+ 39 39 64 89 39 14 39
+ 40 40 65 90 40 15 40
+ 41 41 66 91 41 16 41
+ 42 42 67 92 42 17 42
+ 43 43 68 93 43 18 43
+ 44 44 69 94 44 19 44
+ 45 45 70 95 45 20 45
+ 46 46 71 96 46 21 46
+ 47 47 72 97 47 22 47
+ 48 48 73 98 48 23 48
+ 49 49 74 99 49 24 49
+ 50 50 75 0 50 25 50
+ 51 51 76 1 51 26 51
+ 52 52 77 2 52 27 52
+ 53 53 78 3 53 28 53
+ 54 54 79 4 54 29 54
+ 55 55 80 5 55 30 55
+ 56 56 81 6 56 31 56
+ 57 57 82 7 57 32 57
+ 58 58 83 8 58 33 58
+ 59 59 84 9 59 34 59
+ 60 60 85 10 60 35 60
+ 61 61 86 11 61 36 61
+ 62 62 87 12 62 37 62
+ 63 63 88 13 63 38 63
+ 64 64 89 14 64 39 64
+ 65 65 90 15 65 40 65
+ 66 66 91 16 66 41 66
+ 67 67 92 17 67 42 67
+ 68 68 93 18 68 43 68
+ 69 69 94 19 69 44 69
+ 70 70 95 20 70 45 70
+ 71 71 96 21 71 46 71
+ 72 72 97 22 72 47 72
+ 73 73 98 23 73 48 73
+ 74 74 99 24 74 49 74
+ 75 75 0 25 75 50 75
+ 76 76 1 26 76 51 76
+ 77 77 2 27 77 52 77
+ 78 78 3 28 78 53 78
+ 79 79 4 29 79 54 79
+ 80 80 5 30 80 55 80
+ 81 81 6 31 81 56 81
+ 82 82 7 32 82 57 82
+ 83 83 8 33 83 58 83
+ 84 84 9 34 84 59 84
+ 85 85 10 35 85 60 85
+ 86 86 11 36 86 61 86
+ 87 87 12 37 87 62 87
+ 88 88 13 38 88 63 88
+ 89 89 14 39 89 64 89
+ 90 90 15 40 90 65 90
+ 91 91 16 41 91 66 91
+ 92 92 17 42 92 67 92
+ 93 93 18 43 93 68 93
+ 94 94 19 44 94 69 94
+ 95 95 20 45 95 70 95
+ 96 96 21 46 96 71 96
+ 97 97 22 47 97 72 97
+ 98 98 23 48 98 73 98
+ 99 99 24 49 99 74 99
+ 100 100 25 50 100 75 100
+
+Sorted at position 1:
+ 75 75 0 25 75 50 75
+ 76 76 1 26 76 51 76
+ 77 77 2 27 77 52 77
+ 78 78 3 28 78 53 78
+ 79 79 4 29 79 54 79
+ 80 80 5 30 80 55 80
+ 81 81 6 31 81 56 81
+ 82 82 7 32 82 57 82
+ 83 83 8 33 83 58 83
+ 84 84 9 34 84 59 84
+ 85 85 10 35 85 60 85
+ 86 86 11 36 86 61 86
+ 87 87 12 37 87 62 87
+ 88 88 13 38 88 63 88
+ 89 89 14 39 89 64 89
+ 90 90 15 40 90 65 90
+ 91 91 16 41 91 66 91
+ 92 92 17 42 92 67 92
+ 93 93 18 43 93 68 93
+ 94 94 19 44 94 69 94
+ 95 95 20 45 95 70 95
+ 96 96 21 46 96 71 96
+ 97 97 22 47 97 72 97
+ 98 98 23 48 98 73 98
+ 99 99 24 49 99 74 99
+ 100 100 25 50 100 75 100
+ 1 1 26 51 1 76 1
+ 2 2 27 52 2 77 2
+ 3 3 28 53 3 78 3
+ 4 4 29 54 4 79 4
+ 5 5 30 55 5 80 5
+ 6 6 31 56 6 81 6
+ 7 7 32 57 7 82 7
+ 8 8 33 58 8 83 8
+ 9 9 34 59 9 84 9
+ 10 10 35 60 10 85 10
+ 11 11 36 61 11 86 11
+ 12 12 37 62 12 87 12
+ 13 13 38 63 13 88 13
+ 14 14 39 64 14 89 14
+ 15 15 40 65 15 90 15
+ 16 16 41 66 16 91 16
+ 17 17 42 67 17 92 17
+ 18 18 43 68 18 93 18
+ 19 19 44 69 19 94 19
+ 20 20 45 70 20 95 20
+ 21 21 46 71 21 96 21
+ 22 22 47 72 22 97 22
+ 23 23 48 73 23 98 23
+ 24 24 49 74 24 99 24
+ 25 25 50 75 25 0 25
+ 26 26 51 76 26 1 26
+ 27 27 52 77 27 2 27
+ 28 28 53 78 28 3 28
+ 29 29 54 79 29 4 29
+ 30 30 55 80 30 5 30
+ 31 31 56 81 31 6 31
+ 32 32 57 82 32 7 32
+ 33 33 58 83 33 8 33
+ 34 34 59 84 34 9 34
+ 35 35 60 85 35 10 35
+ 36 36 61 86 36 11 36
+ 37 37 62 87 37 12 37
+ 38 38 63 88 38 13 38
+ 39 39 64 89 39 14 39
+ 40 40 65 90 40 15 40
+ 41 41 66 91 41 16 41
+ 42 42 67 92 42 17 42
+ 43 43 68 93 43 18 43
+ 44 44 69 94 44 19 44
+ 45 45 70 95 45 20 45
+ 46 46 71 96 46 21 46
+ 47 47 72 97 47 22 47
+ 48 48 73 98 48 23 48
+ 49 49 74 99 49 24 49
+ 50 50 75 0 50 25 50
+ 51 51 76 1 51 26 51
+ 52 52 77 2 52 27 52
+ 53 53 78 3 53 28 53
+ 54 54 79 4 54 29 54
+ 55 55 80 5 55 30 55
+ 56 56 81 6 56 31 56
+ 57 57 82 7 57 32 57
+ 58 58 83 8 58 33 58
+ 59 59 84 9 59 34 59
+ 60 60 85 10 60 35 60
+ 61 61 86 11 61 36 61
+ 62 62 87 12 62 37 62
+ 63 63 88 13 63 38 63
+ 64 64 89 14 64 39 64
+ 65 65 90 15 65 40 65
+ 66 66 91 16 66 41 66
+ 67 67 92 17 67 42 67
+ 68 68 93 18 68 43 68
+ 69 69 94 19 69 44 69
+ 70 70 95 20 70 45 70
+ 71 71 96 21 71 46 71
+ 72 72 97 22 72 47 72
+ 73 73 98 23 73 48 73
+ 74 74 99 24 74 49 74
+
+Sorted at position 2:
+ 50 50 75 0 50 25 50
+ 51 51 76 1 51 26 51
+ 52 52 77 2 52 27 52
+ 53 53 78 3 53 28 53
+ 54 54 79 4 54 29 54
+ 55 55 80 5 55 30 55
+ 56 56 81 6 56 31 56
+ 57 57 82 7 57 32 57
+ 58 58 83 8 58 33 58
+ 59 59 84 9 59 34 59
+ 60 60 85 10 60 35 60
+ 61 61 86 11 61 36 61
+ 62 62 87 12 62 37 62
+ 63 63 88 13 63 38 63
+ 64 64 89 14 64 39 64
+ 65 65 90 15 65 40 65
+ 66 66 91 16 66 41 66
+ 67 67 92 17 67 42 67
+ 68 68 93 18 68 43 68
+ 69 69 94 19 69 44 69
+ 70 70 95 20 70 45 70
+ 71 71 96 21 71 46 71
+ 72 72 97 22 72 47 72
+ 73 73 98 23 73 48 73
+ 74 74 99 24 74 49 74
+ 75 75 0 25 75 50 75
+ 76 76 1 26 76 51 76
+ 77 77 2 27 77 52 77
+ 78 78 3 28 78 53 78
+ 79 79 4 29 79 54 79
+ 80 80 5 30 80 55 80
+ 81 81 6 31 81 56 81
+ 82 82 7 32 82 57 82
+ 83 83 8 33 83 58 83
+ 84 84 9 34 84 59 84
+ 85 85 10 35 85 60 85
+ 86 86 11 36 86 61 86
+ 87 87 12 37 87 62 87
+ 88 88 13 38 88 63 88
+ 89 89 14 39 89 64 89
+ 90 90 15 40 90 65 90
+ 91 91 16 41 91 66 91
+ 92 92 17 42 92 67 92
+ 93 93 18 43 93 68 93
+ 94 94 19 44 94 69 94
+ 95 95 20 45 95 70 95
+ 96 96 21 46 96 71 96
+ 97 97 22 47 97 72 97
+ 98 98 23 48 98 73 98
+ 99 99 24 49 99 74 99
+ 100 100 25 50 100 75 100
+ 1 1 26 51 1 76 1
+ 2 2 27 52 2 77 2
+ 3 3 28 53 3 78 3
+ 4 4 29 54 4 79 4
+ 5 5 30 55 5 80 5
+ 6 6 31 56 6 81 6
+ 7 7 32 57 7 82 7
+ 8 8 33 58 8 83 8
+ 9 9 34 59 9 84 9
+ 10 10 35 60 10 85 10
+ 11 11 36 61 11 86 11
+ 12 12 37 62 12 87 12
+ 13 13 38 63 13 88 13
+ 14 14 39 64 14 89 14
+ 15 15 40 65 15 90 15
+ 16 16 41 66 16 91 16
+ 17 17 42 67 17 92 17
+ 18 18 43 68 18 93 18
+ 19 19 44 69 19 94 19
+ 20 20 45 70 20 95 20
+ 21 21 46 71 21 96 21
+ 22 22 47 72 22 97 22
+ 23 23 48 73 23 98 23
+ 24 24 49 74 24 99 24
+ 25 25 50 75 25 0 25
+ 26 26 51 76 26 1 26
+ 27 27 52 77 27 2 27
+ 28 28 53 78 28 3 28
+ 29 29 54 79 29 4 29
+ 30 30 55 80 30 5 30
+ 31 31 56 81 31 6 31
+ 32 32 57 82 32 7 32
+ 33 33 58 83 33 8 33
+ 34 34 59 84 34 9 34
+ 35 35 60 85 35 10 35
+ 36 36 61 86 36 11 36
+ 37 37 62 87 37 12 37
+ 38 38 63 88 38 13 38
+ 39 39 64 89 39 14 39
+ 40 40 65 90 40 15 40
+ 41 41 66 91 41 16 41
+ 42 42 67 92 42 17 42
+ 43 43 68 93 43 18 43
+ 44 44 69 94 44 19 44
+ 45 45 70 95 45 20 45
+ 46 46 71 96 46 21 46
+ 47 47 72 97 47 22 47
+ 48 48 73 98 48 23 48
+ 49 49 74 99 49 24 49
+
+Sorted at position 3:
+ 1 1 26 51 1 76 1
+ 2 2 27 52 2 77 2
+ 3 3 28 53 3 78 3
+ 4 4 29 54 4 79 4
+ 5 5 30 55 5 80 5
+ 6 6 31 56 6 81 6
+ 7 7 32 57 7 82 7
+ 8 8 33 58 8 83 8
+ 9 9 34 59 9 84 9
+ 10 10 35 60 10 85 10
+ 11 11 36 61 11 86 11
+ 12 12 37 62 12 87 12
+ 13 13 38 63 13 88 13
+ 14 14 39 64 14 89 14
+ 15 15 40 65 15 90 15
+ 16 16 41 66 16 91 16
+ 17 17 42 67 17 92 17
+ 18 18 43 68 18 93 18
+ 19 19 44 69 19 94 19
+ 20 20 45 70 20 95 20
+ 21 21 46 71 21 96 21
+ 22 22 47 72 22 97 22
+ 23 23 48 73 23 98 23
+ 24 24 49 74 24 99 24
+ 25 25 50 75 25 0 25
+ 26 26 51 76 26 1 26
+ 27 27 52 77 27 2 27
+ 28 28 53 78 28 3 28
+ 29 29 54 79 29 4 29
+ 30 30 55 80 30 5 30
+ 31 31 56 81 31 6 31
+ 32 32 57 82 32 7 32
+ 33 33 58 83 33 8 33
+ 34 34 59 84 34 9 34
+ 35 35 60 85 35 10 35
+ 36 36 61 86 36 11 36
+ 37 37 62 87 37 12 37
+ 38 38 63 88 38 13 38
+ 39 39 64 89 39 14 39
+ 40 40 65 90 40 15 40
+ 41 41 66 91 41 16 41
+ 42 42 67 92 42 17 42
+ 43 43 68 93 43 18 43
+ 44 44 69 94 44 19 44
+ 45 45 70 95 45 20 45
+ 46 46 71 96 46 21 46
+ 47 47 72 97 47 22 47
+ 48 48 73 98 48 23 48
+ 49 49 74 99 49 24 49
+ 50 50 75 0 50 25 50
+ 51 51 76 1 51 26 51
+ 52 52 77 2 52 27 52
+ 53 53 78 3 53 28 53
+ 54 54 79 4 54 29 54
+ 55 55 80 5 55 30 55
+ 56 56 81 6 56 31 56
+ 57 57 82 7 57 32 57
+ 58 58 83 8 58 33 58
+ 59 59 84 9 59 34 59
+ 60 60 85 10 60 35 60
+ 61 61 86 11 61 36 61
+ 62 62 87 12 62 37 62
+ 63 63 88 13 63 38 63
+ 64 64 89 14 64 39 64
+ 65 65 90 15 65 40 65
+ 66 66 91 16 66 41 66
+ 67 67 92 17 67 42 67
+ 68 68 93 18 68 43 68
+ 69 69 94 19 69 44 69
+ 70 70 95 20 70 45 70
+ 71 71 96 21 71 46 71
+ 72 72 97 22 72 47 72
+ 73 73 98 23 73 48 73
+ 74 74 99 24 74 49 74
+ 75 75 0 25 75 50 75
+ 76 76 1 26 76 51 76
+ 77 77 2 27 77 52 77
+ 78 78 3 28 78 53 78
+ 79 79 4 29 79 54 79
+ 80 80 5 30 80 55 80
+ 81 81 6 31 81 56 81
+ 82 82 7 32 82 57 82
+ 83 83 8 33 83 58 83
+ 84 84 9 34 84 59 84
+ 85 85 10 35 85 60 85
+ 86 86 11 36 86 61 86
+ 87 87 12 37 87 62 87
+ 88 88 13 38 88 63 88
+ 89 89 14 39 89 64 89
+ 90 90 15 40 90 65 90
+ 91 91 16 41 91 66 91
+ 92 92 17 42 92 67 92
+ 93 93 18 43 93 68 93
+ 94 94 19 44 94 69 94
+ 95 95 20 45 95 70 95
+ 96 96 21 46 96 71 96
+ 97 97 22 47 97 72 97
+ 98 98 23 48 98 73 98
+ 99 99 24 49 99 74 99
+ 100 100 25 50 100 75 100
+
+Sorted at position 4:
+ 25 25 50 75 25 0 25
+ 26 26 51 76 26 1 26
+ 27 27 52 77 27 2 27
+ 28 28 53 78 28 3 28
+ 29 29 54 79 29 4 29
+ 30 30 55 80 30 5 30
+ 31 31 56 81 31 6 31
+ 32 32 57 82 32 7 32
+ 33 33 58 83 33 8 33
+ 34 34 59 84 34 9 34
+ 35 35 60 85 35 10 35
+ 36 36 61 86 36 11 36
+ 37 37 62 87 37 12 37
+ 38 38 63 88 38 13 38
+ 39 39 64 89 39 14 39
+ 40 40 65 90 40 15 40
+ 41 41 66 91 41 16 41
+ 42 42 67 92 42 17 42
+ 43 43 68 93 43 18 43
+ 44 44 69 94 44 19 44
+ 45 45 70 95 45 20 45
+ 46 46 71 96 46 21 46
+ 47 47 72 97 47 22 47
+ 48 48 73 98 48 23 48
+ 49 49 74 99 49 24 49
+ 50 50 75 0 50 25 50
+ 51 51 76 1 51 26 51
+ 52 52 77 2 52 27 52
+ 53 53 78 3 53 28 53
+ 54 54 79 4 54 29 54
+ 55 55 80 5 55 30 55
+ 56 56 81 6 56 31 56
+ 57 57 82 7 57 32 57
+ 58 58 83 8 58 33 58
+ 59 59 84 9 59 34 59
+ 60 60 85 10 60 35 60
+ 61 61 86 11 61 36 61
+ 62 62 87 12 62 37 62
+ 63 63 88 13 63 38 63
+ 64 64 89 14 64 39 64
+ 65 65 90 15 65 40 65
+ 66 66 91 16 66 41 66
+ 67 67 92 17 67 42 67
+ 68 68 93 18 68 43 68
+ 69 69 94 19 69 44 69
+ 70 70 95 20 70 45 70
+ 71 71 96 21 71 46 71
+ 72 72 97 22 72 47 72
+ 73 73 98 23 73 48 73
+ 74 74 99 24 74 49 74
+ 75 75 0 25 75 50 75
+ 76 76 1 26 76 51 76
+ 77 77 2 27 77 52 77
+ 78 78 3 28 78 53 78
+ 79 79 4 29 79 54 79
+ 80 80 5 30 80 55 80
+ 81 81 6 31 81 56 81
+ 82 82 7 32 82 57 82
+ 83 83 8 33 83 58 83
+ 84 84 9 34 84 59 84
+ 85 85 10 35 85 60 85
+ 86 86 11 36 86 61 86
+ 87 87 12 37 87 62 87
+ 88 88 13 38 88 63 88
+ 89 89 14 39 89 64 89
+ 90 90 15 40 90 65 90
+ 91 91 16 41 91 66 91
+ 92 92 17 42 92 67 92
+ 93 93 18 43 93 68 93
+ 94 94 19 44 94 69 94
+ 95 95 20 45 95 70 95
+ 96 96 21 46 96 71 96
+ 97 97 22 47 97 72 97
+ 98 98 23 48 98 73 98
+ 99 99 24 49 99 74 99
+ 100 100 25 50 100 75 100
+ 1 1 26 51 1 76 1
+ 2 2 27 52 2 77 2
+ 3 3 28 53 3 78 3
+ 4 4 29 54 4 79 4
+ 5 5 30 55 5 80 5
+ 6 6 31 56 6 81 6
+ 7 7 32 57 7 82 7
+ 8 8 33 58 8 83 8
+ 9 9 34 59 9 84 9
+ 10 10 35 60 10 85 10
+ 11 11 36 61 11 86 11
+ 12 12 37 62 12 87 12
+ 13 13 38 63 13 88 13
+ 14 14 39 64 14 89 14
+ 15 15 40 65 15 90 15
+ 16 16 41 66 16 91 16
+ 17 17 42 67 17 92 17
+ 18 18 43 68 18 93 18
+ 19 19 44 69 19 94 19
+ 20 20 45 70 20 95 20
+ 21 21 46 71 21 96 21
+ 22 22 47 72 22 97 22
+ 23 23 48 73 23 98 23
+ 24 24 49 74 24 99 24
+
+Sorted at position 5:
+ 1 1 26 51 1 76 1
+ 2 2 27 52 2 77 2
+ 3 3 28 53 3 78 3
+ 4 4 29 54 4 79 4
+ 5 5 30 55 5 80 5
+ 6 6 31 56 6 81 6
+ 7 7 32 57 7 82 7
+ 8 8 33 58 8 83 8
+ 9 9 34 59 9 84 9
+ 10 10 35 60 10 85 10
+ 11 11 36 61 11 86 11
+ 12 12 37 62 12 87 12
+ 13 13 38 63 13 88 13
+ 14 14 39 64 14 89 14
+ 15 15 40 65 15 90 15
+ 16 16 41 66 16 91 16
+ 17 17 42 67 17 92 17
+ 18 18 43 68 18 93 18
+ 19 19 44 69 19 94 19
+ 20 20 45 70 20 95 20
+ 21 21 46 71 21 96 21
+ 22 22 47 72 22 97 22
+ 23 23 48 73 23 98 23
+ 24 24 49 74 24 99 24
+ 25 25 50 75 25 0 25
+ 26 26 51 76 26 1 26
+ 27 27 52 77 27 2 27
+ 28 28 53 78 28 3 28
+ 29 29 54 79 29 4 29
+ 30 30 55 80 30 5 30
+ 31 31 56 81 31 6 31
+ 32 32 57 82 32 7 32
+ 33 33 58 83 33 8 33
+ 34 34 59 84 34 9 34
+ 35 35 60 85 35 10 35
+ 36 36 61 86 36 11 36
+ 37 37 62 87 37 12 37
+ 38 38 63 88 38 13 38
+ 39 39 64 89 39 14 39
+ 40 40 65 90 40 15 40
+ 41 41 66 91 41 16 41
+ 42 42 67 92 42 17 42
+ 43 43 68 93 43 18 43
+ 44 44 69 94 44 19 44
+ 45 45 70 95 45 20 45
+ 46 46 71 96 46 21 46
+ 47 47 72 97 47 22 47
+ 48 48 73 98 48 23 48
+ 49 49 74 99 49 24 49
+ 50 50 75 0 50 25 50
+ 51 51 76 1 51 26 51
+ 52 52 77 2 52 27 52
+ 53 53 78 3 53 28 53
+ 54 54 79 4 54 29 54
+ 55 55 80 5 55 30 55
+ 56 56 81 6 56 31 56
+ 57 57 82 7 57 32 57
+ 58 58 83 8 58 33 58
+ 59 59 84 9 59 34 59
+ 60 60 85 10 60 35 60
+ 61 61 86 11 61 36 61
+ 62 62 87 12 62 37 62
+ 63 63 88 13 63 38 63
+ 64 64 89 14 64 39 64
+ 65 65 90 15 65 40 65
+ 66 66 91 16 66 41 66
+ 67 67 92 17 67 42 67
+ 68 68 93 18 68 43 68
+ 69 69 94 19 69 44 69
+ 70 70 95 20 70 45 70
+ 71 71 96 21 71 46 71
+ 72 72 97 22 72 47 72
+ 73 73 98 23 73 48 73
+ 74 74 99 24 74 49 74
+ 75 75 0 25 75 50 75
+ 76 76 1 26 76 51 76
+ 77 77 2 27 77 52 77
+ 78 78 3 28 78 53 78
+ 79 79 4 29 79 54 79
+ 80 80 5 30 80 55 80
+ 81 81 6 31 81 56 81
+ 82 82 7 32 82 57 82
+ 83 83 8 33 83 58 83
+ 84 84 9 34 84 59 84
+ 85 85 10 35 85 60 85
+ 86 86 11 36 86 61 86
+ 87 87 12 37 87 62 87
+ 88 88 13 38 88 63 88
+ 89 89 14 39 89 64 89
+ 90 90 15 40 90 65 90
+ 91 91 16 41 91 66 91
+ 92 92 17 42 92 67 92
+ 93 93 18 43 93 68 93
+ 94 94 19 44 94 69 94
+ 95 95 20 45 95 70 95
+ 96 96 21 46 96 71 96
+ 97 97 22 47 97 72 97
+ 98 98 23 48 98 73 98
+ 99 99 24 49 99 74 99
+ 100 100 25 50 100 75 100
+
+Sorted at position 6:
+ 1 1 26 51 1 76 1
+ 2 2 27 52 2 77 2
+ 3 3 28 53 3 78 3
+ 4 4 29 54 4 79 4
+ 5 5 30 55 5 80 5
+ 6 6 31 56 6 81 6
+ 7 7 32 57 7 82 7
+ 8 8 33 58 8 83 8
+ 9 9 34 59 9 84 9
+ 10 10 35 60 10 85 10
+ 11 11 36 61 11 86 11
+ 12 12 37 62 12 87 12
+ 13 13 38 63 13 88 13
+ 14 14 39 64 14 89 14
+ 15 15 40 65 15 90 15
+ 16 16 41 66 16 91 16
+ 17 17 42 67 17 92 17
+ 18 18 43 68 18 93 18
+ 19 19 44 69 19 94 19
+ 20 20 45 70 20 95 20
+ 21 21 46 71 21 96 21
+ 22 22 47 72 22 97 22
+ 23 23 48 73 23 98 23
+ 24 24 49 74 24 99 24
+ 25 25 50 75 25 0 25
+ 26 26 51 76 26 1 26
+ 27 27 52 77 27 2 27
+ 28 28 53 78 28 3 28
+ 29 29 54 79 29 4 29
+ 30 30 55 80 30 5 30
+ 31 31 56 81 31 6 31
+ 32 32 57 82 32 7 32
+ 33 33 58 83 33 8 33
+ 34 34 59 84 34 9 34
+ 35 35 60 85 35 10 35
+ 36 36 61 86 36 11 36
+ 37 37 62 87 37 12 37
+ 38 38 63 88 38 13 38
+ 39 39 64 89 39 14 39
+ 40 40 65 90 40 15 40
+ 41 41 66 91 41 16 41
+ 42 42 67 92 42 17 42
+ 43 43 68 93 43 18 43
+ 44 44 69 94 44 19 44
+ 45 45 70 95 45 20 45
+ 46 46 71 96 46 21 46
+ 47 47 72 97 47 22 47
+ 48 48 73 98 48 23 48
+ 49 49 74 99 49 24 49
+ 50 50 75 0 50 25 50
+ 51 51 76 1 51 26 51
+ 52 52 77 2 52 27 52
+ 53 53 78 3 53 28 53
+ 54 54 79 4 54 29 54
+ 55 55 80 5 55 30 55
+ 56 56 81 6 56 31 56
+ 57 57 82 7 57 32 57
+ 58 58 83 8 58 33 58
+ 59 59 84 9 59 34 59
+ 60 60 85 10 60 35 60
+ 61 61 86 11 61 36 61
+ 62 62 87 12 62 37 62
+ 63 63 88 13 63 38 63
+ 64 64 89 14 64 39 64
+ 65 65 90 15 65 40 65
+ 66 66 91 16 66 41 66
+ 67 67 92 17 67 42 67
+ 68 68 93 18 68 43 68
+ 69 69 94 19 69 44 69
+ 70 70 95 20 70 45 70
+ 71 71 96 21 71 46 71
+ 72 72 97 22 72 47 72
+ 73 73 98 23 73 48 73
+ 74 74 99 24 74 49 74
+ 75 75 0 25 75 50 75
+ 76 76 1 26 76 51 76
+ 77 77 2 27 77 52 77
+ 78 78 3 28 78 53 78
+ 79 79 4 29 79 54 79
+ 80 80 5 30 80 55 80
+ 81 81 6 31 81 56 81
+ 82 82 7 32 82 57 82
+ 83 83 8 33 83 58 83
+ 84 84 9 34 84 59 84
+ 85 85 10 35 85 60 85
+ 86 86 11 36 86 61 86
+ 87 87 12 37 87 62 87
+ 88 88 13 38 88 63 88
+ 89 89 14 39 89 64 89
+ 90 90 15 40 90 65 90
+ 91 91 16 41 91 66 91
+ 92 92 17 42 92 67 92
+ 93 93 18 43 93 68 93
+ 94 94 19 44 94 69 94
+ 95 95 20 45 95 70 95
+ 96 96 21 46 96 71 96
+ 97 97 22 47 97 72 97
+ 98 98 23 48 98 73 98
+ 99 99 24 49 99 74 99
+ 100 100 25 50 100 75 100
+
+Sorted at position 7:
+ 1 1 26 51 1 76 1
+ 2 2 27 52 2 77 2
+ 3 3 28 53 3 78 3
+ 4 4 29 54 4 79 4
+ 5 5 30 55 5 80 5
+ 6 6 31 56 6 81 6
+ 7 7 32 57 7 82 7
+ 8 8 33 58 8 83 8
+ 9 9 34 59 9 84 9
+ 10 10 35 60 10 85 10
+ 11 11 36 61 11 86 11
+ 12 12 37 62 12 87 12
+ 13 13 38 63 13 88 13
+ 14 14 39 64 14 89 14
+ 15 15 40 65 15 90 15
+ 16 16 41 66 16 91 16
+ 17 17 42 67 17 92 17
+ 18 18 43 68 18 93 18
+ 19 19 44 69 19 94 19
+ 20 20 45 70 20 95 20
+ 21 21 46 71 21 96 21
+ 22 22 47 72 22 97 22
+ 23 23 48 73 23 98 23
+ 24 24 49 74 24 99 24
+ 25 25 50 75 25 0 25
+ 26 26 51 76 26 1 26
+ 27 27 52 77 27 2 27
+ 28 28 53 78 28 3 28
+ 29 29 54 79 29 4 29
+ 30 30 55 80 30 5 30
+ 31 31 56 81 31 6 31
+ 32 32 57 82 32 7 32
+ 33 33 58 83 33 8 33
+ 34 34 59 84 34 9 34
+ 35 35 60 85 35 10 35
+ 36 36 61 86 36 11 36
+ 37 37 62 87 37 12 37
+ 38 38 63 88 38 13 38
+ 39 39 64 89 39 14 39
+ 40 40 65 90 40 15 40
+ 41 41 66 91 41 16 41
+ 42 42 67 92 42 17 42
+ 43 43 68 93 43 18 43
+ 44 44 69 94 44 19 44
+ 45 45 70 95 45 20 45
+ 46 46 71 96 46 21 46
+ 47 47 72 97 47 22 47
+ 48 48 73 98 48 23 48
+ 49 49 74 99 49 24 49
+ 50 50 75 0 50 25 50
+ 51 51 76 1 51 26 51
+ 52 52 77 2 52 27 52
+ 53 53 78 3 53 28 53
+ 54 54 79 4 54 29 54
+ 55 55 80 5 55 30 55
+ 56 56 81 6 56 31 56
+ 57 57 82 7 57 32 57
+ 58 58 83 8 58 33 58
+ 59 59 84 9 59 34 59
+ 60 60 85 10 60 35 60
+ 61 61 86 11 61 36 61
+ 62 62 87 12 62 37 62
+ 63 63 88 13 63 38 63
+ 64 64 89 14 64 39 64
+ 65 65 90 15 65 40 65
+ 66 66 91 16 66 41 66
+ 67 67 92 17 67 42 67
+ 68 68 93 18 68 43 68
+ 69 69 94 19 69 44 69
+ 70 70 95 20 70 45 70
+ 71 71 96 21 71 46 71
+ 72 72 97 22 72 47 72
+ 73 73 98 23 73 48 73
+ 74 74 99 24 74 49 74
+ 75 75 0 25 75 50 75
+ 76 76 1 26 76 51 76
+ 77 77 2 27 77 52 77
+ 78 78 3 28 78 53 78
+ 79 79 4 29 79 54 79
+ 80 80 5 30 80 55 80
+ 81 81 6 31 81 56 81
+ 82 82 7 32 82 57 82
+ 83 83 8 33 83 58 83
+ 84 84 9 34 84 59 84
+ 85 85 10 35 85 60 85
+ 86 86 11 36 86 61 86
+ 87 87 12 37 87 62 87
+ 88 88 13 38 88 63 88
+ 89 89 14 39 89 64 89
+ 90 90 15 40 90 65 90
+ 91 91 16 41 91 66 91
+ 92 92 17 42 92 67 92
+ 93 93 18 43 93 68 93
+ 94 94 19 44 94 69 94
+ 95 95 20 45 95 70 95
+ 96 96 21 46 96 71 96
+ 97 97 22 47 97 72 97
+ 98 98 23 48 98 73 98
+ 99 99 24 49 99 74 99
+ 100 100 25 50 100 75 100
+
+Sorted at position 8:
+ 1 1 26 51 1 76 1
+ 2 2 27 52 2 77 2
+ 3 3 28 53 3 78 3
+ 4 4 29 54 4 79 4
+ 5 5 30 55 5 80 5
+ 6 6 31 56 6 81 6
+ 7 7 32 57 7 82 7
+ 8 8 33 58 8 83 8
+ 9 9 34 59 9 84 9
+ 10 10 35 60 10 85 10
+ 11 11 36 61 11 86 11
+ 12 12 37 62 12 87 12
+ 13 13 38 63 13 88 13
+ 14 14 39 64 14 89 14
+ 15 15 40 65 15 90 15
+ 16 16 41 66 16 91 16
+ 17 17 42 67 17 92 17
+ 18 18 43 68 18 93 18
+ 19 19 44 69 19 94 19
+ 20 20 45 70 20 95 20
+ 21 21 46 71 21 96 21
+ 22 22 47 72 22 97 22
+ 23 23 48 73 23 98 23
+ 24 24 49 74 24 99 24
+ 25 25 50 75 25 0 25
+ 26 26 51 76 26 1 26
+ 27 27 52 77 27 2 27
+ 28 28 53 78 28 3 28
+ 29 29 54 79 29 4 29
+ 30 30 55 80 30 5 30
+ 31 31 56 81 31 6 31
+ 32 32 57 82 32 7 32
+ 33 33 58 83 33 8 33
+ 34 34 59 84 34 9 34
+ 35 35 60 85 35 10 35
+ 36 36 61 86 36 11 36
+ 37 37 62 87 37 12 37
+ 38 38 63 88 38 13 38
+ 39 39 64 89 39 14 39
+ 40 40 65 90 40 15 40
+ 41 41 66 91 41 16 41
+ 42 42 67 92 42 17 42
+ 43 43 68 93 43 18 43
+ 44 44 69 94 44 19 44
+ 45 45 70 95 45 20 45
+ 46 46 71 96 46 21 46
+ 47 47 72 97 47 22 47
+ 48 48 73 98 48 23 48
+ 49 49 74 99 49 24 49
+ 50 50 75 0 50 25 50
+ 51 51 76 1 51 26 51
+ 52 52 77 2 52 27 52
+ 53 53 78 3 53 28 53
+ 54 54 79 4 54 29 54
+ 55 55 80 5 55 30 55
+ 56 56 81 6 56 31 56
+ 57 57 82 7 57 32 57
+ 58 58 83 8 58 33 58
+ 59 59 84 9 59 34 59
+ 60 60 85 10 60 35 60
+ 61 61 86 11 61 36 61
+ 62 62 87 12 62 37 62
+ 63 63 88 13 63 38 63
+ 64 64 89 14 64 39 64
+ 65 65 90 15 65 40 65
+ 66 66 91 16 66 41 66
+ 67 67 92 17 67 42 67
+ 68 68 93 18 68 43 68
+ 69 69 94 19 69 44 69
+ 70 70 95 20 70 45 70
+ 71 71 96 21 71 46 71
+ 72 72 97 22 72 47 72
+ 73 73 98 23 73 48 73
+ 74 74 99 24 74 49 74
+ 75 75 0 25 75 50 75
+ 76 76 1 26 76 51 76
+ 77 77 2 27 77 52 77
+ 78 78 3 28 78 53 78
+ 79 79 4 29 79 54 79
+ 80 80 5 30 80 55 80
+ 81 81 6 31 81 56 81
+ 82 82 7 32 82 57 82
+ 83 83 8 33 83 58 83
+ 84 84 9 34 84 59 84
+ 85 85 10 35 85 60 85
+ 86 86 11 36 86 61 86
+ 87 87 12 37 87 62 87
+ 88 88 13 38 88 63 88
+ 89 89 14 39 89 64 89
+ 90 90 15 40 90 65 90
+ 91 91 16 41 91 66 91
+ 92 92 17 42 92 67 92
+ 93 93 18 43 93 68 93
+ 94 94 19 44 94 69 94
+ 95 95 20 45 95 70 95
+ 96 96 21 46 96 71 96
+ 97 97 22 47 97 72 97
+ 98 98 23 48 98 73 98
+ 99 99 24 49 99 74 99
+ 100 100 25 50 100 75 100
+
+Sorted at position 9:
+ 1 1 26 51 1 76 1
+ 2 2 27 52 2 77 2
+ 3 3 28 53 3 78 3
+ 4 4 29 54 4 79 4
+ 5 5 30 55 5 80 5
+ 6 6 31 56 6 81 6
+ 7 7 32 57 7 82 7
+ 8 8 33 58 8 83 8
+ 9 9 34 59 9 84 9
+ 10 10 35 60 10 85 10
+ 11 11 36 61 11 86 11
+ 12 12 37 62 12 87 12
+ 13 13 38 63 13 88 13
+ 14 14 39 64 14 89 14
+ 15 15 40 65 15 90 15
+ 16 16 41 66 16 91 16
+ 17 17 42 67 17 92 17
+ 18 18 43 68 18 93 18
+ 19 19 44 69 19 94 19
+ 20 20 45 70 20 95 20
+ 21 21 46 71 21 96 21
+ 22 22 47 72 22 97 22
+ 23 23 48 73 23 98 23
+ 24 24 49 74 24 99 24
+ 25 25 50 75 25 0 25
+ 26 26 51 76 26 1 26
+ 27 27 52 77 27 2 27
+ 28 28 53 78 28 3 28
+ 29 29 54 79 29 4 29
+ 30 30 55 80 30 5 30
+ 31 31 56 81 31 6 31
+ 32 32 57 82 32 7 32
+ 33 33 58 83 33 8 33
+ 34 34 59 84 34 9 34
+ 35 35 60 85 35 10 35
+ 36 36 61 86 36 11 36
+ 37 37 62 87 37 12 37
+ 38 38 63 88 38 13 38
+ 39 39 64 89 39 14 39
+ 40 40 65 90 40 15 40
+ 41 41 66 91 41 16 41
+ 42 42 67 92 42 17 42
+ 43 43 68 93 43 18 43
+ 44 44 69 94 44 19 44
+ 45 45 70 95 45 20 45
+ 46 46 71 96 46 21 46
+ 47 47 72 97 47 22 47
+ 48 48 73 98 48 23 48
+ 49 49 74 99 49 24 49
+ 50 50 75 0 50 25 50
+ 51 51 76 1 51 26 51
+ 52 52 77 2 52 27 52
+ 53 53 78 3 53 28 53
+ 54 54 79 4 54 29 54
+ 55 55 80 5 55 30 55
+ 56 56 81 6 56 31 56
+ 57 57 82 7 57 32 57
+ 58 58 83 8 58 33 58
+ 59 59 84 9 59 34 59
+ 60 60 85 10 60 35 60
+ 61 61 86 11 61 36 61
+ 62 62 87 12 62 37 62
+ 63 63 88 13 63 38 63
+ 64 64 89 14 64 39 64
+ 65 65 90 15 65 40 65
+ 66 66 91 16 66 41 66
+ 67 67 92 17 67 42 67
+ 68 68 93 18 68 43 68
+ 69 69 94 19 69 44 69
+ 70 70 95 20 70 45 70
+ 71 71 96 21 71 46 71
+ 72 72 97 22 72 47 72
+ 73 73 98 23 73 48 73
+ 74 74 99 24 74 49 74
+ 75 75 0 25 75 50 75
+ 76 76 1 26 76 51 76
+ 77 77 2 27 77 52 77
+ 78 78 3 28 78 53 78
+ 79 79 4 29 79 54 79
+ 80 80 5 30 80 55 80
+ 81 81 6 31 81 56 81
+ 82 82 7 32 82 57 82
+ 83 83 8 33 83 58 83
+ 84 84 9 34 84 59 84
+ 85 85 10 35 85 60 85
+ 86 86 11 36 86 61 86
+ 87 87 12 37 87 62 87
+ 88 88 13 38 88 63 88
+ 89 89 14 39 89 64 89
+ 90 90 15 40 90 65 90
+ 91 91 16 41 91 66 91
+ 92 92 17 42 92 67 92
+ 93 93 18 43 93 68 93
+ 94 94 19 44 94 69 94
+ 95 95 20 45 95 70 95
+ 96 96 21 46 96 71 96
+ 97 97 22 47 97 72 97
+ 98 98 23 48 98 73 98
+ 99 99 24 49 99 74 99
+ 100 100 25 50 100 75 100
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d
new file mode 100644
index 000000000000..ebb916a0192d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d
@@ -0,0 +1,37 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ @one["foo", 789, "bar", curthread] = sum(123);
+ @two["foo", 789, "bar", curthread] = sum(456);
+ printa("%10s %10d %10s %@10d %@10d\n", @one, @two);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d.out
new file mode 100644
index 000000000000..002f5aa13f8b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d.out
@@ -0,0 +1,2 @@
+ foo 789 bar 123 456
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d
new file mode 100644
index 000000000000..5a57b2b01ab5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+/0/
+{
+ @bop[345] = quantize(0);
+ @baz[345] = lquantize(0, -10, 10, 1);
+}
+
+BEGIN
+{
+ @foo[123] = sum(123);
+ @bar[456] = sum(456);
+
+ @foo[789] = sum(789);
+ @bar[789] = sum(789);
+
+ printa("%10d %@10d %@10d\n", @foo, @bar);
+ printa("%10d %@10d %@10d %@10d\n", @foo, @bar, @bop);
+ printa("%10d %@10d %@10d %@10d %@10d\n", @foo, @bar, @bop, @baz);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d.out
new file mode 100644
index 000000000000..dde9e41c21ac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d.out
@@ -0,0 +1,55 @@
+ 456 0 456
+ 123 123 0
+ 789 789 789
+ 456 0 456
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ 123 123 0
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ 789 789 789
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ 456 0 456
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ value ------------- Distribution ------------- count
+ < -10 | 0
+ -10 | 0
+ -9 | 0
+
+ 123 123 0
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ value ------------- Distribution ------------- count
+ < -10 | 0
+ -10 | 0
+ -9 | 0
+
+ 789 789 789
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ value ------------- Distribution ------------- count
+ < -10 | 0
+ -10 | 0
+ -9 | 0
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d
new file mode 100644
index 000000000000..79e756bdbf7e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ @bop[345] = quantize(0, 0);
+ @baz[345] = lquantize(0, -10, 10, 1, 0);
+}
+
+BEGIN
+{
+ @foo[123] = sum(123);
+ @bar[456] = sum(456);
+
+ @foo[789] = sum(789);
+ @bar[789] = sum(789);
+
+ printa("%10d %@10d %@10d\n", @foo, @bar);
+ printa("%10d %@10d %@10d %@10d\n", @foo, @bar, @bop);
+ printa("%10d %@10d %@10d %@10d %@10d\n", @foo, @bar, @bop, @baz);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d.out
new file mode 100644
index 000000000000..9b28d8e7e299
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d.out
@@ -0,0 +1,72 @@
+ 456 0 456
+ 123 123 0
+ 789 789 789
+ 345 0 0
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ 456 0 456
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ 123 123 0
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ 789 789 789
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ 345 0 0
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ value ------------- Distribution ------------- count
+ < -10 | 0
+ -10 | 0
+ -9 | 0
+
+ 456 0 456
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ value ------------- Distribution ------------- count
+ < -10 | 0
+ -10 | 0
+ -9 | 0
+
+ 123 123 0
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ value ------------- Distribution ------------- count
+ < -10 | 0
+ -10 | 0
+ -9 | 0
+
+ 789 789 789
+ value ------------- Distribution ------------- count
+ -1 | 0
+ 0 | 0
+ 1 | 0
+
+ value ------------- Distribution ------------- count
+ < -10 | 0
+ -10 | 0
+ -9 | 0
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d
new file mode 100644
index 000000000000..bc17bc962a4d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+/0/
+{
+ @bop[345] = quantize(0, 0);
+ @baz[345] = lquantize(0, -10, 10, 1, 0);
+}
+
+BEGIN
+{
+ printa(@bop);
+ printa(@baz);
+ printa("%@10d %@10d\n", @bop, @baz);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d.out
new file mode 100644
index 000000000000..b28b04f64312
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d.out
@@ -0,0 +1,3 @@
+
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call.c
new file mode 100644
index 000000000000..6194c5802237
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call.c
@@ -0,0 +1,120 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <strings.h>
+#include <rpc/rpc.h>
+
+#include "rpcsvc/nfs4_prot.h"
+
+int nfs4_skip_bytes;
+
+/*
+ * The waiting() function returns the value passed in, until something
+ * external modifies it. In this case, the D script tst.call.d will
+ * modify the value of *a, and thus break the while loop in dotest().
+ *
+ * This serves the purpose of not making the RPC calls until tst.call.d
+ * is active. Thus, the probes in tst.call.d can fire as a result of
+ * the RPC call in dotest().
+ */
+
+int
+waiting(volatile int *a)
+{
+ return (*a);
+}
+
+int
+dotest(void)
+{
+ CLIENT *client;
+ AUTH *auth;
+ COMPOUND4args args;
+ COMPOUND4res res;
+ enum clnt_stat status;
+ struct timeval timeout;
+ nfs_argop4 arg[1];
+ char *tag = "dtrace test";
+ volatile int a = 0;
+
+ while (waiting(&a) == 0)
+ continue;
+
+ timeout.tv_sec = 30;
+ timeout.tv_usec = 0;
+
+ client = clnt_create("localhost", NFS4_PROGRAM, NFS_V4, "tcp");
+ if (client == NULL) {
+ clnt_pcreateerror("test");
+ return (1);
+ }
+ auth = authsys_create_default();
+ client->cl_auth = auth;
+ args.minorversion = 0;
+ args.tag.utf8string_len = strlen(tag);
+ args.tag.utf8string_val = tag;
+ args.argarray.argarray_len = sizeof (arg) / sizeof (nfs_argop4);
+ args.argarray.argarray_val = arg;
+
+ arg[0].argop = OP_PUTROOTFH;
+ /* no need to manipulate nfs_argop4_u */
+
+ bzero(&res, sizeof (res));
+
+ status = clnt_call(client, NFSPROC4_COMPOUND,
+ xdr_COMPOUND4args, (caddr_t)&args,
+ xdr_COMPOUND4res, (caddr_t)&res,
+ timeout);
+ if (status != RPC_SUCCESS) {
+ clnt_perror(client, "test");
+ return (2);
+ }
+
+ return (0);
+}
+
+/*ARGSUSED*/
+int
+main(int argc, char **argv)
+{
+ char shareline[BUFSIZ], unshareline[BUFSIZ];
+ int rc;
+
+ (void) snprintf(shareline, sizeof (shareline),
+ "mkdir /tmp/nfsv4test.%d ; share /tmp/nfsv4test.%d", getpid(),
+ getpid());
+ (void) snprintf(unshareline, sizeof (unshareline),
+ "unshare /tmp/nfsv4test.%d ; rmdir /tmp/nfsv4test.%d", getpid(),
+ getpid());
+
+ (void) system(shareline);
+ rc = dotest();
+ (void) system(unshareline);
+
+ return (rc);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call.d
new file mode 100644
index 000000000000..15cf8bc0dc4e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call.d
@@ -0,0 +1,70 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Make sure nfs provider probes are firing
+ *
+ * SECTION: nfs4 provider
+ */
+
+#pragma D option destructive
+#pragma D option quiet
+
+pid$1:a.out:waiting:entry
+{
+ this->value = (int *)alloca(sizeof (int));
+ *this->value = 1;
+ copyout(this->value, arg0, sizeof (int));
+}
+
+nfsv4:::compound-start
+{
+ cstart++;
+}
+
+nfsv4:::op-putrootfh-start
+{
+ opstart++;
+}
+
+nfsv4:::op-putrootfh-done
+{
+ opdone++;
+}
+
+nfsv4:::compound-done
+/cstart && opstart && opdone/
+{
+ exit(0);
+}
+
+tick-1s
+/tick++ == 3/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.c
new file mode 100644
index 000000000000..bd89fffca676
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.c
@@ -0,0 +1,441 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <strings.h>
+#include <rpc/rpc.h>
+#include <stdlib.h>
+#include <sys/param.h>
+#include <rpcsvc/mount.h>
+
+#include "rpcsvc/nfs_prot.h"
+
+char sharedpath[MAXPATHLEN];
+fhandle3 *rootfh;
+
+/*
+ * The waiting() function returns the value passed in, until something
+ * external modifies it. In this case, the D script tst.call.d will
+ * modify the value of *a, and thus break the while loop in dotest().
+ *
+ * This serves the purpose of not making the RPC calls until tst.call.d
+ * is active. Thus, the probes in tst.call.d can fire as a result of
+ * the RPC call in dotest().
+ */
+
+int
+waiting(volatile int *a)
+{
+ return (*a);
+}
+
+static void
+getattr_arginit(void *argp)
+{
+ GETATTR3args *args = argp;
+
+ args->object.data.data_len = rootfh->fhandle3_len;
+ args->object.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+setattr_arginit(void *argp)
+{
+ SETATTR3args *args = argp;
+
+ bzero(args, sizeof (*args));
+ args->object.data.data_len = rootfh->fhandle3_len;
+ args->object.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+lookup_arginit(void *argp)
+{
+ LOOKUP3args *args = argp;
+
+ args->what.name = "giant-skunk";
+ args->what.dir.data.data_len = rootfh->fhandle3_len;
+ args->what.dir.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+access_arginit(void *argp)
+{
+ ACCESS3args *args = argp;
+
+ args->object.data.data_len = rootfh->fhandle3_len;
+ args->object.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+commit_arginit(void *argp)
+{
+ COMMIT3args *args = argp;
+
+ bzero(args, sizeof (*args));
+ args->file.data.data_len = rootfh->fhandle3_len;
+ args->file.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+create_arginit(void *argp)
+{
+ CREATE3args *args = argp;
+
+ bzero(args, sizeof (*args));
+ args->where.name = "pinky-blue";
+ args->where.dir.data.data_len = rootfh->fhandle3_len;
+ args->where.dir.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+fsinfo_arginit(void *argp)
+{
+ FSINFO3args *args = argp;
+
+ args->fsroot.data.data_len = rootfh->fhandle3_len;
+ args->fsroot.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+fsstat_arginit(void *argp)
+{
+ FSSTAT3args *args = argp;
+
+ args->fsroot.data.data_len = rootfh->fhandle3_len;
+ args->fsroot.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+link_arginit(void *argp)
+{
+ LINK3args *args = argp;
+
+ args->file.data.data_len = rootfh->fhandle3_len;
+ args->file.data.data_val = rootfh->fhandle3_val;
+ args->link.dir.data.data_len = rootfh->fhandle3_len;
+ args->link.dir.data.data_val = rootfh->fhandle3_val;
+ args->link.name = "samf";
+}
+
+static void
+mkdir_arginit(void *argp)
+{
+ MKDIR3args *args = argp;
+
+ bzero(args, sizeof (*args));
+ args->where.dir.data.data_len = rootfh->fhandle3_len;
+ args->where.dir.data.data_val = rootfh->fhandle3_val;
+ args->where.name = "cookie";
+}
+
+static void
+mknod_arginit(void *argp)
+{
+ MKNOD3args *args = argp;
+
+ bzero(args, sizeof (*args));
+ args->where.dir.data.data_len = rootfh->fhandle3_len;
+ args->where.dir.data.data_val = rootfh->fhandle3_val;
+ args->where.name = "pookie";
+}
+
+static void
+null_arginit(void *argp)
+{
+}
+
+static void
+pathconf_arginit(void *argp)
+{
+ PATHCONF3args *args = argp;
+
+ args->object.data.data_len = rootfh->fhandle3_len;
+ args->object.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+read_arginit(void *argp)
+{
+ READ3args *args = argp;
+
+ bzero(args, sizeof (*args));
+ args->file.data.data_len = rootfh->fhandle3_len;
+ args->file.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+readdir_arginit(void *argp)
+{
+ READDIR3args *args = argp;
+
+ bzero(args, sizeof (*args));
+ args->dir.data.data_len = rootfh->fhandle3_len;
+ args->dir.data.data_val = rootfh->fhandle3_val;
+ args->count = 1024;
+}
+
+static void
+readdirplus_arginit(void *argp)
+{
+ READDIRPLUS3args *args = argp;
+
+ bzero(args, sizeof (*args));
+ args->dir.data.data_len = rootfh->fhandle3_len;
+ args->dir.data.data_val = rootfh->fhandle3_val;
+ args->dircount = 1024;
+ args->maxcount = 1024;
+}
+
+static void
+readlink_arginit(void *argp)
+{
+ READLINK3args *args = argp;
+
+ args->symlink.data.data_len = rootfh->fhandle3_len;
+ args->symlink.data.data_val = rootfh->fhandle3_val;
+}
+
+static void
+remove_arginit(void *argp)
+{
+ REMOVE3args *args = argp;
+
+ args->object.dir.data.data_len = rootfh->fhandle3_len;
+ args->object.dir.data.data_val = rootfh->fhandle3_val;
+ args->object.name = "antelope";
+}
+
+static void
+rename_arginit(void *argp)
+{
+ RENAME3args *args = argp;
+
+ args->from.dir.data.data_len = rootfh->fhandle3_len;
+ args->from.dir.data.data_val = rootfh->fhandle3_val;
+ args->from.name = "walter";
+ args->to.dir.data.data_len = rootfh->fhandle3_len;
+ args->to.dir.data.data_val = rootfh->fhandle3_val;
+ args->to.name = "wendy";
+}
+
+static void
+rmdir_arginit(void *argp)
+{
+ RMDIR3args *args = argp;
+
+ args->object.dir.data.data_len = rootfh->fhandle3_len;
+ args->object.dir.data.data_val = rootfh->fhandle3_val;
+ args->object.name = "bunny";
+}
+
+static void
+symlink_arginit(void *argp)
+{
+ SYMLINK3args *args = argp;
+
+ bzero(args, sizeof (*args));
+ args->where.dir.data.data_len = rootfh->fhandle3_len;
+ args->where.dir.data.data_val = rootfh->fhandle3_val;
+ args->where.name = "parlor";
+ args->symlink.symlink_data = "interior";
+}
+
+static void
+write_arginit(void *argp)
+{
+ WRITE3args *args = argp;
+
+ bzero(args, sizeof (*args));
+ args->file.data.data_len = rootfh->fhandle3_len;
+ args->file.data.data_val = rootfh->fhandle3_val;
+}
+
+typedef void (*call3_arginit_t)(void *);
+
+typedef struct {
+ call3_arginit_t arginit;
+ rpcproc_t proc;
+ xdrproc_t xdrargs;
+ size_t argsize;
+ xdrproc_t xdrres;
+ size_t ressize;
+} call3_test_t;
+call3_test_t call3_tests[] = {
+ {getattr_arginit, NFSPROC3_GETATTR, xdr_GETATTR3args,
+ sizeof (GETATTR3args), xdr_GETATTR3res, sizeof (GETATTR3res)},
+ {setattr_arginit, NFSPROC3_SETATTR, xdr_SETATTR3args,
+ sizeof (SETATTR3args), xdr_SETATTR3res, sizeof (SETATTR3res)},
+ {lookup_arginit, NFSPROC3_LOOKUP, xdr_LOOKUP3args,
+ sizeof (LOOKUP3args), xdr_LOOKUP3res, sizeof (LOOKUP3res)},
+ {access_arginit, NFSPROC3_ACCESS, xdr_ACCESS3args,
+ sizeof (ACCESS3args), xdr_ACCESS3res, sizeof (ACCESS3res)},
+ {commit_arginit, NFSPROC3_COMMIT, xdr_COMMIT3args,
+ sizeof (COMMIT3args), xdr_COMMIT3res, sizeof (COMMIT3res)},
+ {create_arginit, NFSPROC3_CREATE, xdr_CREATE3args,
+ sizeof (CREATE3args), xdr_CREATE3res, sizeof (CREATE3res)},
+ {fsinfo_arginit, NFSPROC3_FSINFO, xdr_FSINFO3args,
+ sizeof (FSINFO3args), xdr_FSINFO3res, sizeof (FSINFO3res)},
+ {fsstat_arginit, NFSPROC3_FSSTAT, xdr_FSSTAT3args,
+ sizeof (FSSTAT3args), xdr_FSSTAT3res, sizeof (FSSTAT3res)},
+ {link_arginit, NFSPROC3_LINK, xdr_LINK3args,
+ sizeof (LINK3args), xdr_LINK3res, sizeof (LINK3res)},
+ {mkdir_arginit, NFSPROC3_MKDIR, xdr_MKDIR3args,
+ sizeof (MKDIR3args), xdr_MKDIR3res, sizeof (MKDIR3res)},
+ {mknod_arginit, NFSPROC3_MKNOD, xdr_MKNOD3args,
+ sizeof (MKNOD3args), xdr_MKNOD3res, sizeof (MKNOD3res)},
+ /*
+ * NULL proc is special. Rather than special case its zero-sized
+ * args/results, we give it a small nonzero size, so as to not
+ * make realloc() do the wrong thing.
+ */
+ {null_arginit, NFSPROC3_NULL, xdr_void, sizeof (int), xdr_void,
+ sizeof (int)},
+ {pathconf_arginit, NFSPROC3_PATHCONF, xdr_PATHCONF3args,
+ sizeof (PATHCONF3args), xdr_PATHCONF3res, sizeof (PATHCONF3res)},
+ {read_arginit, NFSPROC3_READ, xdr_READ3args,
+ sizeof (READ3args), xdr_READ3res, sizeof (READ3res)},
+ {readdir_arginit, NFSPROC3_READDIR, xdr_READDIR3args,
+ sizeof (READDIR3args), xdr_READDIR3res, sizeof (READDIR3res)},
+ {readdirplus_arginit, NFSPROC3_READDIRPLUS, xdr_READDIRPLUS3args,
+ sizeof (READDIRPLUS3args), xdr_READDIRPLUS3res,
+ sizeof (READDIRPLUS3res)},
+ {readlink_arginit, NFSPROC3_READLINK, xdr_READLINK3args,
+ sizeof (READLINK3args), xdr_READLINK3res, sizeof (READLINK3res)},
+ {remove_arginit, NFSPROC3_REMOVE, xdr_REMOVE3args,
+ sizeof (REMOVE3args), xdr_REMOVE3res, sizeof (REMOVE3res)},
+ {rename_arginit, NFSPROC3_RENAME, xdr_RENAME3args,
+ sizeof (RENAME3args), xdr_RENAME3res, sizeof (RENAME3res)},
+ {rmdir_arginit, NFSPROC3_RMDIR, xdr_RMDIR3args,
+ sizeof (RMDIR3args), xdr_RMDIR3res, sizeof (RMDIR3res)},
+ {symlink_arginit, NFSPROC3_SYMLINK, xdr_SYMLINK3args,
+ sizeof (SYMLINK3args), xdr_SYMLINK3res, sizeof (SYMLINK3res)},
+ {write_arginit, NFSPROC3_WRITE, xdr_WRITE3args,
+ sizeof (WRITE3args), xdr_WRITE3res, sizeof (WRITE3res)},
+ {NULL}
+};
+
+int
+dotest(void)
+{
+ CLIENT *client, *mountclient;
+ AUTH *auth;
+ struct timeval timeout;
+ caddr_t args, res;
+ enum clnt_stat status;
+ rpcproc_t proc;
+ call3_test_t *test;
+ void *argbuf = NULL;
+ void *resbuf = NULL;
+ struct mountres3 mountres3;
+ char *sp;
+ volatile int a = 0;
+
+ while (waiting(&a) == 0)
+ continue;
+
+ timeout.tv_sec = 30;
+ timeout.tv_usec = 0;
+
+ mountclient = clnt_create("localhost", MOUNTPROG, MOUNTVERS3, "tcp");
+ if (mountclient == NULL) {
+ clnt_pcreateerror("clnt_create mount");
+ return (1);
+ }
+ auth = authsys_create_default();
+ mountclient->cl_auth = auth;
+ sp = sharedpath;
+ bzero(&mountres3, sizeof (mountres3));
+ status = clnt_call(mountclient, MOUNTPROC_MNT,
+ xdr_dirpath, (char *)&sp,
+ xdr_mountres3, (char *)&mountres3,
+ timeout);
+ if (status != RPC_SUCCESS) {
+ clnt_perror(mountclient, "mnt");
+ return (1);
+ }
+ if (mountres3.fhs_status != 0) {
+ fprintf(stderr, "MOUNTPROG/MOUNTVERS3 failed %d\n",
+ mountres3.fhs_status);
+ return (1);
+ }
+ rootfh = &mountres3.mountres3_u.mountinfo.fhandle;
+
+ client = clnt_create("localhost", NFS3_PROGRAM, NFS_V3, "tcp");
+ if (client == NULL) {
+ clnt_pcreateerror("clnt_create");
+ return (1);
+ }
+ client->cl_auth = auth;
+
+ for (test = call3_tests; test->arginit; ++test) {
+ argbuf = realloc(argbuf, test->argsize);
+ resbuf = realloc(resbuf, test->ressize);
+ if ((argbuf == NULL) || (resbuf == NULL)) {
+ perror("realloc() failed");
+ return (1);
+ }
+ (test->arginit)(argbuf);
+ bzero(resbuf, test->ressize);
+ status = clnt_call(client, test->proc,
+ test->xdrargs, argbuf,
+ test->xdrres, resbuf,
+ timeout);
+ if (status != RPC_SUCCESS)
+ clnt_perror(client, "call");
+ }
+
+ status = clnt_call(mountclient, MOUNTPROC_UMNT,
+ xdr_dirpath, (char *)&sp,
+ xdr_void, NULL,
+ timeout);
+ if (status != RPC_SUCCESS)
+ clnt_perror(mountclient, "umnt");
+
+ return (0);
+}
+
+/*ARGSUSED*/
+int
+main(int argc, char **argv)
+{
+ char shareline[BUFSIZ], unshareline[BUFSIZ];
+ int rc;
+
+ (void) snprintf(sharedpath, sizeof (sharedpath),
+ "/tmp/nfsv3test.%d", getpid());
+ (void) snprintf(shareline, sizeof (shareline),
+ "mkdir %s ; share %s", sharedpath, sharedpath);
+ (void) snprintf(unshareline, sizeof (unshareline),
+ "unshare %s ; rmdir %s", sharedpath, sharedpath);
+
+ (void) system(shareline);
+ rc = dotest();
+ (void) system(unshareline);
+
+ return (rc);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.d
new file mode 100644
index 000000000000..b635b1662db9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.d
@@ -0,0 +1,91 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Make sure nfsv3 provider probes are firing, and that the
+ * arguments are properly visible.
+ *
+ * SECTION: nfs3 provider
+ */
+
+#pragma D option destructive
+#pragma D option quiet
+
+pid$1:a.out:waiting:entry
+{
+ this->value = (int *)alloca(sizeof (int));
+ *this->value = 1;
+ copyout(this->value, arg0, sizeof (int));
+}
+
+nfsv3:::op-getattr-start
+{
+ printf("ci_local: %s\n", args[0]->ci_local);
+ printf("ci_remote: %s\n", args[0]->ci_remote);
+ printf("ci_protocol: %s\n", args[0]->ci_protocol);
+
+ printf("noi_xid: %d\n", args[1]->noi_xid);
+ printf("noi_cred->cr_uid: %d\n", args[1]->noi_cred->cr_uid);
+ printf("noi_curpath: %s\n", args[1]->noi_curpath);
+
+ printf("fh3_flags: %d\n", args[2]->object.fh3_flags);
+}
+
+nfsv3:::op-getattr-done
+{
+ printf("ci_local: %s\n", args[0]->ci_local);
+ printf("ci_remote: %s\n", args[0]->ci_remote);
+ printf("ci_protocol: %s\n", args[0]->ci_protocol);
+
+ printf("noi_xid: %d\n", args[1]->noi_xid);
+ printf("noi_cred->cr_uid: %d\n", args[1]->noi_cred->cr_uid);
+ printf("noi_curpath: %s\n", args[1]->noi_curpath);
+
+ printf("status: %d\n", args[2]->status);
+}
+
+nfsv3:::*-done
+/seen[probename] == 0/
+{
+ ++numberseen;
+ seen[probename] = 1;
+ printf("%d ops seen, latest op is %s\n", numberseen, probename);
+}
+
+nfsv3:::*-done
+/numberseen == 22/
+{
+ exit(0);
+}
+
+tick-1s
+/tick++ == 10/
+{
+ printf("%d nfsv3 ops seen; should be 22\n", numberseen);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d
new file mode 100644
index 000000000000..cc4884637dcd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Test invocation of offsetof() with a member that is a bit-field.
+ * This should fail at compile time.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ * NOTES:
+ *
+ */
+
+struct foo {
+ int a:1;
+ int b:3;
+};
+
+BEGIN
+{
+ trace(offsetof(struct foo, b));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.badtype.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.badtype.d
new file mode 100644
index 000000000000..4e8a8858f1ac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.badtype.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Test invocation of offsetof() with an invalid type.
+ * This should fail at compile time.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ * NOTES:
+ *
+ */
+
+BEGIN
+{
+ trace(offsetof(struct no_such_type, x));
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.notsou.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.notsou.d
new file mode 100644
index 000000000000..84209530b20c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.notsou.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ *
+ * Test invocation of offsetof() with a type that is not a struct or union.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ * NOTES:
+ *
+ */
+
+BEGIN
+{
+ trace(offsetof(int, x));
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.OffsetofNULL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.OffsetofNULL.d
new file mode 100644
index 000000000000..5a341a3342d3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.OffsetofNULL.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Querying the offsetof an non-member variable of a struct throws
+ * a D_UNKNOWN error.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ */
+#pragma D option quiet
+
+struct record {
+ int a;
+ int b;
+ int c : 4;
+};
+
+BEGIN
+{
+ printf("offsetof (struct record, NULL): %d\n",
+ offsetof (struct record, NULL));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.badmemb.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.badmemb.d
new file mode 100644
index 000000000000..caf0a1d19384
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.badmemb.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Test invocation of offsetof() with an invalid member.
+ * This should fail at compile time.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ * NOTES:
+ *
+ */
+
+BEGIN
+{
+ trace(offsetof(vnode_t, v_no_such_member));
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofAlias.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofAlias.d
new file mode 100644
index 000000000000..c7494d20992a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofAlias.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test invocation of offsetof() with a struct type alias.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+typedef struct record {
+ char c;
+ int x;
+ int y;
+} record_t;
+
+BEGIN
+{
+ printf("offsetof(record_t, c) = %d\n", offsetof(record_t, c));
+ printf("offsetof(record_t, x) = %d\n", offsetof(record_t, x));
+ printf("offsetof(record_t, y) = %d\n", offsetof(record_t, y));
+ exit(0);
+}
+
+END
+/(8 != offsetof(record_t, y)) || (4 != offsetof(record_t, x)) ||
+ (0 != offsetof(record_t, c))/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofArith.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofArith.d
new file mode 100644
index 000000000000..7e2b33087940
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofArith.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: offsetof can be used anywhere in a D program that an integer
+ * constant can be used.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+typedef struct record {
+ char c;
+ int x;
+ int y;
+} record_t;
+
+BEGIN
+{
+
+ add = offsetof(record_t, c) + offsetof(record_t, x) +
+ offsetof(record_t, y);
+ sub = offsetof(record_t, y) - offsetof(record_t, x);
+ mul = offsetof(record_t, x) * offsetof(record_t, c);
+ div = offsetof(record_t, y) / offsetof(record_t, x);
+
+ printf("offsetof(record_t, c) = %d\n", offsetof(record_t, c));
+ printf("offsetof(record_t, x) = %d\n", offsetof(record_t, x));
+ printf("offsetof(record_t, y) = %d\n", offsetof(record_t, y));
+
+ printf("Addition of offsets (c+x+y)= %d\n", add);
+ printf("Subtraction of offsets (y-x)= %d\n", sub);
+ printf("Multiplication of offsets (x*c) = %d\n", mul);
+ printf("Division of offsets (y/x) = %d\n", div);
+
+ exit(0);
+}
+
+END
+/(8 != offsetof(record_t, y)) || (4 != offsetof(record_t, x)) ||
+ (0 != offsetof(record_t, c)) || (12 != add) || (4 != sub) || (0 != mul)
+ || (2 != div)/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofUnion.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofUnion.d
new file mode 100644
index 000000000000..de1a5fabd66e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofUnion.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test invocation of offsetof() with a union type alias.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+union record {
+ int x;
+ int y;
+ char c;
+};
+
+BEGIN
+{
+ printf("offsetof(record, x) = %d\n", offsetof(union D`record, x));
+ printf("offsetof(record, y) = %d\n", offsetof(union D`record, y));
+ printf("offsetof(record, c) = %d\n", offsetof(union D`record, c));
+ exit(0);
+}
+
+END
+/(0 != offsetof(union D`record, y)) && (0 != offsetof(union D`record, x)) &&
+ (0 != offsetof(union D`record, c))/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.struct.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.struct.d
new file mode 100644
index 000000000000..60b88637e0aa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.struct.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test invocation of offsetof() with a struct type.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+struct s {
+ int x;
+ int y;
+};
+
+BEGIN
+{
+ printf("offsetof(s, y) = %d\n", offsetof(struct D`s, y));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.struct.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.struct.d.out
new file mode 100644
index 000000000000..04b666e2d553
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.struct.d.out
@@ -0,0 +1,2 @@
+offsetof(s, y) = 4
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.union.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.union.d
new file mode 100644
index 000000000000..1b37c4c102c5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.union.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test invocation of offsetof() with a union type.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+union s {
+ int x;
+ int y;
+};
+
+BEGIN
+{
+ printf("offsetof(s, y) = %d\n", offsetof(union D`s, y));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.union.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.union.d.out
new file mode 100644
index 000000000000..e3918bef1e34
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.union.d.out
@@ -0,0 +1,2 @@
+offsetof(s, y) = 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/operators/tst.ternary.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/operators/tst.ternary.d
new file mode 100644
index 000000000000..cd3751951b10
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/operators/tst.ternary.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the ternary operator. Test left-hand side true, right-hand side true,
+ * and multiple nested instances of the ternary operator.
+ *
+ * SECTION: Types, Operators, and Expressions/Conditional Expressions
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ x = 0;
+ printf("x is %s\n", x == 0 ? "zero" : "one");
+ x = 1;
+ printf("x is %s\n", x == 0 ? "zero" : "one");
+ x = 2;
+ printf("x is %s\n", x == 0 ? "zero" : x == 1 ? "one" : "two");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/operators/tst.ternary.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/operators/tst.ternary.d.out
new file mode 100644
index 000000000000..ec30800e4a79
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/operators/tst.ternary.d.out
@@ -0,0 +1,4 @@
+x is zero
+x is one
+x is two
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.d
new file mode 100644
index 000000000000..a3fa24ffe623
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: can't specify a bogus library name
+ *
+ * SECTION: User Process Tracing/pid Provider
+ *
+ */
+
+pid$1:libbmc_sucks.so.1::entry
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe
new file mode 100644
index 000000000000..595db1de33da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe
@@ -0,0 +1,29 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 1000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badproc1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badproc1.d
new file mode 100644
index 000000000000..3f3ca22d4c50
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badproc1.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Verify that we don't grab bogus process IDs.
+ *
+ * SECTION: User Process Tracing/pid Provider
+ *
+ */
+
+pidgin:::entry
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_BADPID.badproc2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_BADPID.badproc2.d
new file mode 100644
index 000000000000..8e01b060c3f3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_BADPID.badproc2.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Make sure we can't grab pid 0
+ *
+ * SECTION: User Process Tracing/pid Provider
+ *
+ */
+
+pid0:::entry
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.d
new file mode 100644
index 000000000000..dabcd9c6439f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.d
@@ -0,0 +1,36 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+pid$1:::
+{
+}
+
+BEGIN
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe
new file mode 100644
index 000000000000..7a6d6f23eefa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 1000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.d
new file mode 100644
index 000000000000..f1c44e866499
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Can't specify a bogus function name (if the module is specified)
+ *
+ * SECTION: User Process Tracing/pid Provider
+ *
+ * NOTES:
+ *
+ */
+
+pid$1:a.out:ahl_r00lz:entry
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe
new file mode 100644
index 000000000000..595db1de33da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe
@@ -0,0 +1,29 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 1000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.d
new file mode 100644
index 000000000000..dd905303c16a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test that the '-' function doesn't work with random modules
+ *
+ * SECTION: User Process Tracing/pid Provider
+ *
+ */
+
+pid$1:libc:-:800
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe
new file mode 100644
index 000000000000..595db1de33da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe
@@ -0,0 +1,29 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 1000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.d
new file mode 100644
index 000000000000..6acf8aa0c747
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Verify that you can't enable "all" '-' function probes
+ *
+ * SECTION: User Process Tracing/pid Provider
+ *
+ */
+
+pid$1::-:
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe
new file mode 100644
index 000000000000..595db1de33da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe
@@ -0,0 +1,29 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 1000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d
new file mode 100644
index 000000000000..829c002cc08b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Only entry, return and offsets are valid names
+ *
+ * SECTION: User Process Tracing/pid Provider
+ *
+ */
+
+pid$1:a.out:main:beginning
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe
new file mode 100644
index 000000000000..595db1de33da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe
@@ -0,0 +1,29 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 1000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.d
new file mode 100644
index 000000000000..36bf9d6e2371
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Verify that you can't glob the probe name with the '-' function
+ *
+ * SECTION: User Process Tracing/pid Provider
+ *
+ */
+
+pid$1::-:10*
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe
new file mode 100644
index 000000000000..595db1de33da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe
@@ -0,0 +1,29 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 1000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.d
new file mode 100644
index 000000000000..60e5a8c6edc6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Can't have an offset that's outside of a function
+ *
+ * SECTION: User Process Tracing/pid Provider
+ *
+ * NOTES: If _exit(2) becomes _way_ more complex this could fail...
+ *
+ */
+
+pid$1::_exit:100
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe
new file mode 100644
index 000000000000..595db1de33da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe
@@ -0,0 +1,29 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 1000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.addprobes.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.addprobes.ksh
new file mode 100644
index 000000000000..6c269ca21899
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.addprobes.ksh
@@ -0,0 +1,61 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+#
+# This test verifies that it's possible to add new pid probes to an existing
+# pid provider.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+sleep 60 &
+pid=$!
+
+$dtrace -n pid$pid:libc::entry -n 'tick-1s{exit(0);}'
+status=$?
+
+if [ $status -gt 0 ]; then
+ exit $status;
+fi
+
+$dtrace -n pid$pid:libc::return -n 'tick-1s{exit(0);}'
+status=$?
+
+if [ $status -gt 0 ]; then
+ exit $status;
+fi
+
+kill $pid
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c
new file mode 100644
index 000000000000..23bbab22f424
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <signal.h>
+#include <unistd.h>
+
+int
+go(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6,
+ int arg7, int arg8, int arg9)
+{
+ return (arg1);
+}
+
+static void
+handle(int sig)
+{
+ go(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+ exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ (void) signal(SIGUSR1, handle);
+ for (;;)
+ getpid();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.d
new file mode 100644
index 000000000000..a3ad6c9a54ab
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.d
@@ -0,0 +1,75 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: test that all 10 arguments are what we expect them to be.
+ *
+ * SECTION: pid provider
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ /*
+ * Wait no more than a second for the first call to getpid(2).
+ */
+ timeout = timestamp + 1000000000;
+}
+
+syscall::getpid:return
+/pid == $1/
+{
+ i = 0;
+ raise(SIGUSR1);
+ /*
+ * Wait half a second after raising the signal.
+ */
+ timeout = timestamp + 500000000;
+}
+
+pid$1:a.out:go:entry
+/arg0 == 0 && arg1 == 1 && arg2 == 2 && arg3 == 3 && arg4 == 4 &&
+arg5 == 5 && arg6 == 6 && arg7 == 7 && arg8 == 8 && arg9 == 9/
+{
+ exit(0);
+}
+
+pid$1:a.out:go:entry
+{
+ printf("wrong args: %d %d %d %d %d %d %d %d %d %d", arg0, arg1, arg2,
+ arg3, arg4, arg5, arg6, arg7, arg8, arg9);
+ exit(1);
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.d
new file mode 100644
index 000000000000..d3d568e7237b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: test that we can trace every instruction safely
+ *
+ * SECTION: pid provider
+ *
+ */
+
+BEGIN
+{
+ /*
+ * Let's just do this for 2 seconds.
+ */
+ timeout = timestamp + 2000000000;
+}
+
+pid$1:a.out::
+{}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe
new file mode 100644
index 000000000000..07e84583e74c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe
@@ -0,0 +1,29 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+while true; do env > /dev/null; done
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.d
new file mode 100644
index 000000000000..e0fada86c7b9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: the stack() action should be empty for all pid probes
+ *
+ * SECTION: pid provider
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ /*
+ * Monitor the program for two seconds.
+ */
+ timeout = timestamp + 1000000000 * 2;
+}
+
+pid$1:::return
+{
+ @[stack()] = sum(0);
+}
+
+pid$1:a.out::
+{
+ @[stack()] = sum(0);
+}
+
+pid$1:::entry
+{
+ @[stack()] = sum(0);
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.d.out
new file mode 100644
index 000000000000..2304a615122f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.d.out
@@ -0,0 +1,3 @@
+
+
+ 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe
new file mode 100644
index 000000000000..a8bc8cb351e9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe
@@ -0,0 +1,29 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+exec find / > /dev/null 2>&1
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c
new file mode 100644
index 000000000000..450c6aae7ac2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <unistd.h>
+
+volatile double c = 1.2;
+
+int
+main(int argc, char **argv)
+{
+ double a = 1.56;
+ double b = (double)argc;
+
+ for (;;) {
+ c *= a;
+ c += b;
+ (void) usleep(1000);
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.d
new file mode 100644
index 000000000000..4e11ee33b103
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Make sure we can work on processes that use the FPU
+ *
+ * SECTION: pid provider
+ */
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+pid$1:a.out:main:
+{}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c
new file mode 100644
index 000000000000..8c2772396a1b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <unistd.h>
+
+int
+waiting(volatile int *a)
+{
+ return (*a);
+}
+
+int
+go(void)
+{
+ int i, j, total = 0;
+
+ for (i = 0; i < 10; i++) {
+ for (j = 0; j < 10; j++) {
+ total += i * j;
+ }
+ }
+
+ return (total);
+}
+
+int
+main(int argc, char **argv)
+{
+ volatile int a = 0;
+
+ while (waiting(&a) == 0)
+ continue;
+
+ (void) fork();
+ (void) go();
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.d
new file mode 100644
index 000000000000..f1b119785c97
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.d
@@ -0,0 +1,86 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: make sure fork(2) is okay
+ *
+ * SECTION: pid provider
+ */
+
+#pragma D option destructive
+
+pid$1:a.out:waiting:entry
+{
+ this->value = (int *)alloca(sizeof (int));
+ *this->value = 1;
+ copyout(this->value, arg0, sizeof (int));
+}
+
+proc:::create
+/pid == $1/
+{
+ child = args[0]->pr_pid;
+ trace(pid);
+}
+
+pid$1:a.out:go:
+/pid == child/
+{
+ trace("wrong pid");
+ exit(1);
+}
+
+proc:::exit
+/pid == $1 || pid == child/
+{
+ out++;
+ trace(pid);
+}
+
+proc:::exit
+/out == 2/
+{
+ exit(0);
+}
+
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c
new file mode 100644
index 000000000000..69df4723dc9f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <spawn.h>
+#include <signal.h>
+#include <stdio.h>
+
+void
+go(void)
+{
+ pid_t pid;
+
+ (void) posix_spawn(&pid, "/bin/ls", NULL, NULL, NULL, NULL);
+
+ (void) waitpid(pid, NULL, 0);
+}
+
+void
+intr(int sig)
+{
+}
+
+int
+main(int argc, char **argv)
+{
+ struct sigaction sa;
+
+ sa.sa_handler = intr;
+ sigfillset(&sa.sa_mask);
+ sa.sa_flags = 0;
+
+ (void) sigaction(SIGUSR1, &sa, NULL);
+
+ for (;;) {
+ go();
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.d
new file mode 100644
index 000000000000..f119098f03b1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: test that we can trace every instruction safely for gcc
+ * compiled apps.
+ *
+ * SECTION: pid provider
+ *
+ */
+
+BEGIN
+{
+ /*
+ * Let's just do this for 2 seconds.
+ */
+ timeout = timestamp + 2000000000;
+}
+
+pid$1:a.out::
+{}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.killonerror.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.killonerror.ksh
new file mode 100644
index 000000000000..587878c3fc2a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.killonerror.ksh
@@ -0,0 +1,41 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+#
+# Make sure we kill a process if the dtrace(1M) command fails.
+#
+
+rc=`$dtrace -c date -n jarod 2>/dev/null | /usr/bin/wc -l`
+
+exit $rc
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.main.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.main.ksh
new file mode 100644
index 000000000000..b3b996014027
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.main.ksh
@@ -0,0 +1,59 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+#
+# Make sure we can trace main:entry properly -- this was problematic because
+# we also set a breakpoint on the same spot in libdtrace.
+#
+
+$dtrace -c date -s /dev/stdin <<EOF
+ BEGIN
+ {
+ status = 1;
+ }
+
+ pid\$target::main:entry
+ {
+ status = 0;
+ }
+
+ END
+ {
+ exit(status);
+ }
+EOF
+
+exit $?
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.manypids.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.manypids.ksh
new file mode 100644
index 000000000000..869339bafb25
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.manypids.ksh
@@ -0,0 +1,70 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+set -A pids
+
+for lib in `ls -1 /lib/lib*.so.1 | grep -v ld.so.1`; do
+ preload=$lib:${preload}
+done
+
+export LD_PRELOAD=$preload
+
+let numkids=100
+let i=0
+
+tmpfile=/tmp/dtest.$$
+
+while [ "$i" -lt "$numkids" ]; do
+ sleep 500 &
+ pids[$i]=$!
+ let i=i+1
+done
+
+export LD_PRELOAD=
+
+let i=0
+
+echo "tick-1sec\n{\n\texit(0);\n}\n" > $tmpfile
+
+while [ "$i" -lt "$numkids" ]; do
+ echo "pid${pids[$i]}::malloc:entry\n{}\n" >> $tmpfile
+ let i=i+1
+done
+
+$dtrace -s $tmpfile
+status=$?
+
+rm $tmpfile
+pkill sleep
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh
new file mode 100644
index 000000000000..35f0391ba87d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh
@@ -0,0 +1,62 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -wZq -x switchrate=100ms -s /dev/stdin <<EOF
+pid*:date::
+{
+ printf("%s:%s\n", probefunc, probename);
+}
+
+tick-1s
+/i++ > 5/
+{
+ exit(0);
+}
+
+tick-1s
+/(i % 2) == 0/
+{
+ system("dtrace -c date -ln 'pid\$target::main:entry' >/dev/null");
+}
+
+tick-1s
+/(i % 2) == 1/
+{
+ system("dtrace -c date -ln 'pid\$target::main:return' >/dev/null");
+}
+EOF
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh.out
new file mode 100644
index 000000000000..b2742c47f91b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh.out
@@ -0,0 +1,7 @@
+main:return
+main:entry
+main:return
+main:entry
+main:return
+main:entry
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.probemod.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.probemod.ksh
new file mode 100644
index 000000000000..326fd1ab9f83
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.probemod.ksh
@@ -0,0 +1,54 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+#
+# Let's see if we can successfully specify a module using partial
+# matches as well as the full module name. We'll use 'libc.so.1'
+# (and therefore 'libc' and 'libc.so') as it's definitely there.
+#
+
+for lib in libc libc.so libc.so.1 'lib[c]*'; do
+ sleep 60 &
+ pid=$!
+ dtrace -n "pid$pid:$lib::entry" -n 'tick-2s{exit(0);}'
+ status=$?
+
+ kill $pid
+
+ if [ $status -gt 0 ]; then
+ exit $status
+ fi
+done
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
new file mode 100644
index 000000000000..7b0824eedd7c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
@@ -0,0 +1,93 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This test verifies that specifying a glob in a pid provider name
+# (e.g., p*d$target) works.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=${TMPDIR:-/tmp}/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > Makefile <<EOF
+all: main
+
+main: main.o
+ cc -o main main.o
+
+main.o: main.c
+ cc -c main.c
+EOF
+
+cat > main.c <<EOF
+void
+go(void)
+{
+}
+
+int
+main(int argc, char **argv)
+{
+ go();
+
+ return (0);
+}
+EOF
+
+make > /dev/null
+if [ $? -ne 0 ]; then
+ print -u2 "failed to build"
+ exit 1
+fi
+
+cat > main.d <<'EOF'
+p*d$target::go:entry
+{
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+}
+EOF
+
+script() {
+ $dtrace -q -s ./main.d -c ./main
+}
+
+script
+status=$?
+
+cd /tmp
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
new file mode 100644
index 000000000000..8951cb381f8c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
@@ -0,0 +1,131 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This test verifies that probes will be picked up after a dlopen(3C)
+# when the pid provider is specified as a glob (e.g., p*d$target.)
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=${TMPDIR:-/tmp}/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > Makefile <<EOF
+all: main altlib.so
+
+main: main.o
+ cc -o main main.o
+
+main.o: main.c
+ cc -c main.c
+
+altlib.so: altlib.o
+ cc -z defs -G -o altlib.so altlib.o -lc
+
+altlib.o: altlib.c
+ cc -c altlib.c
+EOF
+
+cat > altlib.c <<EOF
+void
+go(void)
+{
+}
+EOF
+
+cat > main.c <<EOF
+#include <dlfcn.h>
+#include <unistd.h>
+#include <stdio.h>
+
+void
+go(void)
+{
+}
+
+int
+main(int argc, char **argv)
+{
+ void *alt;
+ void *alt_go;
+
+ go();
+
+ if ((alt = dlopen("./altlib.so", RTLD_LAZY | RTLD_LOCAL))
+ == NULL) {
+ printf("dlopen of altlib.so failed: %s\n", dlerror());
+ return (1);
+ }
+
+ if ((alt_go = dlsym(alt, "go")) == NULL) {
+ printf("failed to lookup 'go' in altlib.so\n");
+ return (1);
+ }
+
+ ((void (*)(void))alt_go)();
+
+ return (0);
+}
+EOF
+
+make > /dev/null
+if [ $? -ne 0 ]; then
+ print -u2 "failed to build"
+ exit 1
+fi
+
+cat > main.d <<'EOF'
+p*d$target::go:entry
+{
+ @foo[probemod, probefunc, probename] = count();
+}
+
+END
+{
+ printa("%s:%s:%s %@u\n",@foo);
+}
+EOF
+
+script() {
+ $dtrace -q -s ./main.d -c ./main
+}
+
+script
+status=$?
+
+cd /tmp
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh.out
new file mode 100644
index 000000000000..824d89856131
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh.out
@@ -0,0 +1,3 @@
+altlib.so:go:entry 1
+main:go:entry 1
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
new file mode 100644
index 000000000000..49e362b33b20
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
@@ -0,0 +1,102 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This test verifies that a regex in the provider name will match
+# USDT probes as well as pid probes (e.g., p*d$target matches both
+# pid$target and pyramid$target.)
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=${TMPDIR:-/tmp}/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > Makefile <<EOF
+ all: main
+
+main: main.o prov.o
+ cc -o main main.o prov.o
+
+main.o: main.c prov.h
+ cc -c main.c
+
+prov.h: prov.d
+ $dtrace -h -s prov.d
+
+prov.o: prov.d main.o
+ $dtrace -G -32 -s prov.d main.o
+EOF
+
+cat > prov.d <<EOF
+provider pyramid {
+ probe entry();
+};
+EOF
+
+cat > main.c <<EOF
+#include <sys/sdt.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ PYRAMID_ENTRY();
+}
+EOF
+
+make > /dev/null
+if [ $? -ne 0 ]; then
+ print -u2 "failed to build"
+ exit 1
+fi
+
+cat > main.d <<'EOF'
+p*d$target::main:entry
+{
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+}
+EOF
+
+script() {
+ $dtrace -q -s ./main.d -c ./main
+}
+
+script
+status=$?
+
+cd /tmp
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh.out
new file mode 100644
index 000000000000..5a8938fe02d9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh.out
@@ -0,0 +1,3 @@
+main:main:entry
+main:main:entry
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
new file mode 100644
index 000000000000..865b9bbee5fd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
@@ -0,0 +1,154 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This test verifies that USDT probes will be picked up after a dlopen(3C)
+# when a regex in the provider name matches both USDT probes and pid probes
+# (e.g., p*d$target matches both pid$target and pyramid$target.)
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=${TMPDIR:-/tmp}/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > Makefile <<EOF
+all: main altlib.so
+
+main: main.o provmain.o
+ cc -o main main.o provmain.o
+
+main.o: main.c prov.h
+ cc -c main.c
+
+prov.h: prov.d
+ $dtrace -h -s prov.d
+
+provmain.o: prov.d main.o
+ $dtrace -G -32 -o provmain.o -s prov.d main.o
+
+altlib.so: altlib.o provalt.o
+ cc -z defs -G -o altlib.so altlib.o provalt.o -lc
+
+altlib.o: altlib.c prov.h
+ cc -c altlib.c
+
+provalt.o: prov.d altlib.o
+ $dtrace -G -32 -o provalt.o -s prov.d altlib.o
+EOF
+
+cat > prov.d <<EOF
+provider pyramid {
+ probe entry();
+};
+EOF
+
+cat > altlib.c <<EOF
+#include <sys/sdt.h>
+#include "prov.h"
+
+void
+go(void)
+{
+ PYRAMID_ENTRY();
+}
+EOF
+
+cat > main.c <<EOF
+#include <dlfcn.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/sdt.h>
+#include "prov.h"
+
+void
+go(void)
+{
+ PYRAMID_ENTRY();
+}
+
+int
+main(int argc, char **argv)
+{
+ void *alt;
+ void *alt_go;
+
+ go();
+
+ if ((alt = dlopen("./altlib.so", RTLD_LAZY | RTLD_LOCAL))
+ == NULL) {
+ printf("dlopen of altlib.so failed: %s\n", dlerror());
+ return (1);
+ }
+
+ if ((alt_go = dlsym(alt, "go")) == NULL) {
+ printf("failed to lookup 'go' in altlib.so\n");
+ return (1);
+ }
+
+ ((void (*)(void))alt_go)();
+
+ return (0);
+}
+EOF
+
+make > /dev/null
+if [ $? -ne 0 ]; then
+ print -u2 "failed to build"
+ exit 1
+fi
+
+cat > main.d <<'EOF'
+p*d$target::go:entry
+{
+ @foo[probemod, probefunc, probename] = count();
+}
+
+END
+{
+ printa("%s:%s:%s %@u\n",@foo);
+}
+EOF
+
+script() {
+ $dtrace -q -s ./main.d -c ./main
+}
+
+script
+status=$?
+
+cd /tmp
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh.out
new file mode 100644
index 000000000000..f4715384f926
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh.out
@@ -0,0 +1,3 @@
+altlib.so:go:entry 2
+main:go:entry 2
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c
new file mode 100644
index 000000000000..cfb88a83dc7f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <signal.h>
+#include <unistd.h>
+
+/*
+ * The canonical name should be 'go' since we prefer symbol names with fewer
+ * leading underscores.
+ */
+
+int a = 100;
+
+int
+help(void)
+{
+ return (a);
+}
+
+int
+go(void)
+{
+ return (help() + 1);
+}
+
+static void
+handle(int sig)
+{
+ go();
+ exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ (void) signal(SIGUSR1, handle);
+ for (;;)
+ getpid();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.d
new file mode 100644
index 000000000000..0305d09868a1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: test that we get the right return value from non-leaf returns
+ *
+ * SECTION: pid provider
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ /*
+ * Wait no more than a second for the first call to getpid(2).
+ */
+ timeout = timestamp + 1000000000;
+}
+
+syscall::getpid:return
+/pid == $1/
+{
+ i = 0;
+ raise(SIGUSR1);
+ /*
+ * Wait half a second after raising the signal.
+ */
+ timeout = timestamp + 500000000;
+}
+
+pid$1:a.out:go:return
+/arg1 == 101/
+{
+ exit(0);
+}
+
+pid$1:a.out:go:return
+{
+ printf("wrong return value: %d", arg1);
+ exit(1);
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c
new file mode 100644
index 000000000000..b64aa0515daa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <signal.h>
+#include <unistd.h>
+
+/*
+ * The canonical name should be 'go' since we prefer symbol names with fewer
+ * leading underscores.
+ */
+
+int a = 100;
+
+int
+go(void)
+{
+ return (a);
+}
+
+static void
+handle(int sig)
+{
+ go();
+ exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ (void) signal(SIGUSR1, handle);
+ for (;;)
+ getpid();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.d
new file mode 100644
index 000000000000..0232948cc3a3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: test that we get the right return value from leaf returns
+ *
+ * SECTION: pid provider
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ /*
+ * Wait no more than a second for the first call to getpid(2).
+ */
+ timeout = timestamp + 1000000000;
+}
+
+syscall::getpid:return
+/pid == $1/
+{
+ i = 0;
+ raise(SIGUSR1);
+ /*
+ * Wait half a second after raising the signal.
+ */
+ timeout = timestamp + 500000000;
+}
+
+pid$1:a.out:go:return
+/arg1 == 100/
+{
+ exit(0);
+}
+
+pid$1:a.out:go:return
+{
+ printf("wrong return value: %d", arg1);
+ exit(1);
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c
new file mode 100644
index 000000000000..76fa711a425a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c
@@ -0,0 +1,65 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <unistd.h>
+
+int
+waiting(volatile int *a)
+{
+ return (*a);
+}
+
+int
+go(void)
+{
+ int i, j, total = 0;
+
+ for (i = 0; i < 10; i++) {
+ for (j = 0; j < 10; j++) {
+ total += i * j;
+ }
+ }
+
+ return (total);
+}
+
+int
+main(int argc, char **argv)
+{
+ volatile int a = 0;
+
+ while (waiting(&a) == 0)
+ continue;
+
+ if (vfork() == 0) {
+ int ret = go();
+ (void) _exit(ret);
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.d
new file mode 100644
index 000000000000..b31bb7f3b361
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: make sure probes called from a vfork(2) child fire in the parent
+ *
+ * SECTION: pid provider
+ */
+
+#pragma D option destructive
+
+pid$1:a.out:waiting:entry
+{
+ this->value = (int *)alloca(sizeof (int));
+ *this->value = 1;
+ copyout(this->value, arg0, sizeof (int));
+}
+
+proc:::create
+/pid == $1/
+{
+ child = args[0]->pr_pid;
+}
+
+pid$1:a.out:go:
+/child != pid/
+{
+ printf("wrong pid (%d %d)", pid, child);
+ exit(1);
+}
+
+syscall::rexit:entry
+/pid == $1/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c
new file mode 100644
index 000000000000..1418f2a3fea4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <signal.h>
+#include <unistd.h>
+
+/*
+ * The canonical name should be 'go' since we prefer symbol names with fewer
+ * leading underscores.
+ */
+
+#pragma weak _go = go
+
+int
+go(int a)
+{
+ return (a + 1);
+}
+
+static void
+handle(int sig)
+{
+ _go(1);
+ exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ (void) signal(SIGUSR1, handle);
+ for (;;)
+ getpid();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.d
new file mode 100644
index 000000000000..458eada0c0ad
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.d
@@ -0,0 +1,83 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: test that we prefer symbols with fewer underscores
+ *
+ * SECTION: pid provider
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ /*
+ * Wait no more than a second for the first call to getpid(2).
+ */
+ timeout = timestamp + 1000000000;
+}
+
+syscall::getpid:return
+/pid == $1/
+{
+ i = 0;
+ raise(SIGUSR1);
+ /*
+ * Wait half a second after raising the signal.
+ */
+ timeout = timestamp + 500000000;
+}
+
+pid$1:a.out:go:entry,
+pid$1:a.out:_go:entry
+/probefunc == "go"/
+{
+ i++;
+}
+
+pid$1:a.out:go:entry,
+pid$1:a.out:_go:entry
+/probefunc == "_go"/
+{
+ trace("resolved to '_go' rather than 'go'");
+ exit(1);
+}
+
+pid$1:a.out:go:entry,
+pid$1:a.out:_go:entry
+/i == 2/
+{
+ exit(0);
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c
new file mode 100644
index 000000000000..8dabbe6e33ac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <signal.h>
+#include <unistd.h>
+
+/*
+ * The canonical name should be 'go' since we prefer symbol names with fewer
+ * leading underscores.
+ */
+
+#pragma weak _go = go
+
+static int
+go(int a)
+{
+ return (a + 1);
+}
+
+static void
+handle(int sig)
+{
+ _go(1);
+ exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ (void) signal(SIGUSR1, handle);
+ for (;;)
+ getpid();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.d
new file mode 100644
index 000000000000..e3688b56c1fd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.d
@@ -0,0 +1,83 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: check that we prefer weak symbols to local ones
+ *
+ * SECTION: pid provider
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ /*
+ * Wait no more than a second for the first call to getpid(2).
+ */
+ timeout = timestamp + 1000000000;
+}
+
+syscall::getpid:return
+/pid == $1/
+{
+ i = 0;
+ raise(SIGUSR1);
+ /*
+ * Wait half a second after raising the signal.
+ */
+ timeout = timestamp + 500000000;
+}
+
+pid$1:a.out:go:entry,
+pid$1:a.out:_go:entry
+/probefunc == "_go"/
+{
+ i++;
+}
+
+pid$1:a.out:go:entry,
+pid$1:a.out:_go:entry
+/probefunc == "go"/
+{
+ trace("resolved to '_go' rather than 'go'");
+ exit(1);
+}
+
+pid$1:a.out:go:entry,
+pid$1:a.out:_go:entry
+/i == 2/
+{
+ exit(0);
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.d
new file mode 100644
index 000000000000..6fc9f2ff36f9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: make sure the plockstat probes are present in libc.
+ */
+
+plockstat$1:libc.so.1::
+{}
+
+profile:::tick-1
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.exe
new file mode 100644
index 000000000000..221e8b1d7434
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.exe
@@ -0,0 +1,29 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 100000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.d
new file mode 100644
index 000000000000..5f755b3fd2f0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: make sure the plockstat probes are present in libc.
+ */
+
+plockstat$1:libc::
+{}
+
+profile:::tick-1
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe
new file mode 100644
index 000000000000..221e8b1d7434
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe
@@ -0,0 +1,29 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 100000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d
new file mode 100644
index 000000000000..3923cd910a14
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION: This test reproduces the alignment error.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ x = (int *)64;
+ y = *x;
+ trace(y);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.ArrayVar.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.ArrayVar.d
new file mode 100644
index 000000000000..b68320876d32
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.ArrayVar.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Trying to access the address of a user defined array variable should throw
+ * a D_ADDROF_VAR error.
+ *
+ * SECTION: Pointers and Arrays/Pointers and Address Spaces
+ */
+
+#pragma D option quiet
+
+int a[5];
+int *p;
+
+BEGIN
+{
+ p = &a;
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.DynamicVar.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.DynamicVar.d
new file mode 100644
index 000000000000..028a30a4c108
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.DynamicVar.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Trying to access the address of a user defined dynamic variable should throw
+ * a D_ADDROF_VAR error.
+ *
+ * SECTION: Pointers and Arrays/Generic Pointers
+ * SECTION: Pointers and Arrays/Pointers to Dtrace Objects
+ */
+
+#pragma D option quiet
+
+int i;
+int *p;
+
+BEGIN
+{
+ i = 10;
+ p = &i;
+
+ printf("Integer: %d, Pointer: %d\n", i, *p);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.agg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.agg.d
new file mode 100644
index 000000000000..8b5926200e8f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.agg.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test that the & operator fails with D_ADDROF_VAR if its operand
+ * is a dynamic variable such as an aggregation.
+ *
+ * SECTION: Pointers and Arrays/Pointers and Addresses
+ * SECTION: Pointers and Arrays/Pointers to Dtrace Objects
+ */
+
+BEGIN
+{
+ @a = count();
+ trace(&@a);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_NONPTR.noptr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_NONPTR.noptr.d
new file mode 100644
index 000000000000..96d25b40dd9b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_NONPTR.noptr.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Can not dereference non-pointers
+ *
+ * SECTION: Pointers and Arrays/Pointer Safety
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+int x;
+
+BEGIN
+{
+ b = *x;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_VOID.VoidPointerDeref.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_VOID.VoidPointerDeref.d
new file mode 100644
index 000000000000..f2fa5b31cb97
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_VOID.VoidPointerDeref.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Cannot dereference a void * pointer.
+ *
+ * SECTION: Pointers and Arrays/Generic Pointers
+ */
+
+#pragma D option quiet
+
+void *p;
+
+int array[3];
+
+BEGIN
+{
+ array[0] = 234;
+ array[1] = 334;
+ array[2] = 434;
+
+ p = &array[0];
+
+ printf("array[0]: %d, p: %d\n", array[0], *p);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_ARRFUN.ArrayAssignment.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_ARRFUN.ArrayAssignment.d
new file mode 100644
index 000000000000..94814a7b7aae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_ARRFUN.ArrayAssignment.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Arrays may not be assigned as a whole in D.
+ *
+ * SECTION: Pointers and Arrays/Pointer and Array Relationship
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+int array1[3];
+int array2[3];
+
+BEGIN
+{
+ array1[0] = 200;
+ array1[1] = 400;
+ array1[2] = 600;
+
+ array2[0] = 300;
+ array2[1] = 500;
+ array2[2] = 700;
+
+ array2 = array1;
+
+ printf("array1[0]: %d\tarray2[0]: %d\n", array1[0], array2[0]);
+ printf("array1[1]: %d\tarray2[1]: %d\n", array1[1], array2[1]);
+ printf("array1[2]: %d\tarray2[2]: %d\n", array1[2], array2[2]);
+
+ exit(0);
+
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_INCOMPAT.VoidPointerArith.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_INCOMPAT.VoidPointerArith.d
new file mode 100644
index 000000000000..e81c2bd86cc0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_INCOMPAT.VoidPointerArith.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * May not apply pointer arithmetic to an object of type void *
+ *
+ * SECTION: Pointers and Arrays/Generic Pointers
+ */
+
+#pragma D option quiet
+
+void *p;
+
+BEGIN
+{
+ printf("p: %d\n", (int) p);
+ printf("p+1: %d\n", (int) (p+1));
+ printf("p+2: %d\n", (int) (p+2));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_LVAL.AddressChange.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_LVAL.AddressChange.d
new file mode 100644
index 000000000000..9828240221a9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_LVAL.AddressChange.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: D pointers do not allow invalid address changes.
+ *
+ * SECTION: Pointers and Arrays/Pointer Safety
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ &`kmem_flags = (int *) 0x185ede4;
+ printf("Address of kmem_flags: %d\n", (int) kmemAddress);
+ printf("Value of kmem_flags: %d\n", `kmem_flags);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.NonPointerAccess.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.NonPointerAccess.d
new file mode 100644
index 000000000000..6f2532770ddf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.NonPointerAccess.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Accessing the members of a struct using the pointer notation using a
+ * nonpointer variable throws a D_OP_PTR error.
+ *
+ * SECTION: Structs and Unions/Pointers to Structs
+ *
+ */
+
+#pragma D option quiet
+
+struct myinput_struct {
+ int i;
+ char c;
+};
+
+struct myinput_struct f;
+
+BEGIN
+{
+ f.i = 10;
+ f.c = 'c';
+
+ printf("f->i: %d\tf->c: %c\n", f->i, f->c);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.badpointer.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.badpointer.d
new file mode 100644
index 000000000000..b1524e539ae1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.badpointer.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * -> can only be used with pointer operands.
+ *
+ * SECTION: Pointers and Arrays/Pointers and Address Spaces
+ */
+
+#pragma D option quiet
+
+struct teststruct {
+ int a;
+ int b;
+};
+
+struct teststruct xyz;
+
+BEGIN
+{
+ xyz->a = 1;
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.BadPointerAccess.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.BadPointerAccess.d
new file mode 100644
index 000000000000..75635773a6b8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.BadPointerAccess.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Accessing a pointer to a struct like a non pointer throws a D_OP_SOU.
+ *
+ * SECTION: Structs and Unions/Pointers to Structs
+ *
+ */
+
+#pragma D option quiet
+
+struct myinput_struct {
+ int i;
+ char c;
+};
+
+struct myinput_struct *f;
+BEGIN
+{
+ f.i = 10;
+ f.c = 'c';
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.badpointer.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.badpointer.d
new file mode 100644
index 000000000000..1b351f3451c9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.badpointer.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * -> can only be used with pointer to structs and unions.
+ *
+ * SECTION: Pointers and Arrays/Pointers and Address Spaces
+ */
+
+#pragma D option quiet
+
+int *abc;
+
+BEGIN
+{
+ abc->a = 1;
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress1.d
new file mode 100644
index 000000000000..9c9d2f0f905b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress1.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: D pointers do not allow invalid pointer accesses.
+ *
+ * SECTION: Pointers and Arrays/Pointer Safety
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ kmemAddress = &`kmem_flags;
+ *kmemAddress = 20;
+ printf("Address of kmem_flags: %d\n", (int) kmemAddress);
+ printf("Value of kmem_flags: %d\n", `kmem_flags);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d
new file mode 100644
index 000000000000..6c79bfa42016
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION: D pointers do not allow invalid pointer accesses.
+ *
+ * SECTION: Pointers and Arrays/Pointer Safety
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ x = (int *)alloca(sizeof (int));
+ trace(x);
+ y = (int *) (x - 3300778156056);
+ *y = 3;
+ trace(*y);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d
new file mode 100644
index 000000000000..66c203061d00
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION: D pointers do not allow invalid pointer accesses.
+ *
+ * SECTION: Pointers and Arrays/Pointer Safety
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ y = (int *)-33007;
+ *y = 3;
+ trace(*y);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d
new file mode 100644
index 000000000000..f5f49e966fcf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION: Demonstrating valid memory access.
+ *
+ * SECTION: Pointers and Arrays/Pointers and Addresses
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ x = (int *)alloca(sizeof (int));
+ printf("Address x: %x\n", (int)x);
+ y = (int *)(x - 2);
+ *y = 3;
+ printf("Address y: %x\tValue: %d\n", (int)y, *y);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d
new file mode 100644
index 000000000000..c4d35e9e3f56
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d
@@ -0,0 +1,84 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ * Using integer arithmetic providing a non-aligned memory address will throw
+ * a runtime error.
+ *
+ * SECTION: Pointers and Arrays/Generic Pointers
+ */
+
+#pragma D option quiet
+
+#if defined(__i386) || defined(__amd64)
+#define __x86 1
+#endif
+
+int array[2];
+char *ptr;
+int *p;
+int *q;
+int *r;
+
+BEGIN
+{
+ array[0] = 0x12345678;
+ array[1] = 0xabcdefff;
+
+ ptr = (char *) &array[0];
+
+ p = (int *) (ptr);
+ q = (int *) (ptr + 2);
+ r = (int *) (ptr + 3);
+
+ printf("*p: 0x%x\n", *p);
+ printf("*q: 0x%x\n", *q);
+ printf("*r: 0x%x\n", *r);
+
+ /*
+ * On x86, the above unaligned memory accesses are allowed and should
+ * not result in the ERROR probe firing.
+ */
+#ifdef __x86
+ exit(1);
+#else
+ exit(0);
+#endif
+}
+
+ERROR
+{
+#ifdef __x86
+ exit(0);
+#else
+ exit(1);
+#endif
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer1.d
new file mode 100644
index 000000000000..fb9db752cf76
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer1.d
@@ -0,0 +1,174 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Declare arrays of different data types and verify that the
+ * addresses of the individual elements differ by an amount equal to the number
+ * elements separating them multiplied by the size of each element.
+ *
+ * SECTION: Pointers and Arrays/Array Declarations and Storage;
+ * Pointers and Arrays/Pointer Arithmetic
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+char char_array[5];
+short short_array[5];
+int int_array[5];
+long long_array[5];
+long long long_long_array[5];
+int8_t int8_array[5];
+int16_t int16_array[5];
+int32_t int32_array[5];
+int64_t int64_array[5];
+intptr_t intptr_array[5];
+uint8_t uint8_array[5];
+uint16_t uint16_array[5];
+uint32_t uint32_array[5];
+uint64_t uint64_array[5];
+uintptr_t uintptr_array[5];
+
+/*
+float float_array[5];
+double double_array[5];
+long double long_double_array[5];
+
+string string_array[5];
+*/
+
+struct record {
+ char ch;
+ int in;
+} struct_array[5];
+
+struct {
+ char ch;
+ int in;
+} anon_struct_array[5];
+
+union record {
+ char ch;
+ int in;
+} union_array[5];
+
+union {
+ char ch;
+ int in;
+} anon_union_array[5];
+
+enum colors {
+ RED,
+ GREEN,
+ BLUE
+} enum_array[5];
+
+BEGIN
+{
+ char_var0 = &char_array[0]; char_var2 = &char_array[2];
+ short_var0 = &short_array[0]; short_var3 = &short_array[3];
+ int_var3 = &int_array[3]; int_var5 = &int_array[5];
+
+ long_var0 = &long_array[0]; long_var4 = &long_array[4];
+ long_long_var0 = &long_long_array[0];
+ long_long_var2 = &long_long_array[2];
+ int8_var3 = &int8_array[3]; int8_var5 = &int8_array[5];
+
+ int16_var0 = &int16_array[0]; int16_var4 = &int16_array[4];
+ int32_var0 = &int32_array[0]; int32_var3 = &int32_array[3];
+ int64_var0 = &int64_array[0]; int64_var1 = &int64_array[1];
+
+ uintptr_var0 = &uintptr_array[0]; uintptr_var2 = &uintptr_array[2];
+ struct_var0 = &struct_array[0]; struct_var2 = &struct_array[2];
+ anon_struct_var3 = &anon_struct_array[3];
+ anon_struct_var5 = &anon_struct_array[5];
+
+ union_var0 = &union_array[0]; union_var3 = &union_array[3];
+ anon_union_var0 = &anon_union_array[0];
+ anon_union_var4 = &anon_union_array[4];
+ enum_var0 = &enum_array[0]; enum_var2 = &enum_array[2];
+
+ printf("char_var2 - char_var0: %d\n",
+ (int) char_var2 - (int) char_var0);
+ printf("short_var3 - short_var0: %d\n",
+ (int) short_var3 - (int) short_var0);
+ printf("int_var5 - int_var3: %d\n", (int) int_var5 - (int) int_var3);
+
+ printf("long_var4 - long_var0: %d\n",
+ (int) long_var4 - (int) long_var0);
+ printf("long_long_var2 - long_long_var0: %d\n",
+ (int) long_long_var2 - (int) long_long_var0);
+ printf("int8_var5 - int8_var3: %d\n",
+ (int) int8_var5 - (int) int8_var3);
+
+ printf("int16_var4 - int16_var0: %d\n",
+ (int) int16_var4 - (int) int16_var0);
+ printf("int32_var3 - int32_var0: %d\n",
+ (int) int32_var3 - (int) int32_var0);
+ printf("int64_var1 - int64_var0: %d\n",
+ (int) int64_var1 - (int) int64_var0);
+
+ printf("uintptr_var2 - uintptr_var0: %d\n",
+ (int) uintptr_var2 - (int) uintptr_var0);
+ printf("struct_var2 - struct_var0: %d\n",
+ (int) struct_var2 - (int) struct_var0);
+ printf("anon_struct_var5 - anon_struct_var3: %d\n",
+ (int) anon_struct_var5 - (int) anon_struct_var3);
+
+ printf("union_var3 - union_var0: %d\n",
+ (int) union_var3 - (int) union_var0);
+ printf("anon_union_var4 - anon_union_var0: %d\n",
+ (int) anon_union_var4 - (int) anon_union_var0);
+ printf("enum_var2 - enum_var0: %d\n",
+ (int) enum_var2 - (int) enum_var0);
+ exit(0);
+}
+
+END
+/(2 != ((int) char_var2 - (int) char_var0)) ||
+ (6 != ((int) short_var3 - (int) short_var0)) ||
+ (8 != ((int) int_var5 - (int) int_var3)) ||
+ ((32 != ((int) long_var4 - (int) long_var0)) &&
+ (16 != ((int) long_var4 - (int) long_var0))) ||
+ (16 != ((int) long_long_var2 - (int) long_long_var0)) ||
+ (2 != ((int) int8_var5 - (int) int8_var3))
+ || (8 != ((int) int16_var4 - (int) int16_var0)) ||
+ (12 != ((int) int32_var3 - (int) int32_var0)) ||
+ (8 != ((int) int64_var1 - (int) int64_var0)) ||
+ ((16 != ((int) uintptr_var2 - (int) uintptr_var0))
+ && (8 != ((int) uintptr_var2 - (int) uintptr_var0))) ||
+ (16 != ((int) struct_var2 - (int) struct_var0)) ||
+ (16 != ((int) anon_struct_var5 - (int) anon_struct_var3))
+ || (12 != ((int) union_var3 - (int) union_var0)) ||
+ (16 != ((int) anon_union_var4 - (int) anon_union_var0)) ||
+ (8 != ((int) enum_var2 - (int) enum_var0))/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer2.d
new file mode 100644
index 000000000000..bf645398797e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer2.d
@@ -0,0 +1,71 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: D permits the use of array [] index notation with both pointer
+ * variables and array variables.
+ *
+ * SECTION: Pointers and Arrays/Pointer and Array Relationship
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+int array[5];
+BEGIN
+{
+ array[0] = 100;
+ array[1] = 200;
+ array[2] = 300;
+ array[3] = 400;
+ array[4] = 500;
+
+ p = &array[0];
+
+ printf("array[0]: %d\tp[0]: %d\n", array[0], p[0]);
+ printf("array[1]: %d\tp[1]: %d\n", array[1], p[1]);
+ printf("array[2]: %d\tp[2]: %d\n", array[2], p[2]);
+ printf("array[3]: %d\tp[3]: %d\n", array[3], p[3]);
+ printf("array[4]: %d\tp[4]: %d\n", array[4], p[4]);
+
+ exit(0);
+
+}
+
+END
+/(array[0] != p[0]) || (array[1] != p[1]) || (array[2] != p[2]) ||
+ (array[3] != p[3]) || (array[4] != p[4])/
+{
+ printf("Error");
+ exit(1);
+}
+
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer3.d
new file mode 100644
index 000000000000..a0be13069785
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer3.d
@@ -0,0 +1,72 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: In D, the an array variable can be assigned to a pointer.
+ *
+ * SECTION: Pointers and Arrays/Pointer and Array Relationship
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+int array[5];
+int *p;
+
+BEGIN
+{
+ array[0] = 100;
+ array[1] = 200;
+ array[2] = 300;
+ array[3] = 400;
+ array[4] = 500;
+
+ p = array;
+
+ printf("array[0]: %d\tp[0]: %d\n", array[0], p[0]);
+ printf("array[1]: %d\tp[1]: %d\n", array[1], p[1]);
+ printf("array[2]: %d\tp[2]: %d\n", array[2], p[2]);
+ printf("array[3]: %d\tp[3]: %d\n", array[3], p[3]);
+ printf("array[4]: %d\tp[4]: %d\n", array[4], p[4]);
+
+ exit(0);
+
+}
+
+END
+/(array[0] != p[0]) || (array[1] != p[1]) || (array[2] != p[2]) ||
+ (array[3] != p[3]) || (array[4] != p[4])/
+{
+ printf("Error");
+ exit(1);
+}
+
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.GlobalVar.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.GlobalVar.d
new file mode 100644
index 000000000000..8b7f36e395a0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.GlobalVar.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Pointer declarations are global.
+ *
+ * SECTION: Pointers and Arrays/Pointers and Addresses
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+ kmemAddress = &`kmem_flags;
+ kmemValue = *kmemAddress;
+ printf("Address of kmem_flags: %x\n", (int) kmemAddress);
+ printf("Value of kmem_flags: %d\n", kmemValue);
+}
+
+profile:::tick-1sec
+/(i < 1) && (&`kmem_flags == kmemAddress) && (*kmemAddress == kmemValue)/
+{
+ exit(1);
+}
+
+END
+/(&`kmem_flags == kmemAddress) && (*kmemAddress == kmemValue)/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.IntegerArithmetic1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.IntegerArithmetic1.d
new file mode 100644
index 000000000000..99cbd7e5ee2a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.IntegerArithmetic1.d
@@ -0,0 +1,72 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Integer arithmetic can be performed on pointers by casting to uintptr_t.
+ *
+ * SECTION: Pointers and Arrays/Generic Pointers
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+int array[3];
+uintptr_t uptr;
+int *p;
+int *q;
+int *r;
+
+BEGIN
+{
+ array[0] = 20;
+ array[1] = 40;
+ array[2] = 80;
+
+ uptr = (uintptr_t) &array[0];
+
+ p = (int *) (uptr);
+ q = (int *) (uptr + 4);
+ r = (int *) (uptr + 8);
+
+ printf("array[0]: %d\t*p: %d\n", array[0], *p);
+ printf("array[1]: %d\t*q: %d\n", array[1], *q);
+ printf("array[2]: %d\t*r: %d\n", array[2], *r);
+
+ exit(0);
+}
+
+END
+/(20 != *p) || (40 != *q) || (80 != *r)/
+{
+ printf("Error");
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic1.d
new file mode 100644
index 000000000000..3a96832530e6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic1.d
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Pointer arithmetic implicitly adjusts the underlying address by
+ * multiplying or dividing the operands by the size of the type referenced
+ * by the pointer.
+ *
+ * SECTION: Pointers and Arrays/Pointer Arithmetic
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+int *x;
+
+BEGIN
+{
+ printf("x: %x\n", (int) x);
+ printf("x + 1: %x\n", (int) (x+1));
+ printf("x + 2: %x\n", (int) (x+2));
+ exit(0);
+}
+
+END
+/(0 != (int) x) || (4 != (int) (x+1)) || (8 != (int) (x+2))/
+{
+ printf("Error");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic2.d
new file mode 100644
index 000000000000..ac55eb448cbf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic2.d
@@ -0,0 +1,72 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * D pointers can be used to refer to consecutive storage locations like
+ * arrays.
+ *
+ * SECTION: Pointers and Arrays/Pointer and Array Relationship
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+int array[5];
+BEGIN
+{
+ array[0] = 100;
+ array[1] = 200;
+ array[2] = 300;
+ array[3] = 400;
+ array[4] = 500;
+
+ p = &array[0];
+
+ printf("array[0]: %d\t*p: %d\n", array[0], *p);
+ printf("array[1]: %d\t*(p+1): %d\n", array[1], *(p+1));
+ printf("array[2]: %d\t*(p+2): %d\n", array[2], *(p+2));
+ printf("array[3]: %d\t*(p+3): %d\n", array[3], *(p+3));
+ printf("array[4]: %d\t*(p+4): %d\n", array[4], *(p+4));
+
+ exit(0);
+
+}
+
+END
+/(array[0] != *p) || (array[1] != *(p+1)) || (array[2] != *(p+2))
+ || (array[3] != *(p+3)) || (array[4] != *(p+4))/
+{
+ printf("Error");
+ exit(1);
+}
+
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic3.d
new file mode 100644
index 000000000000..a4f4bfc4834d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic3.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Pointer arithmetic implicitly adjusts the underlying address by
+ * multiplying or dividing the operands by the size of the type referenced
+ * by the pointer.
+ *
+ * SECTION: Pointers and Arrays/Pointer Arithmetic
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+int *x;
+int *y;
+int a[5];
+
+BEGIN
+{
+ x = &a[0];
+ y = &a[2];
+
+ printf("y-x: %x\n", (int) (y-x));
+ exit(0);
+}
+
+END
+/(2 != (int) (y-x)) /
+{
+ printf("Error");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerAssignment.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerAssignment.d
new file mode 100644
index 000000000000..3a4968695dcf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerAssignment.d
@@ -0,0 +1,71 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Pointers assignment simply copies over the pointer address in the
+ * variable on the right hand side into the variable on the left hand side.
+ *
+ * SECTION: Pointers and Arrays/Pointer and Array Relationship
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+int array[3];
+int *ptr1;
+int *ptr2;
+
+BEGIN
+{
+ array[0] = 200;
+ array[1] = 400;
+ array[2] = 600;
+
+ ptr1 = array;
+ ptr2 = ptr1;
+
+ ptr2[0] = 400;
+ ptr2[1] = 800;
+ ptr2[2] = 1200;
+
+ printf("array[0]: %d\tptr2[0]: %d\n", array[0], ptr2[0]);
+ printf("array[1]: %d\tptr2[1]: %d\n", array[1], ptr2[1]);
+ printf("array[2]: %d\tptr2[2]: %d\n", array[2], ptr2[2]);
+
+ exit(0);
+
+}
+
+END
+/(array[0] != 400) || (array[1] != 800) || (array[2] != 1200)/
+{
+ printf("Error");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer1.d
new file mode 100644
index 000000000000..5d9db388cbb3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer1.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Demonstrating valid memory access.
+ *
+ * SECTION: Pointers and Arrays/Pointers and Addresses
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ x = (int *)alloca(sizeof (int));
+ printf("Address x: %x\n", (int) x);
+ y = (int *) (x);
+ *y = 3;
+ printf("Address y: %x\tValue: %d\n", (int) y, *y);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer2.d
new file mode 100644
index 000000000000..26d698aea3b2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer2.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Demonstrating valid memory access.
+ *
+ * SECTION: Pointers and Arrays/Pointers and Addresses
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ x = (int *)alloca(sizeof (int));
+ printf("Address x: %x\n", (int) x);
+ y = (int *) (x + 2);
+ *y = 3;
+ printf("Address y: %x\tValue: %d\n", (int) y, *y);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.VoidCast.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.VoidCast.d
new file mode 100644
index 000000000000..296fdf408fc7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.VoidCast.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Can dereference a void * pointer only by casting it to another type.
+ *
+ * SECTION: Pointers and Arrays/Generic Pointers
+ */
+
+#pragma D option quiet
+
+void *p;
+
+int array[3];
+
+BEGIN
+{
+ array[0] = 234;
+ array[1] = 334;
+ array[2] = 434;
+
+ p = &array[0];
+ newp = (int *) p;
+
+ printf("array[0]: %d, newp: %d\n", array[0], *newp);
+ exit(0);
+}
+
+END
+/234 != *newp/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.basic1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.basic1.d
new file mode 100644
index 000000000000..bf3154a0d2cf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.basic1.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Pointers can be stored in variables.
+ *
+ * SECTION: Pointers and Arrays/Pointers and Addresses
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ kmemAddress = &`kmem_flags;
+ kmemValue = *kmemAddress;
+ printf("Address of kmem_flags: %x\n", (int) kmemAddress);
+ printf("Value of kmem_flags: %d\n", kmemValue);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.basic2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.basic2.d
new file mode 100644
index 000000000000..6b72b632e53d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.basic2.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Pointers can be stored in associative arrays.
+ *
+ * SECTION: Pointers and Arrays/Pointers and Addresses
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ assoc_array["kmemAddress"] = &`kmem_flags;
+ kmemValue = *(assoc_array["kmemAddress"]);
+ printf("Address of kmem_flags: %x\n", (int) assoc_array["kmemAddress"]);
+ printf("Value of kmem_flags: %d\n", kmemValue);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGERR.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGERR.d
new file mode 100644
index 000000000000..863ddc863a17
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGERR.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify pragma errors
+ *
+ * SECTION: Pragmas
+ */
+
+
+#pragma D error "this is an error message"
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_DEPEND.main.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_DEPEND.main.d
new file mode 100644
index 000000000000..0b5a3402b874
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_DEPEND.main.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * It isn't permitted for a main program to contain a depends_on imperative.
+ */
+
+#pragma D depends_on library net.d
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_INVAL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_INVAL.d
new file mode 100644
index 000000000000..c6fd1471bad1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_INVAL.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify invalid attributes
+ *
+ * SECTION: Pragmas;
+ * Stabilty/Interface Attributes
+ */
+
+
+inline int foo
+
+#pragma D attributes incorrect_attr foo
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_MALFORM.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_MALFORM.d
new file mode 100644
index 000000000000..7f0ba2329b98
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_MALFORM.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify malformed pragma argument list
+ *
+ * SECTION: Pragmas
+ */
+
+
+#pragma D attributes incorrect_attr
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_UNUSED.UnusedPragma.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_UNUSED.UnusedPragma.d
new file mode 100644
index 000000000000..da2336bc2b69
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_UNUSED.UnusedPragma.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Unused pragmas throw error D_PRAGMA_UNUSED
+ *
+ * SECTION: Errtags/D_PRAGMA_UNUSED
+ *
+ */
+
+void func(int, int);
+
+#pragma D option quiet
+#pragma D attributes Stable/Stable/Common func;
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.circlibdep.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.circlibdep.ksh
new file mode 100644
index 000000000000..6fbace8d1a87
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.circlibdep.ksh
@@ -0,0 +1,58 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+libdir=${TMPDIR:-/tmp}/libdep.$$
+dtrace=$1
+
+setup_libs()
+{
+ mkdir $libdir
+ cat > $libdir/liba.$$.d <<EOF
+#pragma D depends_on library libb.$$.d
+EOF
+ cat > $libdir/libb.$$.d <<EOF
+#pragma D depends_on library libc.$$.d
+EOF
+ cat > $libdir/libc.$$.d <<EOF
+#pragma D depends_on library liba.$$.d
+EOF
+}
+
+
+setup_libs
+
+$dtrace -L$libdir -e
+
+status=$?
+rm -rf $libdir
+return $status
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.invalidlibdep.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.invalidlibdep.ksh
new file mode 100644
index 000000000000..b05ae3dcf877
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.invalidlibdep.ksh
@@ -0,0 +1,57 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+libdir=${TMPDIR:-/tmp}/libdep.$$
+dtrace=$1
+
+setup_libs()
+{
+ mkdir $libdir
+ cat > $libdir/liba.$$.d <<EOF
+#pragma D depends_on library libnotthere.$$.d
+EOF
+ cat > $libdir/libb.$$.d <<EOF
+#pragma D depends_on library libc.$$.d
+EOF
+ cat > $libdir/libc.$$.d <<EOF
+#pragma D depends_on library liba.$$.d
+EOF
+}
+
+
+setup_libs
+
+$dtrace -L$libdir -e
+
+status=$?
+rm -rf $libdir
+return $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh
new file mode 100644
index 000000000000..7c92243f25f1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh
@@ -0,0 +1,58 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+libdir=${TMPDIR:-/tmp}/libdep.$$
+dtrace=$1
+
+setup_libs()
+{
+ mkdir $libdir
+ cat > $libdir/liba.$$.d <<EOF
+#pragma D depends_on library libb.$$.d
+
+inline int foo = bar;
+EOF
+ cat > $libdir/libb.$$.d <<EOF
+#pragma D depends_on module doogle_knows_all_probes
+
+inline int bar = 0xd0061e;
+EOF
+}
+
+
+setup_libs
+
+$dtrace -L$libdir -e
+
+status=$?
+rm -rf $libdir
+return $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdep.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdep.ksh
new file mode 100644
index 000000000000..38b34606c6ff
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdep.ksh
@@ -0,0 +1,66 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+libdir=${TMPDIR:-/tmp}/libdep.$$
+dtrace=$1
+
+setup_libs()
+{
+ mkdir $libdir
+ cat > $libdir/liba.$$.d <<EOF
+#pragma D depends_on library libb.$$.d
+#pragma D depends_on library libc.$$.d
+#pragma D depends_on library libd.$$.d
+EOF
+ cat > $libdir/libb.$$.d <<EOF
+#pragma D depends_on library libc.$$.d
+EOF
+ cat > $libdir/libc.$$.d <<EOF
+EOF
+ cat > $libdir/libd.$$.d <<EOF
+EOF
+ cat > $libdir/libe.$$.d <<EOF
+#pragma D depends_on library liba.$$.d
+EOF
+ cat > $libdir/libf.$$.d <<EOF
+EOF
+}
+
+
+setup_libs
+
+$dtrace -L$libdir -e
+
+status=$?
+rm -rf $libdir
+return $status
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepfullyconnected.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepfullyconnected.ksh
new file mode 100644
index 000000000000..e95de696dd23
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepfullyconnected.ksh
@@ -0,0 +1,100 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This test verifies that we can generate the correct ordering for
+# a given dependency specification. All files either have a dependency
+# on another file or are the dependent of another file. In this way we
+# guarantee consistent ordering as no nodes in the dependency graph will
+# be isolated.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+tmpfile=/tmp/libdeporder.$$
+libdir=${TMPDIR:-/tmp}/libdep.$$
+dtrace=$1
+
+setup_libs()
+{
+ mkdir $libdir
+ cat > $libdir/liba.$$.d <<EOF
+#pragma D depends_on library libd.$$.d
+EOF
+ cat > $libdir/libb.$$.d <<EOF
+EOF
+ cat > $libdir/libc.$$.d <<EOF
+#pragma D depends_on library libe.$$.d
+EOF
+ cat > $libdir/libd.$$.d <<EOF
+#pragma D depends_on library libb.$$.d
+EOF
+ cat > $libdir/libe.$$.d <<EOF
+#pragma D depends_on library liba.$$.d
+EOF
+}
+
+
+setup_libs
+
+DTRACE_DEBUG=1 $dtrace -L$libdir -e >$tmpfile 2>&1
+
+perl /dev/stdin $tmpfile <<EOF
+
+ @order = qw(libc libe liba libd libb);
+
+ while (<>) {
+ if (\$_ =~ /lib[a-e]\.[0-9]+.d/) {
+ \$pos = length \$_;
+ for (\$i=0; \$i<=1;\$i++) {
+ \$pos = rindex(\$_, "/", \$pos);
+ \$pos--;
+ }
+
+ push(@new, substr(\$_, \$pos+2, 4));
+ next;
+ }
+ next;
+ }
+
+ exit 1 if @new != @order;
+
+ while (@new) {
+ exit 1 if pop(@new) ne pop(@order);
+ }
+
+ exit 0;
+EOF
+
+
+status=$?
+rm -rf $libdir
+rm $tmpfile
+return $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh
new file mode 100644
index 000000000000..ced65849b98d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh
@@ -0,0 +1,76 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2011, Joyent Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Test to catch that we properly look for libraries dependencies in
+# our full library parth
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+libdira=${TMPDIR:-/tmp}/libdepa.$$
+libdirb=${TMPDIR:-/tmp}/libdepb.$$
+libdirc=${TMPDIR:-/tmp}/libdepc.$$
+dtrace=$1
+
+setup_libs()
+{
+ mkdir $libdira
+ mkdir $libdirb
+ mkdir $libdirc
+ cat > $libdira/liba.$$.d <<EOF
+#pragma D depends_on library libb.$$.d
+#pragma D depends_on library libc.$$.d
+#pragma D depends_on library libd.$$.d
+EOF
+ cat > $libdirb/libb.$$.d <<EOF
+#pragma D depends_on library libc.$$.d
+EOF
+ cat > $libdirb/libc.$$.d <<EOF
+EOF
+ cat > $libdirb/libd.$$.d <<EOF
+EOF
+ cat > $libdirc/libe.$$.d <<EOF
+#pragma D depends_on library liba.$$.d
+EOF
+ cat > $libdirc/libf.$$.d <<EOF
+EOF
+}
+
+
+setup_libs
+
+$dtrace -L$libdira -L$libdirb -L$libdirc -e
+
+status=$?
+rm -rf $libdira
+rm -rf $libdirb
+rm -rf $libdirc
+return $status
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh
new file mode 100644
index 000000000000..f09c71fa59c7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh
@@ -0,0 +1,106 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012 by Delphix. All rights reserved.
+#
+
+############################################################################
+# ASSERTION:
+# temporal option causes output to be sorted
+#
+# SECTION: Pragma
+#
+# NOTES: The temporal option has no effect on a single-CPU system, so
+# this needs to be run on a multi-CPU system to effectively test the
+# temporal option.
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+file=/tmp/out.$$
+
+rm -f $file
+
+$dtrace -o $file -c 'sleep 3' -s /dev/stdin <<EOF
+ #pragma D option quiet
+ #pragma D option temporal
+
+ BEGIN
+ {
+ @lines = count();
+ printf("0 begin\n");
+ }
+
+ END
+ {
+ /* Bump @lines every time we print a line. */
+ @lines = count();
+ printf("%u end\n", timestamp);
+ @lines = count();
+ printa("99999999999999999 lines %@u\n", @lines);
+ }
+
+ profile-97hz
+ {
+ @lines = count();
+ printf("%u\n", timestamp);
+ }
+EOF
+
+status=$?
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+ exit $status
+fi
+
+# dtrace outputs a blank line at the end, which will sort to the beginning,
+# so use sed to remove the blank line.
+sed '$d' $file > $file.2
+
+sort -n $file.2 | diff $file.2 -
+status=$?
+if [ "$status" -ne 0 ]; then
+ echo $tst: output is not sorted
+ exit $status
+fi
+
+head -n 1 $file.2 | grep begin >/dev/null
+status=$?
+if [ "$status" -ne 0 ]; then
+ echo $tst: begin probe did not fire
+ exit $status
+fi
+
+tail -n 2 $file.2 | grep end >/dev/null
+status=$?
+if [ "$status" -ne 0 ]; then
+ echo $tst: end probe did not fire
+ exit $status
+fi
+
+if [ $(tail -n 1 $file.2 | cut -f3 -d ' ') -ne \
+ $(wc -l $file.2) ]; then
+ echo $tst: incorrect number of lines output
+ exit 1
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh
new file mode 100644
index 000000000000..05b078a7d216
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh
@@ -0,0 +1,102 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012 by Delphix. All rights reserved.
+#
+
+############################################################################
+# ASSERTION:
+# temporal option causes output to be sorted, even when some
+# buffers are empty
+#
+# SECTION: Pragma
+#
+# NOTES: The temporal option has no effect on a single-CPU system, so
+# this needs to be run on a multi-CPU system to effectively test the
+# temporal option.
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+file=/tmp/out.$$
+
+rm -f $file
+
+$dtrace -o $file -s /dev/stdin <<EOF
+ #pragma D option quiet
+ #pragma D option destructive
+ #pragma D option temporal
+ #pragma D option switchrate=1000hz
+
+ /*
+ * Use two enablings of the same probe, so that cpu 0 will always
+ * record its data just a little bit before the other cpus.
+ * We don't want to use the chill() action in the same enabling
+ * that we record the timestamp, because chill() causes the
+ * timestamp to be re-read, and thus not match the timestamp
+ * which libdtrace uses to sort the records.
+ */
+
+ profile-401
+ /cpu == 0/
+ {
+ printf("%d\n", timestamp);
+ }
+
+ profile-401
+ /cpu != 0/
+ {
+ chill(1000); /* one microsecond */
+ }
+
+ profile-401
+ /cpu != 0/
+ {
+ printf("%d\n", timestamp);
+ }
+
+ tick-1s
+ /k++ == 10/
+ {
+ printf("%d\n", timestamp);
+ exit(0);
+ }
+EOF
+
+status=$?
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+ exit $status
+fi
+
+# dtrace outputs a blank line at the end, which will sort to the beginning,
+# so use sed to remove the blank line.
+sed '$d' $file > $file.2
+
+sort -n $file.2 | diff $file.2 -
+status=$?
+if [ "$status" -ne 0 ]; then
+ echo $tst: output is not sorted
+ exit $status
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d
new file mode 100644
index 000000000000..b4c0e557bea1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * This test excercises the "remnant" handling of the temporal option.
+ * At the end of one pass of retrieving and printing data from all CPUs,
+ * some unprocessed data will remain, because its timestamp is after the
+ * time covered by all CPUs' buffers. This unprocessed data is
+ * rearranged in a more space-efficient manner. If this is done
+ * incorrectly, an alignment error may occur. To test this, we use a
+ * high-frequency probe so that data will be recorded in subsequent
+ * CPU's buffers after the first CPU's buffer is obtained. The
+ * combination of data traced here (a 8-byte value and a 4-byte value)
+ * is effective to cause alignment problems with an incorrect
+ * implementation.
+ *
+ * This test needs to be run on a multi-CPU system to be effective.
+ */
+
+#pragma D option quiet
+#pragma D option temporal
+
+profile-4997
+{
+ printf("%u %u", 1ULL, 2);
+}
+
+tick-1
+/i++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d
new file mode 100644
index 000000000000..5f02b7a49225
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Predicate result must be of scalar type.
+ *
+ * SECTION: Errtags/ D_PRED_SCALAR
+ *
+ */
+
+#pragma D option quiet
+int a[4];
+
+BEGIN
+/a/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d
new file mode 100644
index 000000000000..391d4256f793
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple if,then operation test.
+ * Call invalid conditions and make sure it gives compilation error.
+ *
+ * SECTION: Program Structure/Predicates
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile-1
+/i < != > 10/
+{
+ i++;
+ trace(i);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d
new file mode 100644
index 000000000000..8ffab279aa31
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple if,then operations test.
+ * Call impossible conditions and make sure compilation fails.
+ *
+ * SECTION: Program Structure/Predicates
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile-1
+/i != 0 && >= 5 || <= 10/
+{
+ i++;
+ trace(i);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d
new file mode 100644
index 000000000000..f461c5ddfaf3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+int schedules;
+int executes;
+
+/*
+ * This script is a bit naughty: it's assuming the implementation of the
+ * VM system's page scanning. If this implementation changes -- either by
+ * changing the function that scans pages or by making that scanning
+ * multithreaded -- this script will break.
+ */
+fbt::timeout:entry
+/args[0] == (void *)&genunix`schedpaging/
+{
+ schedules++;
+}
+
+fbt::schedpaging:entry
+/executes == 10/
+{
+ printf("%d schedules, %d executes\n", schedules, executes);
+ exit(executes == schedules ? 0 : 1);
+}
+
+fbt::schedpaging:entry
+{
+ executes++;
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.basics.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.basics.d
new file mode 100644
index 000000000000..9b43b6198a17
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.basics.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple if,then operations test.
+ * Call simple expressions and make sure test satisfy conditions.
+ * Match expected output in tst.basics.d.out
+ *
+ * SECTION: Program Structure/Predicates
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i < 10/
+{
+ i++;
+ trace(i);
+}
+
+tick-10ms
+/i == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out
new file mode 100644
index 000000000000..2a5b99aac6cd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out
@@ -0,0 +1 @@
+12345678910
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.complex.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.complex.d
new file mode 100644
index 000000000000..d08543f06013
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.complex.d
@@ -0,0 +1,126 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Complex operations and if,then test.
+ * Call 'n' permutation and combination of operations over if,then.
+ * Match expected output in tst.complex.d.out
+ *
+ * SECTION: Program Structure/Predicates
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+ j = 0;
+}
+
+tick-10ms
+/i < 10/
+{
+ i++;
+ j++;
+ printf("\n\n%d\n------\n", i);
+}
+
+tick-10ms
+/i == 5 || i == 10/
+{
+ printf("i == 5 (or) i == 10\n");
+}
+
+tick-10ms
+/i <= 5/
+{
+ printf("i <= 5\n");
+}
+
+tick-10ms
+/j >= 5/
+{
+ printf("j >= 5\n");
+}
+
+tick-10ms
+/j >= 5 || i <= 5/
+{
+ printf("i >= 5 || j >= 5\n");
+}
+
+tick-10ms
+/j >= 5 && i <= 5/
+{
+ printf("j >= 5 && i <= 55\n");
+}
+
+tick-10ms
+/i < 5/
+{
+ printf("i < 5\n");
+}
+
+tick-10ms
+/i == 2 || j == 2/
+{
+ printf("i == 2 (or) j == 2\n");
+}
+
+tick-10ms
+/i == 2 && j == 2/
+{
+ printf("i == 2 (and) j == 2\n");
+}
+
+tick-10ms
+/j != 10/
+{
+ printf("j != 10\n");
+}
+
+tick-10ms
+/j == 5 || i == 2/
+{
+ printf("j == 5 || i == 2\n");
+}
+
+tick-10ms
+/j == 5 && i == 2/
+{
+ printf("j == 5 && i == 2\n");
+}
+
+tick-10ms
+/i == 10/
+{
+ printf("i == 10\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out
new file mode 100644
index 000000000000..5f16dbdbcc13
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out
@@ -0,0 +1,83 @@
+
+
+1
+------
+i <= 5
+i >= 5 || j >= 5
+i < 5
+j != 10
+
+
+2
+------
+i <= 5
+i >= 5 || j >= 5
+i < 5
+i == 2 (or) j == 2
+i == 2 (and) j == 2
+j != 10
+j == 5 || i == 2
+
+
+3
+------
+i <= 5
+i >= 5 || j >= 5
+i < 5
+j != 10
+
+
+4
+------
+i <= 5
+i >= 5 || j >= 5
+i < 5
+j != 10
+
+
+5
+------
+i == 5 (or) i == 10
+i <= 5
+j >= 5
+i >= 5 || j >= 5
+j >= 5 && i <= 55
+j != 10
+j == 5 || i == 2
+
+
+6
+------
+j >= 5
+i >= 5 || j >= 5
+j != 10
+
+
+7
+------
+j >= 5
+i >= 5 || j >= 5
+j != 10
+
+
+8
+------
+j >= 5
+i >= 5 || j >= 5
+j != 10
+
+
+9
+------
+j >= 5
+i >= 5 || j >= 5
+j != 10
+
+
+10
+------
+i == 5 (or) i == 10
+j >= 5
+i >= 5 || j >= 5
+i == 10
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh
new file mode 100644
index 000000000000..f06edcb5a4ec
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh
@@ -0,0 +1,197 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+unload()
+{
+ #
+ # Get the list of services whose processes have USDT probes. Ideally
+ # it would be possible to unload the fasttrap provider while USDT
+ # probes exist -- once that fix is integrated, this hack can go away
+ # We create two lists -- one of regular SMF services and one of legacy
+ # services -- since each must be enabled and disabled using a specific
+ # mechanism.
+ #
+ pids=$(dtrace -l | \
+ perl -ne 'print "$1\n" if (/^\s*\S+\s+\S*\D(\d+)\s+/);' | \
+ sort | uniq | tr '\n' ',')
+
+ ctids=$(ps -p $pids -o ctid | tail +2 | sort | uniq)
+ svcs=
+ lrcs=
+
+ for ct in $ctids
+ do
+ line=$(svcs -o fmri,ctid | grep " $ct\$")
+ svc=$(echo $line | cut -d' ' -f1)
+
+ if [[ $(svcs -Ho STA $svc) == "LRC" ]]; then
+ lrc=$(svcs -Ho SVC $svc | tr _ '?')
+ lrcs="$lrcs $lrc"
+ else
+ svcs="$svcs $svc"
+ fi
+ done
+
+ for svc in $svcs
+ do
+ svcadm disable -ts $svc
+ done
+
+ for lrc in $lrcs
+ do
+ #
+ # Does it seem a little paternalistic that lsvcrun requires
+ # this environment variable to be set? I'd say so...
+ #
+ SMF_RESTARTER=svc:/system/svc/restarter:default \
+ /lib/svc/bin/lsvcrun $lrc stop
+ done
+
+ modunload -i 0
+ modunload -i 0
+ modunload -i 0
+ modinfo | grep dtrace
+ success=$?
+
+ for svc in $svcs
+ do
+ svcadm enable -ts $svc
+ done
+
+ for lrc in $lrcs
+ do
+ SMF_RESTARTER=svc:/system/svc/restarter:default \
+ /lib/svc/bin/lsvcrun $lrc start
+ done
+
+ if [ ! $success ]; then
+ echo $tst: could not unload dtrace
+ exit 1
+ fi
+}
+
+script1()
+{
+ $dtrace -s /dev/stdin <<EOF
+ syscall:::entry
+ /pid != $ppid/
+ {
+ @a[probefunc] = count();
+ }
+
+ tick-1sec
+ /i++ == 5/
+ {
+ exit(0);
+ }
+EOF
+}
+
+script2()
+{
+ $dtrace -s /dev/stdin <<EOF
+
+ #pragma D option statusrate=1ms
+
+ syscall:::entry
+ /pid == $ppid/
+ {
+ ttl++;
+ }
+
+ tick-1sec
+ /i++ == 5/
+ {
+ exit(2);
+ }
+
+ END
+ /ttl/
+ {
+ printf("success; ttl is %d", ttl);
+ exit(0);
+ }
+
+ END
+ /ttl == 0/
+ {
+ printf("error -- total should be non-zero");
+ exit(1);
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+ppid=$$
+dtrace=$1
+
+unload
+script1 &
+child=$!
+
+let waited=0
+
+while [ "$waited" -lt 5 ]; do
+ seconds=`date +%S`
+
+ if [ "$seconds" -ne "$last" ]; then
+ last=$seconds
+ let waited=waited+1
+ fi
+done
+
+wait $child
+status=$?
+
+if [ "$status" -ne 0 ]; then
+ echo $tst: first dtrace failed
+ exit $status
+fi
+
+unload
+script2 &
+child=$!
+
+let waited=0
+
+while [ "$waited" -lt 10 ]; do
+ seconds=`date +%S`
+
+ if [ "$seconds" -ne "$last" ]; then
+ last=$seconds
+ let waited=waited+1
+ fi
+done
+
+wait $child
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_IDENT_UNDEF.afterprobe.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_IDENT_UNDEF.afterprobe.d
new file mode 100644
index 000000000000..ac63b43e3409
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_IDENT_UNDEF.afterprobe.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ *
+ * Declare 'ifdef' statements after probe clause definition and
+ * attempt to print the value before that.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
+#if !defined (FLAG)
+#define VALUE 5
+#endif
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d
new file mode 100644
index 000000000000..e79ad2e56782
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call #define statement not in first column, just after a tab.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+ #define VALUE 5
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The VALUE is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_SYNTAX.withoutpound.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_SYNTAX.withoutpound.d
new file mode 100644
index 000000000000..aac2bcf92859
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_SYNTAX.withoutpound.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Just call a 'define' statement without '#'
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+define VALUE 5
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.defincomp.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.defincomp.d
new file mode 100644
index 000000000000..750ce6dd1c03
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.defincomp.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a incomplete #define statement
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#define
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefelsenotendif.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefelsenotendif.d
new file mode 100644
index 000000000000..6ad696a7b691
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefelsenotendif.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call ifdef statement without endif statement.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if !defined (FLAG)
+#define RETURN 5
+#else
+#define RETURN 10
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", RETURN);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefincomp.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefincomp.d
new file mode 100644
index 000000000000..37c637c91bd2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefincomp.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call a 'if !defined' incomplete statement.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if !defined
+#define VALUE 5
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefnotendif.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefnotendif.d
new file mode 100644
index 000000000000..09fdb170efe5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefnotendif.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Call a complete '!ifdefine' statement but without 'endif' statement.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if !defined (FLAG)
+#define VALUE 5
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.incompelse.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.incompelse.d
new file mode 100644
index 000000000000..ee92f69cef5c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.incompelse.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Just call a #else statement
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#else
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.mulelse.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.mulelse.d
new file mode 100644
index 000000000000..958f4e2b1757
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.mulelse.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Attempt to declare a multiple else 'ifdef' declarations.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if !defined (FLAG)
+#define VALUE 5
+#else
+#define VALUE 10
+#else
+#define VALUE 15
+#else
+#define VALUE 20
+#endif
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d
new file mode 100644
index 000000000000..a17ee0e21f40
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple test to test 'if defined' 'defined' 'else' 'endif'
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if defined (FLAG)
+#define VALUE 5
+#else
+#define VALUE 10
+#endif
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d.out
new file mode 100644
index 000000000000..2bde5e931ce2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d.out
@@ -0,0 +1,2 @@
+The value is 10
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d
new file mode 100644
index 000000000000..b40cf012c372
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple test for 'ifndef'.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#ifndef FLAG
+#define FLAG
+#endif
+
+#if defined (FLAG)
+#define VALUE 5
+#else
+#define VALUE 10
+#endif
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d.out
new file mode 100644
index 000000000000..d51d19fc8c60
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d.out
@@ -0,0 +1,2 @@
+The value is 5
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d
new file mode 100644
index 000000000000..345a82f7247e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple if !defined, define, else and endif test
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if !defined (FLAG)
+#define VALUE 5
+#else
+#define VALUE 10
+#endif
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d.out
new file mode 100644
index 000000000000..d51d19fc8c60
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d.out
@@ -0,0 +1,2 @@
+The value is 5
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d
new file mode 100644
index 000000000000..c8ea3481665a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple !defined, logical 'and' (&&) test.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if !defined (FLAG) && !defined(STATUS)
+#define VALUE 0
+#else
+#define VALUE 1
+#endif
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d.out
new file mode 100644
index 000000000000..350295cc2516
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d.out
@@ -0,0 +1,2 @@
+The value is 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d
new file mode 100644
index 000000000000..63637d3cf9fb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple !defined logical-or(||) and logical-and(&&) test.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if !defined (FLAG) || !defined(STATUS) && !defined(STATE)
+#define VALUE 0
+#else
+#define VALUE 1
+#endif
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d.out
new file mode 100644
index 000000000000..350295cc2516
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d.out
@@ -0,0 +1,2 @@
+The value is 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d
new file mode 100644
index 000000000000..b99ee1dd0359
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * if !defined (logical-or) usage.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if !defined (FLAG) || !defined(STATUS)
+#define VALUE 0
+#else
+#define VALUE 1
+#endif
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d.out
new file mode 100644
index 000000000000..350295cc2516
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d.out
@@ -0,0 +1,2 @@
+The value is 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d
new file mode 100644
index 000000000000..9bca2cb07866
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * if !defined multiple logical-and(&&) usage.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if !defined (FLAG) && !defined(STATUS) && !defined(STATE)
+#define VALUE 0
+#else
+#define VALUE 1
+#endif
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d.out
new file mode 100644
index 000000000000..350295cc2516
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d.out
@@ -0,0 +1,2 @@
+The value is 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d
new file mode 100644
index 000000000000..1d0c4d974358
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple multiple ifdefined logical-or(||) test.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if !defined (FLAG) || !defined(STATUS) || !defined(STATE)
+#define VALUE 0
+#else
+#define VALUE 1
+#endif
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d.out
new file mode 100644
index 000000000000..350295cc2516
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d.out
@@ -0,0 +1,2 @@
+The value is 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d
new file mode 100644
index 000000000000..1d21d47295ca
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple #define test.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#define value 5
+
+
+#pragma D option quiet
+
+tick-10ms
+/value == 5/
+{
+ printf("The value is %d\n", value);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d.out
new file mode 100644
index 000000000000..d51d19fc8c60
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d.out
@@ -0,0 +1,2 @@
+The value is 5
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.predicatedeclare.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.predicatedeclare.d
new file mode 100644
index 000000000000..db5e94bb0a79
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.predicatedeclare.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Attempt to declare 'ifdef' statement inbetween probe declaration
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-10ms
+#if !defined (FLAG)
+#define VALUE 5
+#endif
+{
+
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d
new file mode 100644
index 000000000000..044e5a1ba586
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple #define and predicates test.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#define MAXVAL 10 * 15
+
+
+#pragma D option quiet
+
+tick-10ms
+/MAXVAL > 5/
+{
+ printf("The value is %d\n", MAXVAL);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d.out
new file mode 100644
index 000000000000..7ae497954246
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d.out
@@ -0,0 +1,2 @@
+The value is 150
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d
new file mode 100644
index 000000000000..d917d334d3f0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple ifdefined, define, else, endif test.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#if defined (FLAG)
+#define VALUE 5
+#else
+#define VALUE 10
+#endif
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d.out
new file mode 100644
index 000000000000..2bde5e931ce2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d.out
@@ -0,0 +1,2 @@
+The value is 10
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d
new file mode 100644
index 000000000000..b0ae39538821
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple define, if defined, define and endif tests.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#define FLAG 1
+#if defined (FLAG)
+#define VALUE 5
+#endif
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d.out
new file mode 100644
index 000000000000..d51d19fc8c60
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d.out
@@ -0,0 +1,2 @@
+The value is 5
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d
new file mode 100644
index 000000000000..c6210d09116b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple define, if defined, else, endif test.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+#define FLAG 1
+#if defined (FLAG)
+#define VALUE 5
+#else
+#define VALUE 10
+#endif
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d.out
new file mode 100644
index 000000000000..d51d19fc8c60
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d.out
@@ -0,0 +1,2 @@
+The value is 5
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.withinprobe.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.withinprobe.d
new file mode 100644
index 000000000000..83a2445b52aa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.withinprobe.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a 'ifdef' section inside a probe clause.
+ *
+ * SECTION: Program Structure/Use of the C Preprocessor
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+
+#if !defined (FLAG)
+#define VALUE 5
+#endif
+
+ printf("The value is %d\n", VALUE);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d
new file mode 100644
index 000000000000..5479d00126a7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = count();
+ print(@);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d
new file mode 100644
index 000000000000..4f45885d42a3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d
@@ -0,0 +1,34 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+BEGIN
+{
+ print((void)`p0);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d
new file mode 100644
index 000000000000..368caebacb81
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d
@@ -0,0 +1,34 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+BEGIN
+{
+ print();
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.array.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.array.d
new file mode 100644
index 000000000000..9650bf7c0f5e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.array.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011 by Delphix. All rights reserved.
+ */
+
+#pragma D option quiet
+
+typedef struct bar {
+ int alpha;
+} bar_t;
+
+typedef struct foo {
+ int a[3];
+ char b[30];
+ bar_t c[2];
+ char d[3];
+} foo_t;
+
+BEGIN
+{
+ this->f = (foo_t *)alloca(sizeof (foo_t));
+
+ this->f->a[0] = 1;
+ this->f->a[1] = 2;
+ this->f->a[2] = 3;
+ this->f->b[0] = 'a';
+ this->f->b[1] = 'b';
+ this->f->b[2] = 0;
+ this->f->c[0].alpha = 5;
+ this->f->c[1].alpha = 6;
+ this->f->c[2].alpha = 7;
+ this->f->d[0] = 4;
+ this->f->d[1] = 0;
+ this->f->d[2] = 0;
+
+ print(this->f->a);
+ print(this->f->b);
+ print(this->f->c);
+ print(*this->f);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.array.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.array.d.out
new file mode 100644
index 000000000000..0702d4bb5a80
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.array.d.out
@@ -0,0 +1,23 @@
+int [3] [ 0x1, 0x2, 0x3 ]
+char [30] "ab"
+bar_t [2] [
+ bar_t {
+ int alpha = 0x5
+ },
+ bar_t {
+ int alpha = 0x6
+ }
+]
+foo_t {
+ int [3] a = [ 0x1, 0x2, 0x3 ]
+ char [30] b = [ "ab" ]
+ bar_t [2] c = [
+ bar_t {
+ int alpha = 0x5
+ },
+ bar_t {
+ int alpha = 0x6
+ }
+ ]
+ char [3] d = [ '\004', '\0', '\0' ]
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.bitfield.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.bitfield.d
new file mode 100644
index 000000000000..ff77bb0ec74d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.bitfield.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011 by Delphix. All rights reserved.
+ */
+
+#pragma D option quiet
+
+typedef struct forward forward_t;
+
+typedef struct foo {
+ int a:4;
+ int b:7;
+ int c:1;
+ int d:2;
+} foo_t;
+
+BEGIN
+{
+ this->s = (foo_t *)alloca(sizeof (foo_t));
+
+ this->s->a = 1;
+ this->s->b = 5;
+ this->s->c = 0;
+ this->s->d = 2;
+
+ print(*this->s);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.bitfield.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.bitfield.d.out
new file mode 100644
index 000000000000..309444d5c8d4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.bitfield.d.out
@@ -0,0 +1,6 @@
+foo_t {
+ int a :4 = 0x1
+ int b :7 = 0x5
+ int c :1 = 0
+ int d :2 = 0x2
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d
new file mode 100644
index 000000000000..f17551facb4e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d
@@ -0,0 +1,28 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+BEGIN
+{
+ print(*curpsinfo);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d
new file mode 100644
index 000000000000..f96af108cbea
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d
@@ -0,0 +1,33 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+enum simpson {
+ homer,
+ marge,
+ bart,
+ lisa,
+ maggie,
+ snowball_ii,
+ santas_little_helper
+};
+
+BEGIN
+{
+ print(bart);
+ print((enum simpson)4);
+ print(snowball_ii);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d.out
new file mode 100644
index 000000000000..979a5b72d716
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d.out
@@ -0,0 +1,4 @@
+enum simpson bart
+enum simpson maggie
+enum simpson snowball_ii
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.primitive.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.primitive.d
new file mode 100644
index 000000000000..559dab1840c7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.primitive.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011 by Delphix. All rights reserved.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = (int)'a';
+
+ printf("\n");
+
+ print((char)'a');
+ print((int)-1);
+ print((unsigned int)23);
+ print((short)456);
+ print((unsigned short)789);
+ print((long)1234);
+ print((ulong_t)56789);
+ print((void *)0x1234);
+ print("hello");
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.primitive.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.primitive.d.out
new file mode 100644
index 000000000000..f7e4076726ae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.primitive.d.out
@@ -0,0 +1,11 @@
+
+char 'a'
+int 0xffffffff
+unsigned int 0x17
+short 0x1c8
+unsigned short 0x315
+long 0x4d2
+ulong_t 0xddd5
+void * 0x1234
+string "hello"
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.struct.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.struct.d
new file mode 100644
index 000000000000..2fb1c41401e5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.struct.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011 by Delphix. All rights reserved.
+ */
+
+#pragma D option quiet
+
+typedef struct forward forward_t;
+
+typedef struct foo {
+ int a;
+ void *b;
+ struct {
+ uint64_t alpha;
+ uint64_t beta;
+ } c;
+ ushort_t d;
+ int e;
+ forward_t *f;
+ void (*g)();
+} foo_t;
+
+BEGIN
+{
+ this->s = (foo_t *)alloca(sizeof (foo_t));
+
+ this->s->a = 1;
+ this->s->b = (void *)2;
+ this->s->c.alpha = 3;
+ this->s->c.beta = 4;
+ this->s->d = 5;
+ this->s->e = 6;
+ this->s->f = (void *)7;
+ this->s->g = (void *)8;
+
+ print(*this->s);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.struct.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.struct.d.out
new file mode 100644
index 000000000000..b7b210837552
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.struct.d.out
@@ -0,0 +1,12 @@
+foo_t {
+ int a = 0x1
+ void *b = 0x2
+ struct c = {
+ uint64_t alpha = 0x3
+ uint64_t beta = 0x4
+ }
+ ushort_t d = 0x5
+ int e = 0x6
+ forward_t *f = 0x7
+ int (*)() g = 0x8
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d
new file mode 100644
index 000000000000..e8125d4f5cba
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+#pragma D option quiet
+
+typedef struct pancakes {
+ int i;
+ string s;
+ timespec_t t;
+} pancakes_t;
+
+translator pancakes_t < void *V > {
+ i = 2 * 10;
+ s = strjoin("I like ", "pancakes");
+ t = *(timespec_t *)`dtrace_zero;
+};
+
+BEGIN
+{
+ print(*(xlate < pancakes_t * > ((void *)NULL)));
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out
new file mode 100644
index 000000000000..9b01402af34b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out
@@ -0,0 +1,8 @@
+pancakes_t {
+ int i = 0x14
+ string s = [ "I like pancakes" ]
+ timespec_t t = {
+ time_t tv_sec = 0
+ long tv_nsec = 0
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badagg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badagg.d
new file mode 100644
index 000000000000..817d9ac0871e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badagg.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invokes printa() with a bad aggregation argument.
+ *
+ * SECTION: Output Formatting/printa()
+ *
+ */
+
+BEGIN
+{
+ printa("%d", 123);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badfmt.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badfmt.d
new file mode 100644
index 000000000000..5a419822e3dd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badfmt.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invokes printa() with a bad format string.
+ *
+ * SECTION: Output Formatting/printa()
+ *
+ */
+
+BEGIN
+{
+ printa(123);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badval.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badval.d
new file mode 100644
index 000000000000..e8663ab79f4a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badval.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invokes printa() with an argument that does not match the aggregation
+ * convertion.
+ *
+ * SECTION: Output Formatting/printa()
+ *
+ */
+
+BEGIN
+{
+ printa("%@d\n", 123);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_PROTO.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_PROTO.bad.d
new file mode 100644
index 000000000000..8e202f6d49a0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_PROTO.bad.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invokes printa() with a bad aggregation argument.
+ *
+ * SECTION: Output Formatting/printa()
+ *
+ */
+
+BEGIN
+{
+ printa("%d");
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d
new file mode 100644
index 000000000000..09b4b27f0da5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d
@@ -0,0 +1,36 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @[jstack()] = count();
+
+ printa("%p\n", @);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.stack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.stack.d
new file mode 100644
index 000000000000..8815ad684ed1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.stack.d
@@ -0,0 +1,36 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @[stack()] = count();
+
+ printa("%p\n", @);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d
new file mode 100644
index 000000000000..bce1b673865b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d
@@ -0,0 +1,36 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @[ustack()] = count();
+
+ printa("%p\n", @);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d
new file mode 100644
index 000000000000..f5353870808d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Test the basic formatting of all the supported kinds of aggregations.
+ *
+ * SECTION: Output Formatting/printa()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a = avg(1);
+ @b = count();
+ @c = lquantize(1, 1, 10);
+ @d = max(1);
+ @e = min(1);
+ @f = sum(1);
+ @g = quantize(1);
+ @h = stddev(1);
+
+ printa("@a = %@u\n", @a);
+ printa("@b = %@u\n", @b);
+ printa("@c = %@d\n", @c);
+ printa("@d = %@u\n", @d);
+ printa("@e = %@u\n", @e);
+ printa("@f = %@u\n", @f);
+ printa("@g = %@d\n", @g);
+ printa("@h = %@d\n", @h);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d.out
new file mode 100644
index 000000000000..ddad2134d1af
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d.out
@@ -0,0 +1,19 @@
+@a = 1
+@b = 1
+@c =
+ value ------------- Distribution ------------- count
+ < 1 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 2 | 0
+
+@d = 1
+@e = 1
+@f = 1
+@g =
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 2 | 0
+
+@h = 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.def.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.def.d
new file mode 100644
index 000000000000..50011e3fa129
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.def.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the printa() default output format.
+ *
+ * SECTION: Output Formatting/printa()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a = count();
+ printa(@a);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.def.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.def.d.out
new file mode 100644
index 000000000000..7cf6701249d7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.def.d.out
@@ -0,0 +1,3 @@
+
+ 1
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d
new file mode 100644
index 000000000000..f3379c9872f9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ /*
+ * Yes, this works. But is it useful? And is it useful to someone
+ * other than jwadams and/or dep?
+ */
+ @[10, 100] = sum(1);
+ @[-10, 200] = sum(2);
+
+ printa("-->%-*d<--\n", @);
+ printa("-->%*d<--\n", @);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d.out
new file mode 100644
index 000000000000..f6c53eb9d42b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d.out
@@ -0,0 +1,5 @@
+-->100 <--
+-->200 <--
+--> 100<--
+-->200 <--
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.fmt.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.fmt.d
new file mode 100644
index 000000000000..8f8cd41b12df
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.fmt.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the printa() format string in its simplest form.
+ *
+ * SECTION: Output Formatting/printa()
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a = count();
+ printa("%@u", @a);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.fmt.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.fmt.d.out
new file mode 100644
index 000000000000..d00491fd7e5b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.fmt.d.out
@@ -0,0 +1 @@
+1
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh
new file mode 100644
index 000000000000..7d8bd39af74b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh
@@ -0,0 +1,83 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+void
+thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog(void)
+{
+ while (1)
+ ;
+}
+
+int
+main(int argc, char *argv[])
+{
+ thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog();
+}
+EOF
+
+cc -o test test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -c ./test -qs /dev/stdin <<EOF
+ profile:::profile-1001hz
+ /pid == \$target/
+ {
+ @[arg1] = count();
+ }
+
+ tick-1s
+ /n++ > 10/
+ {
+ printa("%A %@d\n", @);
+ exit(0);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.many.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.many.d
new file mode 100644
index 000000000000..5bd3eae7e858
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.many.d
@@ -0,0 +1,76 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=32m
+#pragma D option bufpolicy=fill
+#pragma D option destructive
+#pragma D option quiet
+
+BEGIN
+/0 == 1/
+{
+ @ = count();
+}
+
+BEGIN
+{
+ freopen("/dev/null");
+}
+
+profile-4000hz
+{
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+ printa(@);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.manyval.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.manyval.d
new file mode 100644
index 000000000000..c9fae8436582
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.manyval.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the use of many aggregation results in the same format string.
+ *
+ * SECTION: Output Formatting/printa()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a = count();
+ printa("%@u %@u %@u %@u %@u %@u %@u\n", @a);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.manyval.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.manyval.d.out
new file mode 100644
index 000000000000..f08b797e81f9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.manyval.d.out
@@ -0,0 +1,2 @@
+1 1 1 1 1 1 1
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.stack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.stack.d
new file mode 100644
index 000000000000..88dbb1a77f8e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.stack.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ @[stack()] = count();
+ @[ustack()] = count();
+ @[jstack()] = count();
+
+ printa("%k\n", @);
+ printa("%-20k\n", @);
+ printa("%60k\n", @);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.tuple.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.tuple.d
new file mode 100644
index 000000000000..0eea887b545a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.tuple.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the use of tuple arguments in the printa() format.
+ *
+ * SECTION: Output Formatting/printa()
+ *
+ * NOTES:
+ * We confirm that we can consume fewer arguments than in the tuple, all
+ * the way up to the exact number.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ @a[1, 2, 3, 4, 5] = count();
+ printf("\n");
+
+ printa("%@u: -\n", @a);
+ printa("%@u: %d\n", @a);
+ printa("%@u: %d %d\n", @a);
+ printa("%@u: %d %d %d\n", @a);
+ printa("%@u: %d %d %d %d\n", @a);
+ printa("%@u: %d %d %d %d %d\n", @a);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.tuple.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.tuple.d.out
new file mode 100644
index 000000000000..928119c9f05d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.tuple.d.out
@@ -0,0 +1,8 @@
+
+1: -
+1: 1
+1: 1 2
+1: 1 2 3
+1: 1 2 3 4
+1: 1 2 3 4 5
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh
new file mode 100644
index 000000000000..69bf46b5383c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh
@@ -0,0 +1,62 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+# The output files assumes the timezone is US/Pacific
+export TZ=America/Los_Angeles
+
+$dtrace -s /dev/stdin <<EOF
+#pragma D option quiet
+#pragma D option destructive
+
+BEGIN
+{
+ @foo = min(1075064400 * (hrtime_t)1000000000);
+ @bar = max(walltimestamp);
+ printa("%@T\n", @foo);
+ printa("%@Y\n", @foo);
+
+ freopen("/dev/null");
+ printa("%@T\n", @bar);
+ printa("%@Y\n", @bar);
+
+ exit(0);
+}
+EOF
+
+if [ $? -ne 0 ]; then
+ print -u2 "dtrace failed"
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out
new file mode 100644
index 000000000000..7462cf8e1093
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out
@@ -0,0 +1,2 @@
+Sun, 25 Jan 2004 13:00:00 PST
+2004 Jan 25 13:00:00
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_AGG_CONV.aggfmt.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_AGG_CONV.aggfmt.d
new file mode 100644
index 000000000000..9cac625d3ec1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_AGG_CONV.aggfmt.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with a bad aggregation format.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf("hello %@d", 123);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.toomany.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.toomany.d
new file mode 100644
index 000000000000..de87e8d71839
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.toomany.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with too many arguments.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf("x = %d y = %d\n", 123, 456, 789);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.widths.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.widths.d
new file mode 100644
index 000000000000..938128007b6e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.widths.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Negative test to test variety of fixed width formats.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("\n");
+ x = 0;
+
+ printf("%?d\n", x++, 1);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_FMT.badfmt.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_FMT.badfmt.d
new file mode 100644
index 000000000000..bf4dc72c1ab3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_FMT.badfmt.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with a bad format string arg.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf(123);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_PROTO.novalue.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_PROTO.novalue.d
new file mode 100644
index 000000000000..68f8cf029fe3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_PROTO.novalue.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with a missing value argument.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf("%s");
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.aggarg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.aggarg.d
new file mode 100644
index 000000000000..99bb0395028c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.aggarg.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Test printf() with a bad aggregation arg.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ @a = count();
+ printf("hello %d %d", 123, @a);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.recursive.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.recursive.d
new file mode 100644
index 000000000000..3b94ba731721
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.recursive.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invalid recursive printf test.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+ printf("%s\n", printf("test"));
+
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.noprec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.noprec.d
new file mode 100644
index 000000000000..ba8a1a46d19a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.noprec.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with a missing dynamic precision argument.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf("%s %.*d\n", "foo");
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.nowidth.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.nowidth.d
new file mode 100644
index 000000000000..4d72c819d435
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.nowidth.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with a missing dynamic width argument.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf("%s %*d\n", "foo");
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badprec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badprec.d
new file mode 100644
index 000000000000..64cf912534c1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badprec.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test a dynamic precision argument of non-integer type.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf("%.*d\n", "foo", 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badwidth.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badwidth.d
new file mode 100644
index 000000000000..badc95eeb952
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badwidth.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Tet dynamic width argument of non-integer type.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf("%*d\n", "foo", 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PROTO_LEN.toofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PROTO_LEN.toofew.d
new file mode 100644
index 000000000000..32c877ba8ed9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PROTO_LEN.toofew.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with too few arguments.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv1.d
new file mode 100644
index 000000000000..7add33192a7d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv1.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the unsupported %n$ conversion syntax.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf("%3$d", 123);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv2.d
new file mode 100644
index 000000000000..5cc32e27e636
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv2.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test an incomplete conversion.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf("%3", 123);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv3.d
new file mode 100644
index 000000000000..0dedea3d4096
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv3.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test an undefined conversion.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ printf("%Z", 123);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d
new file mode 100644
index 000000000000..8d4bb819d380
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the basics of all the format conversions in the printf dictionary.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ * NOTES:
+ * floats and wchar_t strings missing
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = (int)'a';
+
+ printf("\n");
+
+ printf("%%a = %a\n", &`kmem_alloc);
+ printf("%%c = %c\n", i);
+ printf("%%d = %d\n", i);
+ printf("%%hd = %hd\n", (short)i);
+ printf("%%hi = %hi\n", (short)i);
+ printf("%%ho = %ho\n", (ushort_t)i);
+ printf("%%hu = %hu\n", (ushort_t)i);
+ printf("%%hx = %hx\n", (ushort_t)i);
+ printf("%%hX = %hX\n", (ushort_t)i);
+ printf("%%i = %i\n", i);
+ printf("%%lc = %lc\n", i);
+ printf("%%ld = %ld\n", (long)i);
+ printf("%%li = %li\n", (long)i);
+ printf("%%lo = %lo\n", (ulong_t)i);
+ printf("%%lu = %lu\n", (ulong_t)i);
+ printf("%%lx = %lx\n", (ulong_t)i);
+ printf("%%lX = %lX\n", (ulong_t)i);
+ printf("%%o = %o\n", (uint_t)i);
+ printf("%%p = %p\n", (void *)i);
+ printf("%%s = %s\n", "hello");
+ printf("%%u = %u\n", (uint_t)i);
+ printf("%%wc = %wc\n", i);
+ printf("%%x = %x\n", (uint_t)i);
+ printf("%%X = %X\n", (uint_t)i);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d.out
new file mode 100644
index 000000000000..55c122223ae7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d.out
@@ -0,0 +1,26 @@
+
+%a = genunix`kmem_alloc
+%c = a
+%d = 97
+%hd = 97
+%hi = 97
+%ho = 141
+%hu = 97
+%hx = 61
+%hX = 61
+%i = 97
+%lc = a
+%ld = 97
+%li = 97
+%lo = 141
+%lu = 97
+%lx = 61
+%lX = 61
+%o = 141
+%p = 61
+%s = hello
+%u = 97
+%wc = a
+%x = 61
+%X = 61
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.flags.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.flags.d
new file mode 100644
index 000000000000..0b65315138e6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.flags.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test all of the various formatting flags (except %' because that
+ * requires locale support).
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("\n");
+ printf("# %#8x\n", 0x123);
+ printf("0 %08x\n", 0x123);
+ printf("- %-8x\n", 0x123);
+ printf("+ %+8d\n", 123);
+ printf(" % 8d\n", 123);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.flags.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.flags.d.out
new file mode 100644
index 000000000000..4e5344ee6575
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.flags.d.out
@@ -0,0 +1,7 @@
+
+# 0x123
+0 00000123
+- 123
++ +123
+ 123
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.hello.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.hello.d
new file mode 100644
index 000000000000..d58f6cd7277a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.hello.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple printf() test.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("hello");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.hello.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.hello.d.out
new file mode 100644
index 000000000000..ce013625030b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.hello.d.out
@@ -0,0 +1 @@
+hello
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d
new file mode 100644
index 000000000000..d15236bab0b3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d
@@ -0,0 +1,87 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with simple integer arguments, using a variety of
+ * sizes and thereby exercise the automatic size extension feature.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("\n%d\n", (char)0x1234567890abcdef);
+ printf("%d\n", (short)0x1234567890abcdef);
+ printf("%d\n", (int)0x1234567890abcdef);
+ printf("%d\n", (long long)0x1234567890abcdef);
+
+ printf("\n%d\n", (unsigned char)0x1234567890abcdef);
+ printf("%d\n", (unsigned short)0x1234567890abcdef);
+ printf("%d\n", (unsigned int)0x1234567890abcdef);
+ printf("%d\n", (unsigned long long)0x1234567890abcdef);
+
+ printf("\n%u\n", (char)0x1234567890abcdef);
+ printf("%u\n", (short)0x1234567890abcdef);
+ printf("%u\n", (int)0x1234567890abcdef);
+ printf("%u\n", (long long)0x1234567890abcdef);
+
+ printf("\n%u\n", (unsigned char)0x1234567890abcdef);
+ printf("%u\n", (unsigned short)0x1234567890abcdef);
+ printf("%u\n", (unsigned int)0x1234567890abcdef);
+ printf("%u\n", (unsigned long long)0x1234567890abcdef);
+
+ printf("\n%x\n", (unsigned char)0x1234567890abcdef);
+ printf("%x\n", (unsigned short)0x1234567890abcdef);
+ printf("%x\n", (unsigned int)0x1234567890abcdef);
+ printf("%x\n", (unsigned long long)0x1234567890abcdef);
+
+ printf("\n%x\n", (char)0x1234567890abcdef);
+ printf("%x\n", (short)0x1234567890abcdef);
+ printf("%x\n", (int)0x1234567890abcdef);
+ printf("%x\n", (long long)0x1234567890abcdef);
+
+ printf("\n%o\n", (unsigned char)0x1234567890abcdef);
+ printf("%o\n", (unsigned short)0x1234567890abcdef);
+ printf("%o\n", (unsigned int)0x1234567890abcdef);
+ printf("%o\n", (unsigned long long)0x1234567890abcdef);
+
+ printf("\n%o\n", (char)0x1234567890abcdef);
+ printf("%o\n", (short)0x1234567890abcdef);
+ printf("%o\n", (int)0x1234567890abcdef);
+ printf("%o\n", (long long)0x1234567890abcdef);
+
+ printf("\n%p\n", (void *)0x12345678);
+ printf("%p\n", (int *)0x90abcdef);
+ printf("%p\n", (uintptr_t)0x67890abc);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out
new file mode 100644
index 000000000000..bc7eaed0ec9a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out
@@ -0,0 +1,45 @@
+
+-17
+-12817
+-1867788817
+1311768467294899695
+
+239
+52719
+2427178479
+1311768467294899695
+
+239
+52719
+2427178479
+1311768467294899695
+
+239
+52719
+2427178479
+1311768467294899695
+
+ef
+cdef
+90abcdef
+1234567890abcdef
+
+ef
+cdef
+90abcdef
+1234567890abcdef
+
+357
+146757
+22052746757
+110642547422052746757
+
+357
+146757
+22052746757
+110642547422052746757
+
+12345678
+90abcdef
+67890abc
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.precs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.precs.d
new file mode 100644
index 000000000000..2bfff9ff7040
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.precs.d
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test a variety of fixed and dynamic format precisions.
+ *
+ * SECTION: Output Formatting/printf()
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("\n");
+ x = 0;
+
+ printf("%.0s\n", "hello");
+ printf("%.1s\n", "hello");
+ printf("%.2s\n", "hello");
+ printf("%.3s\n", "hello");
+ printf("%.4s\n", "hello");
+ printf("%.5s\n", "hello");
+
+ printf("%.*s\n", x++, "hello");
+ printf("%.*s\n", x++, "hello");
+ printf("%.*s\n", x++, "hello");
+ printf("%.*s\n", x++, "hello");
+ printf("%.*s\n", x++, "hello");
+ printf("%.*s\n", x++, "hello");
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.precs.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.precs.d.out
new file mode 100644
index 000000000000..11a969de02ae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.precs.d.out
@@ -0,0 +1,14 @@
+
+hello
+h
+he
+hel
+hell
+hello
+hello
+h
+he
+hel
+hell
+hello
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.print-f.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.print-f.d
new file mode 100644
index 000000000000..3fe0bac485de
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.print-f.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test %f format printing.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+float f;
+double d;
+
+BEGIN
+{
+ printf("\n");
+
+ printf("%%f = %f\n", f);
+ printf("%%f = %f\n", d);
+
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.print-f.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.print-f.d.out
new file mode 100644
index 000000000000..4d4b8641afc3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.print-f.d.out
@@ -0,0 +1,4 @@
+
+%f = 0.000000
+%f = 0.000000
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh
new file mode 100644
index 000000000000..6d3695711c95
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh
@@ -0,0 +1,56 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+# The output files assumes the timezone is US/Pacific
+export TZ=America/Los_Angeles
+
+$dtrace -s /dev/stdin <<EOF
+#pragma D option quiet
+
+inline uint64_t NANOSEC = 1000000000;
+
+BEGIN
+{
+ printf("%T\n%T\n%T", (uint64_t)0, (uint64_t)1062609821 * NANOSEC,
+ (uint64_t)0x7fffffff * NANOSEC);
+ exit(0);
+}
+EOF
+
+if [ $? -ne 0 ]; then
+ print -u2 "dtrace failed"
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh.out
new file mode 100644
index 000000000000..51c84373aacd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh.out
@@ -0,0 +1,3 @@
+Wed, 31 Dec 1970 16:00:00 PST
+Wed, 03 Sep 2003 10:23:41 PDT
+Mon, 18 Jan 2038 19:14:07 PST
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh
new file mode 100644
index 000000000000..b8ea2fff2aff
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh
@@ -0,0 +1,56 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+# The output files assumes the timezone is US/Pacific
+export TZ=America/Los_Angeles
+
+$dtrace -s /dev/stdin <<EOF
+#pragma D option quiet
+
+inline uint64_t NANOSEC = 1000000000;
+
+BEGIN
+{
+ printf("%Y\n%Y\n%Y", (uint64_t)0, (uint64_t)1062609821 * NANOSEC,
+ (uint64_t)0x7fffffff * NANOSEC);
+ exit(0);
+}
+EOF
+
+if [ $? -ne 0 ]; then
+ print -u2 "dtrace failed"
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh.out
new file mode 100644
index 000000000000..ae8d82f936a7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh.out
@@ -0,0 +1,3 @@
+1969 Dec 31 16:00:00
+2003 Sep 3 10:23:41
+2038 Jan 18 19:14:07
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printcont.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printcont.d
new file mode 100644
index 000000000000..ca7e1a931303
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printcont.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test 'uint' continously; like kinda stress.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+uint64_t ts;
+
+BEGIN
+{
+ ts = 53114233149441;
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ printf("%u\n", ts);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printcont.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printcont.d.out
new file mode 100644
index 000000000000..ce33b729a33c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printcont.d.out
@@ -0,0 +1,16 @@
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+53114233149441
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printeE.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printeE.d
new file mode 100644
index 000000000000..7aaee2a4bceb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printeE.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test %e, %E format printing.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+float f;
+double d;
+
+BEGIN
+{
+ printf("\n");
+
+ printf("%%e = %e\n", f);
+ printf("%%E = %E\n", f);
+
+ printf("%%e = %e\n", d);
+ printf("%%E = %E\n", d);
+
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printeE.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printeE.d.out
new file mode 100644
index 000000000000..3fa96bc2df79
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printeE.d.out
@@ -0,0 +1,6 @@
+
+%e = 0.000000e+00
+%E = 0.000000E+00
+%e = 0.000000e+00
+%E = 0.000000E+00
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printgG.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printgG.d
new file mode 100644
index 000000000000..9e7e019b9984
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printgG.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test %g, %G format printing.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+float f;
+double d;
+
+BEGIN
+{
+ printf("\n");
+
+ printf("%%g = %g\n", f);
+ printf("%%g = %g\n", d);
+
+ printf("%%G = %G\n", f);
+ printf("%%G = %G\n", d);
+
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printgG.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printgG.d.out
new file mode 100644
index 000000000000..e4175e642d7b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printgG.d.out
@@ -0,0 +1,6 @@
+
+%g = 0
+%g = 0
+%G = 0
+%G = 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d
new file mode 100644
index 000000000000..deb4f8172625
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with a fixed string and no actual tracing arguments.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("hello world from BEGIN");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d.out
new file mode 100644
index 000000000000..cb7c7e94870f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d.out
@@ -0,0 +1 @@
+hello world from BEGIN
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d
new file mode 100644
index 000000000000..64e565e267b0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * Check %d v. %i v. %u.
+ */
+
+#pragma D option quiet
+
+uint16_t x;
+int16_t y;
+
+BEGIN
+{
+ x = 0xffffffff;
+ y = 0xffffffff;
+
+ printf("%d %i %u\n", x, x, x);
+ printf("%d %i %u\n", y, y, y);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out
new file mode 100644
index 000000000000..169ac59b9554
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out
@@ -0,0 +1,3 @@
+65535 -1 65535
+-1 -1 65535
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d
new file mode 100644
index 000000000000..a74041393ebf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Test printf() with a simple string argument.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("sysname = %s", `utsname.sysname);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d.out
new file mode 100644
index 000000000000..ba3198176ecc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d.out
@@ -0,0 +1 @@
+sysname = SunOS
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d
new file mode 100644
index 000000000000..32bc682e829b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with a simple string argument.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("symbol = %a", &`kmem_alloc);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out
new file mode 100644
index 000000000000..5ed9d8ec53b6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out
@@ -0,0 +1 @@
+symbol = kernel`kmem_alloc
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.uints.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.uints.d
new file mode 100644
index 000000000000..caa326e875fc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.uints.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test printf() with simple unsigned integer arguments.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("\n");
+ printf("%u\n", (uchar_t)123);
+ printf("%u\n", (ushort_t)123);
+ printf("%u\n", (ulong_t)123);
+ printf("%u\n", (u_longlong_t)123);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.uints.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.uints.d.out
new file mode 100644
index 000000000000..d800e9167535
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.uints.d.out
@@ -0,0 +1,6 @@
+
+123
+123
+123
+123
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths.d
new file mode 100644
index 000000000000..21595c02974f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test a variety of fixed and dynamic format widths.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("\n");
+ x = 0;
+
+ printf("%0d\n", 1);
+ printf("%1d\n", 1);
+ printf("%2d\n", 1);
+ printf("%3d\n", 1);
+ printf("%4d\n", 1);
+ printf("%5d\n", 1);
+
+ printf("%*d\n", x++, 1);
+ printf("%*d\n", x++, 1);
+ printf("%*d\n", x++, 1);
+ printf("%*d\n", x++, 1);
+ printf("%*d\n", x++, 1);
+ printf("%*d\n", x++, 1);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths.d.out
new file mode 100644
index 000000000000..39fc7a8a98f3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths.d.out
@@ -0,0 +1,14 @@
+
+1
+1
+ 1
+ 1
+ 1
+ 1
+1
+1
+ 1
+ 1
+ 1
+ 1
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths1.d
new file mode 100644
index 000000000000..b5410ab8ac93
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths1.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Try to print charecter wide width using '?'
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("\n");
+ x = 0;
+
+ printf("%?d\n", x++);
+ printf("%?d\n", x++);
+ printf("%?d\n", x++);
+ printf("%?d\n", x++);
+ printf("%?d\n", x++);
+ printf("%?d\n", x++);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.wp.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.wp.d
new file mode 100644
index 000000000000..b6745e140557
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.wp.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test a variety of fixed and dynamic format widths combined with precisions.
+ *
+ * SECTION: Output Formatting/printf()
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("\n");
+ x = 0;
+
+ printf("%0.0s\n", "hello");
+ printf("%1.1s\n", "hello");
+ printf("%2.2s\n", "hello");
+ printf("%3.3s\n", "hello");
+ printf("%4.4s\n", "hello");
+ printf("%5.5s\n", "hello");
+ printf("%6.6s\n", "hello");
+ printf("%7.7s\n", "hello");
+ printf("%8.8s\n", "hello");
+ printf("%9.9s\n", "hello");
+
+ printf("%*.*s\n", x, x++, "hello");
+ printf("%*.*s\n", x, x++, "hello");
+ printf("%*.*s\n", x, x++, "hello");
+ printf("%*.*s\n", x, x++, "hello");
+ printf("%*.*s\n", x, x++, "hello");
+ printf("%*.*s\n", x, x++, "hello");
+ printf("%*.*s\n", x, x++, "hello");
+ printf("%*.*s\n", x, x++, "hello");
+ printf("%*.*s\n", x, x++, "hello");
+ printf("%*.*s\n", x, x++, "hello");
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.wp.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.wp.d.out
new file mode 100644
index 000000000000..2f1fd9de1a85
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.wp.d.out
@@ -0,0 +1,22 @@
+
+hello
+h
+he
+hel
+hell
+hello
+ hello
+ hello
+ hello
+ hello
+hello
+h
+he
+hel
+hell
+hello
+ hello
+ hello
+ hello
+ hello
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh
new file mode 100644
index 000000000000..ae4934cdeb34
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh
@@ -0,0 +1,82 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+ppriv -s A=basic,dtrace_proc,dtrace_user $$
+
+/usr/sbin/dtrace -q -s /dev/stdin <<"EOF"
+
+BEGIN {
+ errorcount = 0;
+ expected_errorcount = 23;
+}
+
+BEGIN { trace(mutex_owned(&`pidlock)); }
+BEGIN { trace(mutex_owner(&`pidlock)); }
+BEGIN { trace(mutex_type_adaptive(&`pidlock)); }
+BEGIN { trace(mutex_type_spin(&`pidlock)); }
+
+BEGIN { trace(rw_read_held(&`ksyms_lock)); }
+BEGIN { trace(rw_write_held(&`ksyms_lock)); }
+BEGIN { trace(rw_iswriter(&`ksyms_lock)); }
+
+BEGIN { x = alloca(10); bcopy(`initname, x, 10); trace(stringof(x)); }
+/* We have no reliable way to test msgsize */
+
+BEGIN { trace(strlen(`initname)); }
+BEGIN { trace(strchr(`initname, 0x69)); }
+BEGIN { trace(strrchr(`initname, 0x69)); }
+BEGIN { trace(strstr("/sbin/init/foo", `initname)); }
+BEGIN { trace(strstr(`initname, "in")); }
+BEGIN { trace(strtok(`initname, "/")); }
+BEGIN { trace(strtok(NULL, "/")); }
+BEGIN { trace(strtok("foo/bar", `initname)); }
+BEGIN { trace(strtok(NULL, `initname)); }
+BEGIN { trace(substr(`initname, 2, 3)); }
+
+BEGIN { trace(ddi_pathname(`top_devinfo, 1)); }
+BEGIN { trace(strjoin(`initname, "foo")); }
+BEGIN { trace(strjoin("foo", `initname)); }
+BEGIN { trace(dirname(`initname)); }
+BEGIN { trace(cleanpath(`initname)); }
+
+ERROR {
+ errorcount++;
+}
+
+BEGIN /errorcount == expected_errorcount/ {
+ trace("test passed");
+ exit(0);
+}
+
+BEGIN /errorcount != expected_errorcount/ {
+ printf("fail: expected %d. saw %d.", expected_errorcount, errorcount);
+ exit(1);
+}
+EOF
+
+
+exit $?
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.op_access.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.op_access.ksh
new file mode 100644
index 000000000000..08964c498e5e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.op_access.ksh
@@ -0,0 +1,70 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+ppriv -s A=basic,dtrace_proc,dtrace_user $$
+
+/usr/sbin/dtrace -q -s /dev/stdin <<"EOF"
+BEGIN {
+ errorcount = 0;
+ expected_errorcount = 7;
+}
+
+/* BYREF */
+BEGIN { trace(`utsname); }
+BEGIN { trace(`kmem_flags); }
+
+/* DIF_OP_SCMP */
+BEGIN /`initname == "/sbin/init"/ { trace("bad"); }
+
+/* DIF_OP_COPYS */
+BEGIN { p = `p0; trace(p); }
+
+/* DIF_OP_STTS */
+BEGIN { self->p = `p0; trace(self->p); }
+
+/* DIF_OP_STGAA */
+BEGIN { a[stringof(`initname)] = 42; trace(a["/sbin/init"]); }
+
+/* DIF_OP_STTAA */
+BEGIN { self->a[stringof(`initname)] = 42; trace(self->a["/sbin/init"]); }
+
+ERROR {
+ errorcount++;
+}
+
+BEGIN /errorcount == expected_errorcount/ {
+ trace("pass");
+ exit(0);
+}
+
+BEGIN /errorcount != expected_errorcount/ {
+ printf("fail: expected %d. saw %d.", expected_errorcount, errorcount);
+ exit(1);
+}
+EOF
+
+exit $?
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.unpriv_funcs.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.unpriv_funcs.ksh
new file mode 100644
index 000000000000..c9da0ce68834
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.unpriv_funcs.ksh
@@ -0,0 +1,79 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+#
+# Affirmative test of less privileged user operation. We do so by running
+# this test case as root, then as a less privileged user. The output should
+# be exactly the same.
+#
+
+script()
+{
+ cat <<"EOF"
+
+ BEGIN { trace("trace\n"); }
+ BEGIN { printf("%s\n", "printf"); }
+ BEGIN { printf("strlen(\"strlen\") = %d\n", strlen("strlen")); }
+ BEGIN { x = alloca(10);
+ bcopy("alloca\n", x, 7);
+ trace(stringof(x)); }
+
+ BEGIN { printf("index(\"index\", \"x\") = %d\n",
+ index("index", "x")); }
+ BEGIN { printf("strchr(\"strchr\", \'t\') = %s\n",
+ strchr("strchr", 't')); }
+
+ BEGIN { printf("strtok(\"strtok\", \"t\") = %s\n",
+ strtok("strtok", "t")); }
+ BEGIN { printf("strtok(NULL, \"t\") = %s\n",
+ strtok(NULL, "t")); }
+ BEGIN { printf("strtok(NULL, \"t\") = %s\n",
+ strtok(NULL, "t")); }
+ BEGIN { printf("substr(\"substr\", 2, 2) = %s\n",
+ substr("substr", 2, 2)); }
+ BEGIN { trace(strjoin("str", "join\n")); }
+ BEGIN { trace(basename("dirname/basename")); trace("/"); }
+ BEGIN { trace(dirname("dirname/basename")); }
+
+ BEGIN { exit(0); }
+ ERROR { exit(1); }
+EOF
+}
+
+privout=/tmp/$$.priv_output
+unprivout=/tmp/$$.unpriv_output
+
+script | /usr/sbin/dtrace -q -s /dev/stdin > $privout
+ppriv -s A=basic,dtrace_user $$
+script | /usr/sbin/dtrace -q -s /dev/stdin > $unprivout
+
+diff $privout $unprivout
+res=$?
+
+/bin/rm -f $privout $unprivout
+
+exit $res
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probeqtn.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probeqtn.d
new file mode 100644
index 000000000000..3560427858af
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probeqtn.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call probes with mismatch "?" and make sure it results in compilation
+ * error
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+int i;
+BEGIN
+{
+ i = 0;
+}
+
+syscall::?lwp?:entry
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probestar.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probestar.d
new file mode 100644
index 000000000000..6103f48618d7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probestar.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call an undefined probe with matching character "*" and make
+ * sure it results in compilation error.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+no_such_dtrace_probe*
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.tickstar.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.tickstar.d
new file mode 100644
index 000000000000..391b18c3d777
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.tickstar.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call a probe with matching charecters "*" but does not have
+ * any matching probes.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+int i;
+BEGIN
+{
+ i = 0;
+}
+
+syscall::*tick*:entry
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.assign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.assign.d
new file mode 100644
index 000000000000..e4f7dcb67585
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.assign.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a predicate with no spaces and make sure it results in
+ * compilation error.
+
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+int i = 0;
+
+profile-1
+/i == 0/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declare.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declare.d
new file mode 100644
index 000000000000..30aa26679681
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declare.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare variables inside probe clause and make sure it results
+ * in compilation error.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1
+{
+ int i = 0;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declarein.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declarein.d
new file mode 100644
index 000000000000..9ef8590abb0b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declarein.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a Variable in between definition and first brace, and make
+ * sure it results in compilation error.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1
+int i;
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.lbraces.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.lbraces.d
new file mode 100644
index 000000000000..b4a4315de379
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.lbraces.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a probe with one missing braces.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1
+{
+ exit(0);
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.probespec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.probespec.d
new file mode 100644
index 000000000000..67c448725430
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.probespec.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Try Declaring Datatypes and variables next to profile declaration and
+ * Make sure it results in compilation error.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1:int i
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.rbraces.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.rbraces.d
new file mode 100644
index 000000000000..4f889d57e6e0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.rbraces.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a probe with one missing braces.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.recdec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.recdec.d
new file mode 100644
index 000000000000..5db21ea9eb00
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.recdec.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a probe clause within another probe clause.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1
+{
+ tick-10ms
+{
+}
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.basic1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.basic1.d
new file mode 100644
index 000000000000..df2b1147f18b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.basic1.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple probe clause test; just a empty probe.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.check.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.check.d
new file mode 100644
index 000000000000..d3f2535d738a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.check.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a Variable in BEGIN and use that in another probe.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+int i;
+BEGIN
+{
+ i = 0;
+}
+
+tick-10ms
+/i == 0/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.declare.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.declare.d
new file mode 100644
index 000000000000..845b3fa49b94
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.declare.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declaration of variable outside probe clause
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+int i;
+tick-10ms
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.declareafter.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.declareafter.d
new file mode 100644
index 000000000000..1c1e2eae2938
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.declareafter.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declaration of a variable after probe clause definition.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ exit(0);
+}
+int i;
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.emptyprobe.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.emptyprobe.d
new file mode 100644
index 000000000000..e23a8dbb691d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.emptyprobe.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Multiple probe clause declarations.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+}
+tick-10ms
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragma.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragma.d
new file mode 100644
index 000000000000..035079d0febc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragma.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Test to Declare pragma in right place.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-10ms
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmaaftertab.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmaaftertab.d
new file mode 100644
index 000000000000..be725f9d54ca
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmaaftertab.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare pragma after a tab and make sure it results in compilation error.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+ #pragma D option quiet
+
+tick-10ms
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmainside.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmainside.d
new file mode 100644
index 000000000000..e602a4148216
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmainside.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare pragma inside probe clause.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+
+tick-10ms
+{
+#pragma D option quiet
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmaoutside.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmaoutside.d
new file mode 100644
index 000000000000..7d2ea61c6189
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmaoutside.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare pragma outside probe clause.
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+
+tick-10ms
+{
+ exit(0);
+}
+#pragma D option quiet
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d
new file mode 100644
index 000000000000..3f54321df9de
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call matching probe clauses with given name using "*"
+ *
+ * SECTION: Program Structure/Probe Clauses and Declarations
+ *
+ */
+
+
+#pragma D option quiet
+
+int i;
+BEGIN
+{
+ i = 0;
+}
+
+syscall::*lwp*:entry
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.create.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.create.ksh
new file mode 100644
index 000000000000..6b21eb86c9a5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.create.ksh
@@ -0,0 +1,67 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that the proc:::create probe fires with the proper
+# arguments.
+#
+# If this fails, the script will run indefinitely; it relies on the harness
+# to time it out.
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ proc:::create
+ /args[0]->p_pptr->p_pid == $child && pid == $child/
+ {
+ exit(0);
+ }
+EOF
+}
+
+sleeper()
+{
+ while true; do
+ /bin/sleep 1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+sleeper &
+child=$!
+
+script
+status=$?
+
+kill $child
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh
new file mode 100644
index 000000000000..5595c24aaa41
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh
@@ -0,0 +1,74 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that the proc:::signal-discard probe fires correctly
+# and with the correct arguments.
+#
+# If this fails, the script will run indefinitely; it relies on the harness
+# to time it out.
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ proc:::signal-discard
+ /args[1]->pr_pid == $child &&
+ args[1]->pr_psargs == "$longsleep" && args[2] == SIGHUP/
+ {
+ exit(0);
+ }
+EOF
+}
+
+killer()
+{
+ while true; do
+ sleep 1
+ /usr/bin/kill -HUP $child
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+longsleep="/usr/bin/sleep 10000"
+
+/usr/bin/nohup $longsleep &
+child=$!
+
+killer &
+killer=$!
+script
+status=$?
+
+kill $child
+kill $killer
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exec.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exec.ksh
new file mode 100644
index 000000000000..a4ad57212cef
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exec.ksh
@@ -0,0 +1,73 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that the proc:::exec probe fires, followed by the
+# proc:::exec-success probe (in a successful exec(2)).
+#
+# If this fails, the script will run indefinitely; it relies on the harness
+# to time it out.
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ proc:::exec
+ /curpsinfo->pr_ppid == $child && args[0] == "/bin/sleep"/
+ {
+ self->exec = 1;
+ }
+
+ proc:::exec-success
+ /self->exec/
+ {
+ exit(0);
+ }
+EOF
+}
+
+sleeper()
+{
+ while true; do
+ /bin/sleep 1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+sleeper &
+child=$!
+
+script
+status=$?
+
+kill $child
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh
new file mode 100644
index 000000000000..995eb056255d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh
@@ -0,0 +1,84 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script is identical to tst.execfail.ksh -- but it additionally checks
+# that errno is set to ENOENT in the case that an interpreter can't be
+# found.
+#
+# If this fails, the script will run indefinitely; it relies on the harness
+# to time it out.
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ proc:::exec
+ /curpsinfo->pr_ppid == $child && args[0] == "$badexec"/
+ {
+ self->exec = 1;
+ }
+
+ proc:::exec-failure
+ /self->exec && args[0] == ENOENT/
+ {
+ exit(0);
+ }
+EOF
+}
+
+sleeper()
+{
+ while true; do
+ /bin/sleep 1
+ $badexec
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+badexec=/tmp/execfail.ENOENT.ksh.$$
+dtrace=$1
+
+cat > $badexec <<EOF
+#!/this_is_a_bogus_interpreter
+EOF
+
+chmod +x $badexec
+
+sleeper &
+child=$!
+
+script
+status=$?
+
+kill $child
+rm $badexec
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh
new file mode 100644
index 000000000000..7fb3faaedc10
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh
@@ -0,0 +1,86 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that -- if a exec(2) fails -- the proc:::exec probe fires,
+# followed by the proc:::exec-success probe (in a successful exec(2)). To
+# circumvent any potential shell cleverness, this script generates exec
+# failure by generating a file with a bogus interpreter. (It seems unlikely
+# that a shell -- regardless of how clever it claims to be -- would bother to
+# validate the interpreter before exec'ing.)
+#
+# If this fails, the script will run indefinitely; it relies on the harness
+# to time it out.
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ proc:::exec
+ /curpsinfo->pr_ppid == $child && args[0] == "$badexec"/
+ {
+ self->exec = 1;
+ }
+
+ proc:::exec-failure
+ /self->exec/
+ {
+ exit(0);
+ }
+EOF
+}
+
+sleeper()
+{
+ while true; do
+ /bin/sleep 1
+ $badexec
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+badexec=/tmp/execfail.ksh.$$
+dtrace=$1
+
+cat > $badexec <<EOF
+#!/this_is_a_bogus_interpreter
+EOF
+
+chmod +x $badexec
+
+sleeper &
+child=$!
+script
+status=$?
+
+kill $child
+rm $badexec
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh
new file mode 100644
index 000000000000..867e4ffdf1eb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh
@@ -0,0 +1,92 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that the proc:::exit probe fires with the correct argument
+# when the process core dumps. The problematic bit here is making sure that
+# a process _can_ dump core -- if core dumps are disabled on both a global
+# and per-process basis, this test will fail. Rather than having this test
+# muck with coreadm(1M) settings, it will fail explicitly in this case and
+# provide a hint as to the problem. In general, machines should never be
+# running with both per-process and global core dumps disabled -- so this
+# should be a non-issue in practice.
+#
+# If this fails, the script will run indefinitely; it relies on the harness
+# to time it out.
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ proc:::exit
+ /curpsinfo->pr_ppid == $child &&
+ execargs == "$longsleep" && args[0] == CLD_DUMPED/
+ {
+ exit(0);
+ }
+
+ proc:::exit
+ /curpsinfo->pr_ppid == $child &&
+ execargs == "$longsleep" && args[0] != CLD_DUMPED/
+ {
+ printf("Child process could did dump core.");
+ exit(1);
+ }
+EOF
+}
+
+sleeper()
+{
+ while true; do
+ $longsleep &
+ /bin/sleep 1
+ kill -SEGV $!
+ done
+ /bin/rm -f $corefile
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+longsleep="/bin/sleep 10000"
+corefile=/tmp/sleep.core
+
+sleeper &
+child=$!
+
+script
+status=$?
+
+#pstop $child
+#pkill -P $child
+kill $child
+#prun $child
+
+/bin/rm -f $corefile
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitexit.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitexit.ksh
new file mode 100644
index 000000000000..0d71b15f4ee1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitexit.ksh
@@ -0,0 +1,67 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that the proc:::exit probe fires with the correct argument
+# when the process explicitly exits.
+#
+# If this fails, the script will run indefinitely; it relies on the harness
+# to time it out.
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ proc:::exit
+ /curpsinfo->pr_ppid == $child && args[0] == CLD_EXITED/
+ {
+ exit(0);
+ }
+EOF
+}
+
+sleeper()
+{
+ while true; do
+ /bin/sleep 1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+sleeper &
+child=$!
+
+script
+status=$?
+
+kill $child
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh
new file mode 100644
index 000000000000..8040ade6374b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh
@@ -0,0 +1,75 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that the proc:::exit probe fires with the correct argument
+# when the process is killed.
+#
+# If this fails, the script will run indefinitely; it relies on the harness
+# to time it out.
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ proc:::exit
+ /curpsinfo->pr_ppid == $child &&
+ curpsinfo->pr_psargs == "$longsleep" && args[0] == CLD_KILLED/
+ {
+ exit(0);
+ }
+EOF
+}
+
+sleeper()
+{
+ while true; do
+ $longsleep &
+ /usr/bin/sleep 1
+ kill -9 $!
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+longsleep="/usr/bin/sleep 10000"
+
+sleeper &
+child=$!
+
+script
+status=$?
+
+pstop $child
+pkill -P $child
+kill $child
+prun $child
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh
new file mode 100644
index 000000000000..cd3c79180464
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh
@@ -0,0 +1,84 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that the proc:::signal-send and proc:::signal-handle
+# probes fire correctly and with the correct arguments.
+#
+# If this fails, the script will run indefinitely; it relies on the harness
+# to time it out.
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ proc:::signal-send
+ /execname == "kill" && curpsinfo->pr_ppid == $child &&
+ args[1]->pr_psargs == "$longsleep" && args[2] == SIGUSR1/
+ {
+ /*
+ * This is guaranteed to not race with signal-handle.
+ */
+ target = args[1]->pr_pid;
+ }
+
+ proc:::signal-handle
+ /target == pid && args[0] == SIGUSR1/
+ {
+ exit(0);
+ }
+EOF
+}
+
+sleeper()
+{
+ while true; do
+ $longsleep &
+ sleep 1
+ /usr/bin/kill -USR1 $!
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+longsleep="/usr/bin/sleep 10000"
+
+sleeper &
+child=$!
+
+script
+status=$?
+
+pstop $child
+pkill -P $child
+kill $child
+prun $child
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c
new file mode 100644
index 000000000000..c9cc43472cab
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <signal.h>
+#include <time.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+#define NANOSEC 1000000000
+
+int
+main(int argc, char **argv)
+{
+ struct sigevent ev;
+ struct itimerspec ts;
+ sigset_t set;
+ timer_t tid;
+ char *cmd = argv[0];
+ int sig;
+
+ ev.sigev_notify = SIGEV_SIGNAL;
+ ev.sigev_signo = SIGUSR1;
+
+ if (timer_create(CLOCK_REALTIME, &ev, &tid) == -1) {
+ (void) fprintf(stderr, "%s: cannot create CLOCK_HIGHRES "
+ "timer: %s\n", cmd, strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+
+ (void) sigemptyset(&set);
+ (void) sigaddset(&set, SIGUSR1);
+ (void) sigprocmask(SIG_BLOCK, &set, NULL);
+
+ ts.it_value.tv_sec = 1;
+ ts.it_value.tv_nsec = 0;
+ ts.it_interval.tv_sec = 0;
+ ts.it_interval.tv_nsec = NANOSEC / 2;
+
+ if (timer_settime(tid, TIMER_RELTIME, &ts, NULL) == -1) {
+ (void) fprintf(stderr, "%s: timer_settime() failed: %s\n",
+ cmd, strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+
+ do {
+ (void) sigwait(&set, &sig);
+ } while(sig != SIGUSR1);
+
+ /*NOTREACHED*/
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d
new file mode 100644
index 000000000000..bb8281902e22
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option destructive
+
+proc:::signal-send
+/args[1]->p_pid == $1 && args[2] == SIGUSR1/
+{
+ sent = 1;
+}
+
+proc:::signal-clear
+/pid == $1 && args[0] == SIGUSR1 && sent/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh
new file mode 100644
index 000000000000..429173806f35
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh
@@ -0,0 +1,89 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script tests that the firing order of probes in a process is:
+#
+# 1. proc:::start
+# 2. proc:::lwp-start
+# 3. proc:::lwp-exit
+# 4. proc:::exit
+#
+# If this fails, the script will run indefinitely; it relies on the harness
+# to time it out.
+#
+script()
+{
+ $dtrace -s /dev/stdin <<EOF
+ proc:::start
+ /curpsinfo->pr_ppid == $child/
+ {
+ self->start = 1;
+ }
+
+ proc:::lwp-start
+ /self->start/
+ {
+ self->lwp_start = 1;
+ }
+
+ proc:::lwp-exit
+ /self->lwp_start/
+ {
+ self->lwp_exit = 1;
+ }
+
+ proc:::exit
+ /self->lwp_exit == 1/
+ {
+ exit(0);
+ }
+EOF
+}
+
+sleeper()
+{
+ while true; do
+ /usr/bin/sleep 1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+sleeper &
+child=$!
+
+script
+status=$?
+
+kill $child
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZERO.profile.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZERO.profile.d
new file mode 100644
index 000000000000..e4e031bab712
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZERO.profile.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * profile without valid value keyword just call with 'n'.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-n
+{
+ printf("This test should fail\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonens.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonens.d
new file mode 100644
index 000000000000..3ed28b1b15ba
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonens.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call profile-'ns' less than 200 micro seconds.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+#pragma D option quiet
+
+profile-1ns
+{
+ printf("Calls 'ns' less than 200 micro seconds\n");
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonensec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonensec.d
new file mode 100644
index 000000000000..7b4df199d303
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonensec.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call profile-1nsec; less than 200 micro seconds.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+#pragma D option quiet
+
+profile-1nsec
+{
+ printf("Call profile-1nsec; less than 200 micro seconds\n");
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneus.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneus.d
new file mode 100644
index 000000000000..6a64a3a2d4e1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneus.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call profile-us; less than 200 micro seconds.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+#pragma D option quiet
+
+profile-1us
+{
+ printf(" Calling profile-us less than 200 micro seconds should fail\n");
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneusec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneusec.d
new file mode 100644
index 000000000000..b6b80bea03bd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneusec.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * profile-usec; less than 200 micro seconds.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+#pragma D option quiet
+
+profile-1usec
+{
+ printf("profile-usec; less than 200 micro seconds \n");
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d
new file mode 100644
index 000000000000..26a40b4133e0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Either one of arg0 (or) arg1 should be 0 and non-zero.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-1
+/(arg0 != 0 && arg1 == 0) || (arg0 == 0 && arg1 != 0)/
+{
+ printf("Test passed; either arg0/arg1 is zero\n");
+ exit(0);
+}
+
+tick-1
+/(arg0 == 0 && arg1 == 0) || (arg0 != 0 && arg1 != 0)/
+{
+ printf("Test failed; either arg0 (or) arg1 should be non zero\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d.out
new file mode 100644
index 000000000000..0bd335391684
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d.out
@@ -0,0 +1,2 @@
+Test passed; either arg0/arg1 is zero
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.basic.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.basic.d
new file mode 100644
index 000000000000..df8bf98820f3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.basic.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * profile-n simple test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1
+{
+ printf("This test is a simple profile-n provider test\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.basic.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.basic.d.out
new file mode 100644
index 000000000000..09005bbb8a9b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.basic.d.out
@@ -0,0 +1,2 @@
+This test is a simple profile-n provider test
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh
new file mode 100644
index 000000000000..358d3625da39
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh
@@ -0,0 +1,74 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -qs /dev/stdin <<EOF
+ profile-1234hz
+ /arg0 != 0/
+ {
+ @[func(arg0)] = count();
+ }
+
+ tick-100ms
+ /i++ == 50/
+ {
+ exit(0);
+ }
+EOF
+}
+
+spinny()
+{
+ while true; do
+ /usr/bin/date > /dev/null
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+spinny &
+child=$!
+
+#
+# This is gutsy -- we're assuming that mutex_enter(9F) will show up in the
+# output. This is most likely _not_ to show up in the output if the
+# platform does not support arbitrary resolution interval timers -- but
+# the above script was stress-tested down to 100 hertz and still ran
+# successfully on all platforms, so one is hopeful that this test will pass
+# even in that case.
+#
+script | tee /dev/fd/2 | grep mutex_enter > /dev/null
+status=$?
+
+kill $child
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh
new file mode 100644
index 000000000000..4652ff32cd95
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh
@@ -0,0 +1,70 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -qs /dev/stdin <<EOF
+ profile-1234hz
+ /arg0 != 0/
+ {
+ @[mod(arg0)] = count();
+ }
+
+ tick-100ms
+ /i++ == 20/
+ {
+ exit(0);
+ }
+EOF
+}
+
+spinny()
+{
+ while true; do
+ /usr/bin/date > /dev/null
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+spinny &
+child=$!
+
+#
+# The only thing we can be sure of is that some module named "unix" (or
+# "genunix") did some work -- so that's all we'll check.
+#
+script | tee /dev/fd/2 | grep unix > /dev/null
+status=$?
+
+kill $child
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d
new file mode 100644
index 000000000000..ba69def5955a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple profile-hz test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-100hz
+{
+ printf("This test is a simple profile-hz provider test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d.out
new file mode 100644
index 000000000000..711f635bbaa8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d.out
@@ -0,0 +1 @@
+This test is a simple profile-hz provider test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d
new file mode 100644
index 000000000000..7ec573e38bc2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple profile-ms simple test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1ms
+{
+ printf("This test is a simple profile-ms provider test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d.out
new file mode 100644
index 000000000000..1fe17e7c6f2b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d.out
@@ -0,0 +1 @@
+This test is a simple profile-ms provider test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d
new file mode 100644
index 000000000000..80451e85bcad
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple profile-msec simple test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1msec
+{
+ printf("This test is a simple profile-msec provider test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d.out
new file mode 100644
index 000000000000..c3fb4a3b630e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d.out
@@ -0,0 +1 @@
+This test is a simple profile-msec provider test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d
new file mode 100644
index 000000000000..37b20907bbc1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * profile-<number> simple test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-100
+{
+ printf("This test is a simple profile implicit hz test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d.out
new file mode 100644
index 000000000000..c9409ce5f51e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d.out
@@ -0,0 +1 @@
+This test is a simple profile implicit hz test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d
new file mode 100644
index 000000000000..72f95ad3c921
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple profile-2000000000ns simple test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-2000000000ns
+{
+ printf("This test is a simple profile-ns provider test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d.out
new file mode 100644
index 000000000000..86251d01889f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d.out
@@ -0,0 +1 @@
+This test is a simple profile-ns provider test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d
new file mode 100644
index 000000000000..d0236e9a5b53
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple profile-nsec simple test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-2000000000nsec
+{
+ printf("This test is a simple profile-nsec provider test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d.out
new file mode 100644
index 000000000000..890b769de840
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d.out
@@ -0,0 +1 @@
+This test is a simple profile-nsec provider test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d
new file mode 100644
index 000000000000..65201fc84af7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple profile-s simple test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1s
+{
+ printf("This test is a simple profile-s provider test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d.out
new file mode 100644
index 000000000000..03a0cf220f34
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d.out
@@ -0,0 +1 @@
+This test is a simple profile-s provider test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d
new file mode 100644
index 000000000000..3e52ac5c6071
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple profile-sec simple test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-1sec
+{
+ printf("This test is a simple profile-sec provider test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d.out
new file mode 100644
index 000000000000..9091592d1f47
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d.out
@@ -0,0 +1 @@
+This test is a simple profile-sec provider test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d
new file mode 100644
index 000000000000..32ab415587e6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple profile-us simple test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-200us
+{
+ printf("This test is a simple profile-us provider test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d.out
new file mode 100644
index 000000000000..aa2706423568
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d.out
@@ -0,0 +1 @@
+This test is a simple profile-us provider test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d
new file mode 100644
index 000000000000..78df000bddc2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple profile-usec simple test.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+profile-200usec
+{
+ printf("This test is a simple profile-usec provider test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d.out
new file mode 100644
index 000000000000..96dfef1c15ac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d.out
@@ -0,0 +1 @@
+This test is a simple profile-usec provider test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh
new file mode 100644
index 000000000000..218a651c9175
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh
@@ -0,0 +1,70 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -qs /dev/stdin <<EOF
+ profile-1234hz
+ /arg0 != 0/
+ {
+ @[sym(arg0)] = count();
+ }
+
+ tick-100ms
+ /i++ == 50/
+ {
+ exit(0);
+ }
+EOF
+}
+
+spinny()
+{
+ while true; do
+ /usr/bin/date > /dev/null
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+spinny &
+child=$!
+
+#
+# This is the same gutsy test as that found in the func() test; see that
+# test for the rationale.
+#
+script | tee /dev/fd/2 | grep mutex_enter > /dev/null
+status=$?
+
+kill $child
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh
new file mode 100644
index 000000000000..69c0f84a490c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh
@@ -0,0 +1,71 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -qs /dev/stdin <<EOF
+ profile-1234hz
+ /arg1 != 0/
+ {
+ @[ufunc(arg1)] = count();
+ }
+
+ tick-100ms
+ /i++ == 20/
+ {
+ exit(0);
+ }
+EOF
+}
+
+spinny()
+{
+ while true; do
+ let i=i+1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+spinny &
+child=$!
+
+#
+# The only thing we can be sure of here is that we caught some function in
+# ksh doing work. (This actually goes one step further and assumes that we
+# catch some non-static function in ksh.)
+#
+script | tee /dev/fd/2 | grep 'ksh`[a-zA-Z_]' > /dev/null
+status=$?
+
+kill $child
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c
new file mode 100644
index 000000000000..96d78a431cc4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+typedef void f(int x);
+
+static void
+f_a(int i)
+{
+}
+
+static void
+f_b(int i)
+{
+}
+
+static void
+f_c(int i)
+{
+}
+
+static void
+f_d(int i)
+{
+}
+
+static void
+f_e(int i)
+{
+}
+
+static void
+fN(f func, int i)
+{
+ func(i);
+}
+
+int
+main()
+{
+ fN(f_a, 1);
+ fN(f_b, 2);
+ fN(f_c, 3);
+ fN(f_d, 4);
+ fN(f_e, 5);
+ fN(f_a, 11);
+ fN(f_c, 13);
+ fN(f_d, 14);
+ fN(f_a, 101);
+ fN(f_c, 103);
+ fN(f_c, 1003);
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh
new file mode 100644
index 000000000000..4689355a8e11
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh
@@ -0,0 +1,66 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# ufunc() values sort as expected
+#
+# SECTION: Aggregations, Printing Aggregations
+#
+# NOTES: Assumes that the order of user function addresses will follow
+# the function declaration order.
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -c ./tst.ufuncsort.exe -s /dev/stdin <<EOF
+
+
+ #pragma D option quiet
+ #pragma D option aggsortkey
+
+ pid\$target::fN:entry
+ {
+ @[ufunc(arg0)] = count();
+ }
+EOF
+
+status=$?
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+ exit $status
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh.out
new file mode 100644
index 000000000000..a364322b51b5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh.out
@@ -0,0 +1,6 @@
+
+ tst.ufuncsort.exe`f_a 3
+ tst.ufuncsort.exe`f_b 1
+ tst.ufuncsort.exe`f_c 4
+ tst.ufuncsort.exe`f_d 2
+ tst.ufuncsort.exe`f_e 1
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh
new file mode 100644
index 000000000000..6ca823f5ddd3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh
@@ -0,0 +1,69 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -qs /dev/stdin <<EOF
+ profile-1234hz
+ /arg1 != 0/
+ {
+ @[umod(arg1)] = count();
+ }
+
+ tick-100ms
+ /i++ == 20/
+ {
+ exit(0);
+ }
+EOF
+}
+
+spinny()
+{
+ while true; do
+ let i=i+1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+spinny &
+child=$!
+
+#
+# The only thing we can be sure of here is that ksh is doing some work.
+#
+script | tee /dev/fd/2 | grep -w ksh > /dev/null
+status=$?
+
+kill $child
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh
new file mode 100644
index 000000000000..b1a3ab9de2ff
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh
@@ -0,0 +1,70 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -qs /dev/stdin <<EOF
+ profile-1234hz
+ /arg1 != 0/
+ {
+ @[usym(arg1)] = count();
+ }
+
+ tick-100ms
+ /i++ == 20/
+ {
+ exit(0);
+ }
+EOF
+}
+
+spinny()
+{
+ while true; do
+ let i=i+1
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+spinny &
+child=$!
+
+#
+# This test is essentially the same as that in the ufunc test; see that
+# test for the rationale.
+#
+script | tee /dev/fd/2 | grep 'ksh`[a-zA-Z_]' > /dev/null
+status=$?
+
+kill $child
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_INVAL.wrongdec4.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_INVAL.wrongdec4.d
new file mode 100644
index 000000000000..0a7aa14a8e2a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_INVAL.wrongdec4.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * call profile<provider name>; called with no "::::".
+ * should fail with compilation error.
+ *
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile::::tick-1sec
+{
+ trace(i);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.nonprofile.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.nonprofile.d
new file mode 100644
index 000000000000..1356a8960e77
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.nonprofile.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test;
+ * Call user created provider. Make sure it gives compilation error.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::test
+/i < 3/
+{
+ i++;
+ trace(i);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec1.d
new file mode 100644
index 000000000000..e06edee58b28
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec1.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * call profile::<provider name>; called with two "::".
+ * should fail with compilation error.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile::tick-1sec
+{
+ trace(i);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec2.d
new file mode 100644
index 000000000000..ea8909caa24a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec2.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * call profile:<provider name>; called with one ":".
+ * should fail with compilation error.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:tick-1sec
+{
+ trace(i);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec3.d
new file mode 100644
index 000000000000..edea0b92987a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec3.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * call profile<provider name>; called with no ":".
+ * should fail with compilation error.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profiletick-1sec
+{
+ trace(i);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.basics.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.basics.d
new file mode 100644
index 000000000000..6b6e5269b457
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.basics.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test;
+ * Call same profile provider two times
+ * Match expected output in tst.basics.d.out
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 3/
+{
+ i++;
+ trace(i);
+}
+
+profile:::tick-1sec
+/i == 3/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.basics.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.basics.d.out
new file mode 100644
index 000000000000..190a18037c64
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.basics.d.out
@@ -0,0 +1 @@
+123
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginexit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginexit.d
new file mode 100644
index 000000000000..202abe67010e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginexit.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ exit(0);
+}
+
+BEGIN
+{
+ printf("shouldn't be here...");
+ here++;
+}
+
+END
+{
+ exit(here);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginprof.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginprof.d
new file mode 100644
index 000000000000..99989d949ab7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginprof.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * print the 'probeprov, probemod, probefunc, probename' from
+ * BEGIN
+ * Match the output from tst.beginprof.d.out
+ *
+ * SECTION: profile Provider/profile-n probes;
+ * Variables/Built-in Variables
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("%s %s %s %s", probeprov, probemod, probefunc, probename);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginprof.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginprof.d.out
new file mode 100644
index 000000000000..d28a05725eb8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginprof.d.out
@@ -0,0 +1 @@
+dtrace BEGIN
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probattrs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probattrs.d
new file mode 100644
index 000000000000..bd24ca01b36e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probattrs.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * print the 'probeprov, probemod, probefunc, probename' at once.
+ * Match expected output in tst.probattrs.d.out
+ *
+ *
+ * SECTION: profile Provider/tick-n probes;
+ * Variables/Built-in Variables
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+{
+ printf("%s %s %s %s", probeprov, probemod, probefunc, probename);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probattrs.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probattrs.d.out
new file mode 100644
index 000000000000..2a13979cf662
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probattrs.d.out
@@ -0,0 +1 @@
+profile tick-1sec
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probefunc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probefunc.d
new file mode 100644
index 000000000000..fa7c47c5a2fe
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probefunc.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * print the 'probefunc' field i.e. Current probe description's function
+ * field.
+ * Match expected output in tst.probefunc.d.out
+ *
+ * SECTION: profile Provider/tick-n probes;
+ * Variables/Built-in Variables
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+{
+ printf("probe funct = %s", probefunc);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probefunc.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probefunc.d.out
new file mode 100644
index 000000000000..de191dd60d8d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probefunc.d.out
@@ -0,0 +1 @@
+probe funct =
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probemod.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probemod.d
new file mode 100644
index 000000000000..89fd8b2a25b2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probemod.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * print the 'probemod' field i.e. Current probe description's module
+ * field.
+ * Match expected output in tst.probemod.d.out
+ *
+ * SECTION: profile Provider/tick-n probes;
+ * Variables/Built-in Variables
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+{
+ printf("probe description module field = %s", probemod);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probemod.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probemod.d.out
new file mode 100644
index 000000000000..1c95a770f2aa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probemod.d.out
@@ -0,0 +1 @@
+probe description module field =
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probename.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probename.d
new file mode 100644
index 000000000000..c58097f9f59b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probename.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * print the 'probename' field i.e. Current probe description's name
+ * field.
+ * Match expected output in tst.probename.d.out
+ *
+ * SECTION: profile Provider/tick-n probes;
+ * Variables/Built-in Variables
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+{
+ printf("probe name = %s", probename);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probename.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probename.d.out
new file mode 100644
index 000000000000..e5ff3e040aa3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probename.d.out
@@ -0,0 +1 @@
+probe name = tick-1sec
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probprov.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probprov.d
new file mode 100644
index 000000000000..3c3ccef833a1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probprov.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * print the 'probeprov' field i.e. Current probe description's provider
+ * field.
+ * Match expected output in tst.probeprov.d.out
+ *
+ * SECTION: profile Provider/tick-n probes;
+ * Variables/Built-in Variables
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+{
+ printf("probe description provider = %s", probeprov);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probprov.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probprov.d.out
new file mode 100644
index 000000000000..d8ca594f6acc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probprov.d.out
@@ -0,0 +1 @@
+probe description provider = profile
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profend.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profend.d
new file mode 100644
index 000000000000..9ab438a4a6f8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profend.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * Call simple profile with END profile.
+ * Match expected output in tst.profend.d.out
+ *
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+{
+ i++;
+ trace(i);
+ exit(0);
+}
+
+dtrace:::END
+{
+ printf("\nI'm at END");
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profend.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profend.d.out
new file mode 100644
index 000000000000..42e30052f5d3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profend.d.out
@@ -0,0 +1,2 @@
+1
+I'm at END
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profexit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profexit.d
new file mode 100644
index 000000000000..884053f1bd5f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profexit.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test;
+ * Call simple profile
+ * Match expected output in tst.profexit.d.out
+ *
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+{
+ i++;
+ trace(i);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profexit.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profexit.d.out
new file mode 100644
index 000000000000..d00491fd7e5b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profexit.d.out
@@ -0,0 +1 @@
+1
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.trace.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.trace.d
new file mode 100644
index 000000000000..ec7053d3ec4f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.trace.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * Call simple profile with trace() in END profile
+ * Match expected output in tst.trace.d.out
+ *
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+{
+ i++;
+ exit(0);
+}
+
+dtrace:::END
+{
+ trace(i);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.trace.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.trace.d.out
new file mode 100644
index 000000000000..d00491fd7e5b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.trace.d.out
@@ -0,0 +1 @@
+1
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.twoprof.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.twoprof.d
new file mode 100644
index 000000000000..352ed0b8cbaf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.twoprof.d
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Simple profile provider test.
+ * Call two different profile provider
+ * Match expected output in tst.twoprof.d.out
+ *
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 3/
+{
+ i++;
+ trace(i);
+}
+
+profile:::tick-100msec
+/i == 3/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.twoprof.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.twoprof.d.out
new file mode 100644
index 000000000000..190a18037c64
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.twoprof.d.out
@@ -0,0 +1 @@
+123
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c
new file mode 100644
index 000000000000..e39108366e39
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <unistd.h>
+#include <signal.h>
+
+int
+main(int argc, char **argv)
+{
+ sigset_t ss;
+
+ (void) sigemptyset(&ss);
+ (void) sigaddset(&ss, SIGINT);
+ (void) sigprocmask(SIG_BLOCK, &ss, NULL);
+
+ do {
+ (void) getpid();
+ (void) sigpending(&ss);
+ } while (!sigismember(&ss, SIGINT));
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d
new file mode 100644
index 000000000000..cdc7154750b6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for raise
+ *
+ * SECTION: Actions and Subroutines/raise()
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ /*
+ * Wait no more than a second for the process to call getpid().
+ */
+ timeout = timestamp + 1000000000;
+}
+
+syscall::getpid:entry
+/pid == $1/
+{
+ trace("raised");
+ raise(SIGINT);
+ /*
+ * Wait no more than half a second for the process to die.
+ */
+ timeout = timestamp + 500000000;
+}
+
+syscall::exit:entry
+{
+ exit(0);
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c
new file mode 100644
index 000000000000..9089283f7893
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <unistd.h>
+#include <signal.h>
+#include <stdlib.h>
+
+static void
+handle(int sig)
+{
+ exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ struct sigaction sa;
+
+ sa.sa_handler = handle;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+
+ (void) sigaction(SIGINT, &sa, NULL);
+
+ for (;;) {
+ (void) getpid();
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d
new file mode 100644
index 000000000000..4f68a0b93b3b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for raise
+ *
+ * SECTION: Actions and Subroutines/raise()
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ /*
+ * Wait no more than a second for the process to call getpid().
+ */
+ timeout = timestamp + 1000000000;
+}
+
+syscall::getpid:return
+/pid == $1/
+{
+ trace("raised");
+ raise(SIGINT);
+ /*
+ * Wait no more than half a second for the process to die.
+ */
+ timeout = timestamp + 500000000;
+}
+
+syscall::exit:entry
+{
+ exit(0);
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c
new file mode 100644
index 000000000000..9089283f7893
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <unistd.h>
+#include <signal.h>
+#include <stdlib.h>
+
+static void
+handle(int sig)
+{
+ exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ struct sigaction sa;
+
+ sa.sa_handler = handle;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+
+ (void) sigaction(SIGINT, &sa, NULL);
+
+ for (;;) {
+ (void) getpid();
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d
new file mode 100644
index 000000000000..cdc7154750b6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for raise
+ *
+ * SECTION: Actions and Subroutines/raise()
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ /*
+ * Wait no more than a second for the process to call getpid().
+ */
+ timeout = timestamp + 1000000000;
+}
+
+syscall::getpid:entry
+/pid == $1/
+{
+ trace("raised");
+ raise(SIGINT);
+ /*
+ * Wait no more than half a second for the process to die.
+ */
+ timeout = timestamp + 500000000;
+}
+
+syscall::exit:entry
+{
+ exit(0);
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.aggrate.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.aggrate.d
new file mode 100644
index 000000000000..513cd31266d1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.aggrate.d
@@ -0,0 +1,68 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * If the aggregation rate is set properly, there should be no aggregation
+ * drops.
+ *
+ * SECTION: Aggregations/Minimizing drops;
+ * Options and Tunables/aggrate;
+ * Options and Tunables/aggsize
+ */
+
+/*
+ * We rely on the fact that at least 30 bytes must be stored per aggregation
+ * iteration, but that no more than 300 bytes are stored per iteration.
+ * We are going to let this run for ten seconds. If the aggregation rate
+ * is being set properly, there should be no aggregation drops. Note that
+ * this test (regrettably) may be scheduling sensitive -- but it should only
+ * fail on the most pathological systems.
+ */
+#pragma D option aggsize=300
+#pragma D option aggrate=10msec
+#pragma D option quiet
+
+int n;
+
+tick-100msec
+/n < 100/
+{
+ @a[n++] = sum(n);
+}
+
+tick-100msec
+/n == 100/
+{
+ exit(0);
+}
+
+END
+{
+ printa("%10d\n", @a);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.aggrate.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.aggrate.d.out
new file mode 100644
index 000000000000..c45f92961b34
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.aggrate.d.out
@@ -0,0 +1,101 @@
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.statusrate.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.statusrate.d
new file mode 100644
index 000000000000..43c23bfd940f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.statusrate.d
@@ -0,0 +1,72 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test of statusrate option.
+ *
+ * SECTION: Options and Tunables/statusrate
+ */
+
+/*
+ * Tests the statusrate option, by checking that the time delta between
+ * exit() and END is at least as long as mandated by the statusrate.
+ */
+
+#pragma D option statusrate=10sec
+
+inline uint64_t NANOSEC = 1000000000;
+
+tick-1sec
+/n++ > 5/
+{
+ exit(2);
+ ts = timestamp;
+}
+
+END
+/(this->delta = timestamp - ts) > 2 * NANOSEC/
+{
+ exit(0);
+}
+
+END
+/this->delta <= 2 * NANOSEC/
+{
+ printf("delta between exit() and END (%u nanos) too small",
+ this->delta);
+ exit(1);
+}
+
+END
+/this->delta > 20 * NANOSEC/
+{
+ printf("delta between exit() and END (%u nanos) too large",
+ this->delta);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.switchrate.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.switchrate.d
new file mode 100644
index 000000000000..691b31cd8bbe
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.switchrate.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * If the switch rate is set properly, there should be no drops.
+ *
+ * SECTION: Buffers and Buffering/switch Policy;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/switchrate
+ */
+
+/*
+ * We rely on the fact that at least 8 bytes must be stored per iteration
+ * (EPID plus data), but that no more than 40 bytes are stored per iteration.
+ * We are going to let this run for ten seconds. If the switch rate
+ * is being set properly, there should be no drops. Note that this test
+ * (regrettably) may be scheduling sensitive -- but it should only fail on
+ * the most pathological systems.
+ */
+#pragma D option bufsize=40
+#pragma D option switchrate=10msec
+#pragma D option quiet
+
+int n;
+
+tick-100msec
+/n < 100/
+{
+ printf("%10d\n", n++);
+}
+
+tick-100msec
+/n == 100/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.switchrate.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.switchrate.d.out
new file mode 100644
index 000000000000..c45f92961b34
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.switchrate.d.out
@@ -0,0 +1,101 @@
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.basename.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.basename.d
new file mode 100644
index 000000000000..3def9649300b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.basename.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::entry
+/on/
+{
+ trace(basename((char *)rand()));
+}
+
+fbt:::entry
+/on/
+{
+ trace(basename((char *)arg1));
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.caller.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.caller.d
new file mode 100644
index 000000000000..b9777c1d031f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.caller.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Make sure that the caller variable is safe to use at every fbt probe
+ * point.
+ *
+ * SECTION: Variables/Built-in Variables;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ trace(caller);
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.cleanpath.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.cleanpath.d
new file mode 100644
index 000000000000..729f320b3908
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.cleanpath.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(cleanpath((char *)rand()));
+}
+
+fbt:::entry
+/on/
+{
+ trace(cleanpath((char *)arg1));
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d
new file mode 100644
index 000000000000..beb1c50bba38
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d
@@ -0,0 +1,85 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ * We set our buffer size absurdly low to prevent a flood of errors that we
+ * don't care about. We set our statusrate to be infinitely short to cause
+ * lots of activity by the DTrace process.
+ *
+ * SECTION: Actions and Subroutines/copyin();
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+
+#pragma D option bufsize=32
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=1nsec
+
+syscall:::entry
+{
+ n++;
+ trace(copyin(rand(), 1));
+}
+
+syscall:::entry
+{
+ trace(copyin(rand() | 1, 1));
+}
+
+syscall:::entry
+{
+ trace(copyin(NULL, 1));
+}
+
+dtrace:::ERROR
+{
+ err++;
+}
+
+tick-1sec
+/sec++ == 10/
+{
+ exit(2);
+}
+
+END
+/n == 0 || err == 0/
+{
+ exit(1);
+}
+
+END
+/n != 0 && err != 0/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin2.d
new file mode 100644
index 000000000000..aef094408aaa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin2.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * Test that there is no value of 'size' which can be passed to copyin
+ * to cause mischief. The somewhat odd order of operations ensures
+ * that we test both size = 0 and size = 0xfff...fff
+ */
+#include <sys/types.h>
+
+
+#if defined(_LP64)
+#define MAX_BITS 63
+size_t size;
+#else
+#define MAX_BITS 31
+size_t size;
+#endif
+
+syscall:::
+/pid == $pid/
+{
+ printf("size = 0x%lx\n", (ulong_t)size);
+}
+
+syscall:::
+/pid == $pid/
+{
+ tracemem(copyin(curthread->t_procp->p_user.u_envp, size), 10);
+}
+
+syscall:::
+/pid == $pid && size > (1 << MAX_BITS)/
+{
+ exit(0);
+}
+
+syscall:::
+/pid == $pid/
+{
+ size = (size << 1ULL) | 1ULL;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ddi_pathname.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ddi_pathname.d
new file mode 100644
index 000000000000..74275685cb69
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ddi_pathname.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(ddi_pathname((struct dev_info *)rand(), rand()));
+}
+
+fbt:::entry
+/on/
+{
+ trace(ddi_pathname((struct dev_info *)arg1, rand()));
+}
+
+tick-1sec
+/n++ == 20/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.dirname.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.dirname.d
new file mode 100644
index 000000000000..791d9b5f3032
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.dirname.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(dirname((char *)rand()));
+}
+
+fbt:::entry
+/on/
+{
+ trace(dirname((char *)arg1));
+}
+
+tick-1sec
+/n++ == 20/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.errno.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.errno.d
new file mode 100644
index 000000000000..d3f238b79ea8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.errno.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect errno at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+ @a[errno] = count();
+}
+
+profile-4999hz
+{
+ @a[errno] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.execname.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.execname.d
new file mode 100644
index 000000000000..cd9ca211516e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.execname.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect execname at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+ @a[execname] = count();
+}
+
+profile-4999hz
+{
+ @a[execname] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.gid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.gid.d
new file mode 100644
index 000000000000..f8f90e73641f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.gid.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect gid at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+ @a[gid] = count();
+}
+
+profile-4999hz
+{
+ @a[gid] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.hton.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.hton.d
new file mode 100644
index 000000000000..d573bfd1e946
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.hton.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(htons(0x1122));
+}
+
+fbt:::
+/on/
+{
+ trace(htonl(0x11223344));
+}
+
+fbt:::
+/on/
+{
+ trace(htonll(0x1122334455667788));
+}
+
+fbt:::
+/on/
+{
+ trace(ntohs(0x1122));
+}
+
+fbt:::
+/on/
+{
+ trace(ntohl(0x11223344));
+}
+
+fbt:::
+/on/
+{
+ trace(ntohll(0x1122334455667788));
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.index.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.index.d
new file mode 100644
index 000000000000..22b0b5bc7d7e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.index.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(index((char *)rand(), (char *)(rand() ^ vtimestamp)));
+}
+
+fbt:::
+/on/
+{
+ trace(rindex((char *)rand(), (char *)(rand() ^ vtimestamp,
+ timestamp)));
+}
+
+fbt:::entry
+/on/
+{
+ trace(index((char *)arg0, (char *)arg1, rand()));
+}
+
+fbt:::entry
+/on/
+{
+ trace(rindex((char *)arg0, (char *)arg1));
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.msgdsize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.msgdsize.d
new file mode 100644
index 000000000000..c4e7c348fd78
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.msgdsize.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Make sure that the msgdsize safe to use at every fbt probe
+ *
+ * SECTION: Actions and Subroutines/msgdsize();
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(msgdsize((mblk_t *)rand()));
+}
+
+fbt:::entry
+/on/
+{
+ trace(msgdsize((mblk_t *)arg1));
+}
+
+tick-1sec
+/n++ == 20/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.msgsize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.msgsize.d
new file mode 100644
index 000000000000..42aebe4cd147
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.msgsize.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Make sure that the msgsize safe to use at every fbt probe
+ *
+ * SECTION: Actions and Subroutines/msgsize();
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(msgsize((mblk_t *)rand()));
+}
+
+fbt:::
+/on/
+{
+ trace(msgdsize((mblk_t *)rand()));
+}
+
+tick-1sec
+/n++ == 20/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.null.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.null.d
new file mode 100644
index 000000000000..cafa3af717b2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.null.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * trace with NULL argument - generate a bunch of errors
+ *
+ * SECTION: Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy
+ */
+
+/*
+ * We set our buffer size absurdly low to prevent a flood of errors that we
+ * don't care about.
+ */
+
+#pragma D option bufsize=16
+#pragma D option bufpolicy=ring
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ n++;
+ trace(*(int *)NULL);
+}
+
+dtrace:::ERROR
+{
+ err++;
+}
+
+tick-1sec
+/sec++ == 10/
+{
+ exit(2);
+}
+
+END
+/n == 0 || err == 0/
+{
+ exit(1);
+}
+
+END
+/n != 0 && err != 0/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.pid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.pid.d
new file mode 100644
index 000000000000..2b7a92e13bac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.pid.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect pid at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+ @a[pid] = count();
+}
+
+profile-4999hz
+{
+ @a[pid] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ppid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ppid.d
new file mode 100644
index 000000000000..faf07dc482d0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ppid.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect ppid at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+ @a[ppid] = count();
+}
+
+profile-4999hz
+{
+ @a[ppid] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.progenyof.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.progenyof.d
new file mode 100644
index 000000000000..d488fe2e898f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.progenyof.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * trace progenyof() at every fbt probe point.
+ *
+ * SECTION: Actions and Subroutines/progenyof();
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ trace(progenyof(rand()));
+}
+
+profile-4999hz
+{
+ trace(progenyof(rand()));
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.random.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.random.d
new file mode 100644
index 000000000000..8d157efd459d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.random.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * trace rand() at every fbt probe point.
+ *
+ * SECTION: Actions and Subroutines/rand();
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy
+ */
+
+/*
+ * We set our buffer size absurdly low to prevent a flood of errors that we
+ * don't care about.
+ */
+
+#pragma D option bufsize=16
+#pragma D option bufpolicy=ring
+
+fbt:::
+{
+ n++;
+ trace(*(int *)rand());
+}
+
+dtrace:::ERROR
+{
+ err++;
+}
+
+tick-1sec
+/sec++ == 10/
+{
+ exit(2);
+}
+
+END
+/n == 0 || err == 0/
+{
+ exit(1);
+}
+
+END
+/n != 0 && err != 0/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.rw.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.rw.d
new file mode 100644
index 000000000000..c1fcd85bac04
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.rw.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ @[rw_read_held((struct rwlock *)&`unp_global_rwlock)] = count();
+ @[rw_read_held((struct rwlock *)rand())] = count();
+}
+
+fbt:::
+/on/
+{
+ @[rw_write_held((struct rwlock *)&`unp_global_rwlock)] = count();
+ @[rw_write_held((struct rwlock *)rand())] = count();
+}
+
+fbt:::
+/on/
+{
+ @[rw_iswriter((struct rwlock *)&`unp_global_rwlock)] = count();
+ @[rw_iswriter((struct rwlock *)rand())] = count();
+}
+
+tick-1sec
+/n++ == 20/
+{
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.shortstr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.shortstr.d
new file mode 100644
index 000000000000..188f705c7c18
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.shortstr.d
@@ -0,0 +1,77 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+#pragma D option strsize=16
+
+BEGIN
+{
+ this->str = ",,,Carrots,,Barley,Oatmeal,,,,,,,,,,,,,,,,,,Beans,";
+}
+
+BEGIN
+{
+ strtok(this->str, ",");
+}
+
+BEGIN
+{
+ this->str = ",,,,,,,,,,,,,,,,,,,,,,Carrots,";
+ strtok(this->str, ",");
+}
+
+BEGIN
+{
+ strtok(this->str, "a");
+}
+
+BEGIN
+{
+ printf("%s\n", substr(this->str, 1, 40));
+}
+
+BEGIN
+{
+ printf("%s\n", strjoin(this->str, this->str));
+}
+
+BEGIN
+{
+ this->str1 = ".........................................";
+ printf("%d\n", index(this->str, this->str1));
+}
+
+BEGIN
+{
+ printf("%d\n", rindex(this->str, this->str1));
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stack.d
new file mode 100644
index 000000000000..57588b4d8bc9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stack.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Call stack() at every fbt probe point.
+ *
+ * SECTION: Actions and Subroutines/stack();
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ stack();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stackdepth.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stackdepth.d
new file mode 100644
index 000000000000..a39387fde04d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stackdepth.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test that the stackdepth variable is safe to use at every fbt probe
+ * point.
+ *
+ * SECTION: Variables/Built-in Variables;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ trace(stackdepth);
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stddev.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stddev.d
new file mode 100644
index 000000000000..927930d03995
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stddev.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Call stddev() at every fbt probe point.
+ *
+ * SECTION: Actions and Subroutines/stddev();
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ @a = stddev(1);
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strchr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strchr.d
new file mode 100644
index 000000000000..bc95c4861c6d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strchr.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(strchr((char *)(rand() ^ timestamp), rand()));
+}
+
+fbt:::
+/on/
+{
+ trace(strrchr((char *)(rand() ^ timestamp), rand()));
+}
+
+fbt:::entry
+/on/
+{
+ trace(strchr((char *)arg0, '!'));
+}
+
+fbt:::entry
+/on/
+{
+ trace(strrchr((char *)arg0, '!'));
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strjoin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strjoin.d
new file mode 100644
index 000000000000..5ed2935d960b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strjoin.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(strjoin((char *)rand(), (char *)(rand() ^ vtimestamp)));
+}
+
+fbt:::entry
+/on/
+{
+ trace(strjoin((char *)arg0, (char *)arg1));
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strstr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strstr.d
new file mode 100644
index 000000000000..025e5472ec24
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strstr.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(strstr((char *)rand(), (char *)(rand() ^ vtimestamp)));
+}
+
+fbt:::entry
+/on/
+{
+ trace(strstr((char *)arg0, (char *)arg1));
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strtok.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strtok.d
new file mode 100644
index 000000000000..1027d2ed542b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strtok.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(strtok((char *)rand(), (char *)(rand() ^ vtimestamp)));
+}
+
+fbt:::entry
+/on/
+{
+ trace(strtok((char *)arg0, (char *)arg1));
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.substr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.substr.d
new file mode 100644
index 000000000000..d5ed9a48fc5b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.substr.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ on = (timestamp / 1000000000) & 1;
+}
+
+fbt:::
+/on/
+{
+ trace(substr((char *)rand(), rand() ^ vtimestamp));
+}
+
+fbt:::
+/on/
+{
+ trace(substr((char *)rand(), -rand() ^ vtimestamp));
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ucaller.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ucaller.d
new file mode 100644
index 000000000000..524c88b7750c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ucaller.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect ucaller at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+ @a[ucaller] = count();
+}
+
+profile-4999hz
+{
+ @a[ucaller] = count();
+}
+
+tick-1sec
+/n++ == 30/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.uid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.uid.d
new file mode 100644
index 000000000000..b546457e7838
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.uid.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect uid at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+ @a[uid] = count();
+}
+
+profile-4999hz
+{
+ @a[uid] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.unalign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.unalign.d
new file mode 100644
index 000000000000..e996cbd862d3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.unalign.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * We set our buffer size absurdly low to prevent a flood of errors that we
+ * don't care about. Note that this test (unlike some other safety tests)
+ * doesn't check the error count -- some architectures have no notion of
+ * alignment.
+ */
+#pragma D option bufsize=16
+#pragma D option bufpolicy=ring
+
+fbt:::
+{
+ n++;
+ trace(*(int *)(rand() | 1));
+}
+
+tick-1sec
+/sec++ == 10/
+{
+ exit(2);
+}
+
+END
+/n == 0/
+{
+ exit(1);
+}
+
+END
+/n != 0/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.uregs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.uregs.d
new file mode 100644
index 000000000000..b13434db0e71
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.uregs.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Trace uregs[0] at every fbt probe point.
+ * SECTION: Variables/Built-in Variables;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ trace(uregs[0]);
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ustack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ustack.d
new file mode 100644
index 000000000000..a286382a0c53
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ustack.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Call ustack() at every fbt probe point.
+ *
+ * SECTION: Actions and Subroutines/ustack();
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ ustack();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ustackdepth.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ustackdepth.d
new file mode 100644
index 000000000000..942913c3c0e8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ustackdepth.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test that the ustackdepth variable is safe to use at every fbt probe
+ * point.
+ *
+ * SECTION: Variables/Built-in Variables;
+ * Options and Tunables/bufsize;
+ * Options and Tunables/bufpolicy;
+ * Options and Tunables/statusrate
+ */
+
+#pragma D option bufsize=1000
+#pragma D option bufpolicy=ring
+#pragma D option statusrate=10ms
+
+fbt:::
+{
+ trace(ustackdepth);
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.vahole.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.vahole.d
new file mode 100644
index 000000000000..2ef40a5ac474
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.vahole.d
@@ -0,0 +1,69 @@
+#!/usr/sbin/dtrace -Cs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * We set our buffer size absurdly low to prevent a flood of errors that we
+ * don't care about.
+ */
+#pragma D option bufsize=16
+#pragma D option bufpolicy=ring
+
+fbt:::
+{
+ n++;
+#ifdef __sparc
+ trace(*(int *)0x8000000000000000 ^ rand());
+#else
+ trace(*(int *)(`kernelbase - 1));
+#endif
+}
+
+dtrace:::ERROR
+{
+ err++;
+}
+
+tick-1sec
+/sec++ == 10/
+{
+ exit(2);
+}
+
+END
+/n == 0 || err == 0/
+{
+ exit(1);
+}
+
+END
+/n != 0 && err != 0/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh
new file mode 100644
index 000000000000..879774a42ea3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh
@@ -0,0 +1,51 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+script()
+{
+ $dtrace -x bufpolicy=ring -x bufsize=1k -s /dev/stdin <<EOF
+ fbt:::
+ {}
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+let i=0
+
+while [ "$i" -lt 10 ]; do
+ script &
+ child=$!
+ sleep 1
+ kill -9 $child
+ let i=i+1
+done
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.zonename.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.zonename.d
new file mode 100644
index 000000000000..5fc025f9557e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.zonename.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect zonename at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+ @a[zonename] = count();
+}
+
+profile-4999hz
+{
+ @a[zonename] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_ARR_LOCAL.thisarray.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_ARR_LOCAL.thisarray.d
new file mode 100644
index 000000000000..289d164d4270
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_ARR_LOCAL.thisarray.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Use 'this' variables in associative array.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+
+this int y;
+this int z;
+this int res;
+
+BEGIN
+{
+ this->x[this->y, this->z] = 123;
+ this->res = this->x[this->y, this->z]++;
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.selfthis.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.selfthis.d
new file mode 100644
index 000000000000..eda1151b24be
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.selfthis.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Declare a variable and assign inappropriate value.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+self this int x;
+
+BEGIN
+{
+ x = "dummy";
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.thisself.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.thisself.d
new file mode 100644
index 000000000000..f9c596b631dd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.thisself.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Multiple storage declarations.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+this self int x;
+
+BEGIN
+{
+ x = "dummy";
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_IDRED.errval.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_IDRED.errval.d
new file mode 100644
index 000000000000..3130fbfe4855
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_IDRED.errval.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Declare a variable with different data types.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+int x;
+char x;
+double x;
+long x;
+
+BEGIN
+{
+ x = 123;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dec.err.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dec.err.d
new file mode 100644
index 000000000000..4261e0727d15
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dec.err.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a variable and assign inappropriate value.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+int x;
+
+BEGIN
+{
+ x = "dummy";
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d
new file mode 100644
index 000000000000..71f9c0b4823d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test assigning a variable two different incompatible types.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+
+BEGIN
+{
+ x = `kmem_flags;
+ x = *`rootvp;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d
new file mode 100644
index 000000000000..c316441e3e8b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test assigning a variable two different incompatible types.
+ *
+ * SECTION: Variables/Clause-Local Variables
+ *
+ */
+
+BEGIN
+{
+ this->x = `kmem_flags;
+ this->x = *`rootvp;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d
new file mode 100644
index 000000000000..23f26f7fc07f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test assigning a variable two different incompatible types.
+ * Test assigning a variable two different incompatible types.
+ *
+ * SECTION: Variables/Thread-Local Variables
+ *
+ */
+
+BEGIN
+{
+ self->x = `kmem_flags;
+ self->x = *`rootvp;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_SYNTAX.declare.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_SYNTAX.declare.d
new file mode 100644
index 000000000000..246236a9252f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_SYNTAX.declare.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a variable Inside Begin and make sure compilation fails.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+
+BEGIN
+{
+ int x = 123;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d
new file mode 100644
index 000000000000..55616314c041
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Global variables defined once, is visible in every clause of
+ * D program
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+
+#pragma D option quiet
+
+int x;
+
+BEGIN
+{
+ x = 123;
+}
+
+profile:::tick-1sec
+{
+ printf("The value of x is %d\n", x);
+}
+
+profile:::tick-100msec
+{
+ printf("The value of x is %d\n", x);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d.out
new file mode 100644
index 000000000000..2b8999e4430a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d.out
@@ -0,0 +1,2 @@
+The value of x is 123
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.localvar.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.localvar.d
new file mode 100644
index 000000000000..9a89a0485125
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.localvar.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Assign a value to a variable in a local clause.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+}
+int i;
+
+profile:::tick-1sec
+{
+ i = 0;
+}
+
+profile:::tick-100msec
+{
+ printf("The value of int i is %d\n", i);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.misc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.misc.d
new file mode 100644
index 000000000000..3b6eb7a71507
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.misc.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the different kinds of integer scalar references. In particular, we
+ * test accessing a kernel executable scalar, kernel scoped scalar, DTrace
+ * scalar first ref that forces creation (both global and TLS), and DTrace
+ * scalar subsequent reference (both global and TLS).
+ *
+ * SECTION: Variables/External Variables
+ *
+ */
+
+BEGIN
+{
+ printf("\nkmem_flags = 0x%x\n", `kmem_flags);
+ printf("ufs`ufs_allow_shared_writes = %d\n",
+ ufs`ufs_allow_shared_writes);
+ x = 123;
+ printf("x = %u\n", x);
+ self->x = 456;
+ printf("self->x = %u\n", self->x);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.self.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.self.d
new file mode 100644
index 000000000000..514f3859ec98
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.self.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Declare self a variable and assign appropriate value.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+self x;
+
+BEGIN
+{
+ x = "dummy";
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray.d
new file mode 100644
index 000000000000..410e8def449d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a self variable and assign appropriate value.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+
+self int y;
+self int z;
+self int res;
+
+BEGIN
+{
+ self->x[self->y, self->z] = 123;
+ self->res = self->x[self->y, self->z]++;
+ printf("The result = %d\n", self->res);
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray2.d
new file mode 100644
index 000000000000..2fd69c698394
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray2.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+#pragma D option destructive
+#pragma D option dynvarsize=1m
+
+struct bar {
+ int pid;
+ kthread_t *curthread;
+};
+
+self struct bar foo[int];
+
+syscall:::entry
+/!self->foo[0].pid/
+{
+ self->foo[0].pid = pid;
+ self->foo[0].curthread = curthread;
+}
+
+syscall:::entry
+/self->foo[0].pid != pid/
+{
+ printf("expected %d, found %d (found curthread %p, curthread is %p)\n",
+ pid, self->foo[0].pid, self->foo[0].curthread, curthread);
+ exit(1);
+}
+
+tick-100hz
+{
+ system("date > /dev/null")
+}
+
+tick-1sec
+/i++ == 10/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfthis.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfthis.d
new file mode 100644
index 000000000000..7bbfaf76a483
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfthis.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Declare a this variable and assign value of self variable to it.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+self int x;
+this int y;
+
+BEGIN
+{
+ this->x = 123;
+ self->y = this->x;
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.this.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.this.d
new file mode 100644
index 000000000000..01ea89f48421
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.this.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple 'this' declaration.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+this x;
+
+BEGIN
+{
+ x = "dummy";
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.thisself.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.thisself.d
new file mode 100644
index 000000000000..925dff2bbf6d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.thisself.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Declare a self value and assign value of 'this' variable to that.
+ *
+ * SECTION: Variables/Scalar Variables
+ *
+ */
+self int x;
+this int y;
+
+BEGIN
+{
+ self->x = 123;
+ this->y = self->x;
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.enqueue.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.enqueue.d
new file mode 100644
index 000000000000..77105c1efa2b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.enqueue.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option switchrate=100hz
+#pragma D option destructive
+
+sched:::enqueue
+/pid == 0 && args[1]->pr_pid == $pid/
+{
+ self->one = 1;
+}
+
+sched:::enqueue
+/self->one && args[2]->cpu_id >= 0 && args[2]->cpu_id <= `max_cpuid/
+{
+ self->two = 1;
+}
+
+sched:::enqueue
+/self->two && args[0]->pr_lwpid > 0/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.oncpu.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.oncpu.d
new file mode 100644
index 000000000000..25717671580e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.oncpu.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option switchrate=100hz
+#pragma D option destructive
+
+sched:::on-cpu
+/pid == $pid/
+{
+ self->on++;
+}
+
+sched:::off-cpu
+/pid == $pid && self->on/
+{
+ self->off++;
+}
+
+sched:::off-cpu
+/self->on > 50 && self->off > 50/
+{
+ exit(0);
+}
+
+profile:::tick-1sec
+/n++ > 10/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.stackdepth.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.stackdepth.d
new file mode 100644
index 000000000000..b42512708b85
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.stackdepth.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option switchrate=100hz
+
+sched:::on-cpu
+/stackdepth > 0/
+{
+ exit(0);
+}
+
+tick-1s
+/i++ == 3/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_MACRO_UNDEF.invalidargs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_MACRO_UNDEF.invalidargs.d
new file mode 100644
index 000000000000..27d969e71086
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_MACRO_UNDEF.invalidargs.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Try to print arguments not provided.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ print("The arguments are %d %d\n", $1, $2);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_OP_LVAL.rdonly.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_OP_LVAL.rdonly.d
new file mode 100644
index 000000000000..5bf467515923
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_OP_LVAL.rdonly.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Try to update a read-only macro.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ $pid++;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_OP_WRITE.usepidmacro.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_OP_WRITE.usepidmacro.d
new file mode 100644
index 000000000000..649cbdbcff92
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_OP_WRITE.usepidmacro.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Try to assign value to Macro.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ pid = 1;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.concat.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.concat.d
new file mode 100644
index 000000000000..00a299696c50
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.concat.d
@@ -0,0 +1,45 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Try to concat macro with user variables in provider description
+ * section.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+/i = 123$pid/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.desc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.desc.d
new file mode 100644
index 000000000000..3dfa2b266b47
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.desc.d
@@ -0,0 +1,49 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Try to call providers using macro variables.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+/i = 123$pid/
+{
+ exit(0);
+}
+
+pid$pid
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.inval.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.inval.d
new file mode 100644
index 000000000000..28b251cd112a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.inval.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Attempt to print invalid arguments.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ print("The arguments are %d %d\n", $-1);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.pid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.pid.d
new file mode 100644
index 000000000000..d9711d2afd73
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.pid.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Attempt to concat and assign a macro to a variable
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ i = 123$pid;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh
new file mode 100644
index 000000000000..cc1e6dd9f745
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh
@@ -0,0 +1,80 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Attempt to pass some arguments and try not to print it.
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+bname=`/bin/basename $0`
+dfilename=/var/tmp/$bname.$$.d
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+BEGIN
+{
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#Call dtrace -C -s <.d>
+
+$dtrace -x errtags -s $dfilename "this is test" 1>/dev/null \
+ 2>/var/tmp/err.$$.txt
+
+if [ $? -ne 1 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+grep "D_MACRO_UNUSED" /var/tmp/err.$$.txt >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+ print -u2 "Expected error D_MACRO_UNUSED not returned"
+ /bin/rm -f /var/tmp/err.$$.txt
+ exit 1
+fi
+
+/bin/rm -f $dfilename
+/bin/rm -f /var/tmp/err.$$.txt
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arg0.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arg0.d
new file mode 100644
index 000000000000..999dbc329ce0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arg0.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print argument 0 I mean "$0"
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The arg0 is %s\n", $0);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh
new file mode 100644
index 000000000000..6ec078abf29d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh
@@ -0,0 +1,90 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Pass 10 arguments and try to print them.
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+bname=`/usr/bin/basename $0`
+
+dfilename=/var/tmp/$bname.$$
+
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+
+BEGIN
+{
+ printf("%d %d %d %d %d %d %d %d %d %d", \$1, \$2, \$3, \$4, \$5, \$6,
+ \$7, \$8, \$9, \$10);
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#Call dtrace -C -s <.d>
+
+chmod 555 $dfilename
+
+
+output=`$dfilename 1 2 3 4 5 6 7 8 9 10 2>/dev/null`
+
+if [ $? -ne 0 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+set -A outarray $output
+
+if [[ ${outarray[0]} != 1 || ${outarray[1]} != 2 || ${outarray[2]} != 3 || \
+ ${outarray[3]} != 4 || ${outarray[4]} != 5 || ${outarray[5]} != 6 || \
+ ${outarray[6]} != 7 || ${outarray[7]} != 8 || ${outarray[8]} != 9 || \
+ ${outarray[9]} != 10 ]]; then
+ print -u2 "Error in output by $dfilename"
+ exit 1
+fi
+
+/bin/rm -f $dfilename
+exit 0
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.assign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.assign.d
new file mode 100644
index 000000000000..5dd17407de4c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.assign.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Assign macros to variables
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ processid = $pid;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.basic.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.basic.d
new file mode 100644
index 000000000000..a407f839c5b6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.basic.d
@@ -0,0 +1,42 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Basic script which uses exit(0) to exit.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.d
new file mode 100644
index 000000000000..3899d2ad298f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Script which prints effective group id.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The egid is %d\n", $egid);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh
new file mode 100644
index 000000000000..afee24f83b71
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh
@@ -0,0 +1,97 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+#
+# To verify egid of current process
+#
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+bname=`/usr/bin/basename $0`
+dfilename=/var/tmp/$bname.$$.d
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+
+BEGIN
+/\$egid != \$1/
+{
+ exit(1);
+}
+
+BEGIN
+/\$egid == \$1/
+{
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#chmod 555 the .d file
+
+chmod 555 $dfilename >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+ print -u2 "chmod $dfilename failed"
+ exit 1
+fi
+
+#Get the groupid of the calling process using ps
+
+groupid=`ps -o pid,pgid | grep "$$ " | awk '{print $2}' 2>/dev/null`
+if [ $? -ne 0 ]; then
+ print -u2 "unable to get uid of the current process with pid = $$"
+ exit 1
+fi
+
+#Pass groupid as argument to .d file
+$dfilename $groupid >/dev/null 2>&1
+
+if [ $? -ne 0 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+#Cleanup leftovers
+
+/bin/rm -f $dfilename
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.d
new file mode 100644
index 000000000000..e4cdaa6b9ffb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.d
@@ -0,0 +1,44 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Script which prints effective user id.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The euid is %d\n", $euid);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh
new file mode 100644
index 000000000000..1b6b9b3e0d39
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# To verify euid of current process
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+bname=`/bin/basename $0`
+dfilename=/var/tmp/$bname.$$
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+
+BEGIN
+/\$euid != \$1/
+{
+ exit(1);
+}
+
+BEGIN
+/\$euid == \$1/
+{
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#Call dtrace -C -s <.d>
+
+chmod 555 $dfilename
+
+userid=`ps -o pid,uid | grep "$$ " | awk '{print $2}' 2>/dev/null`
+if [ $? -ne 0 ]; then
+ print -u2 "unable to get uid of the current process with pid = $$"
+ exit 1
+fi
+
+$dfilename $userid >/dev/null 2>&1
+
+if [ $? -ne 0 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+#/bin/rm -f $dfilename
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.d
new file mode 100644
index 000000000000..c3329ce12061
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Script which prints group id.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The gid is %d\n", $gid);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh
new file mode 100644
index 000000000000..332b8e70d27d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# To verify gid of the child process.
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+bname=`/bin/basename $0`
+dfilename=/var/tmp/$bname.$$
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+
+BEGIN
+/\$gid != \$1/
+{
+ exit(1);
+}
+
+BEGIN
+/\$gid == \$1/
+{
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#Call dtrace -C -s <.d>
+
+chmod 555 $dfilename
+
+groupid=`ps -o pid,gid | grep "$$ " | awk '{print $2}' 2>/dev/null`
+if [ $? -ne 0 ]; then
+ print -u2 "unable to get uid of the current process with pid = $$"
+ exit 1
+fi
+
+$dfilename $groupid >/dev/null 2>&1
+
+if [ $? -ne 0 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+#/bin/rm -f $dfilename
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.pgid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.pgid.d
new file mode 100644
index 000000000000..e01b99684474
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.pgid.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Script which prints effective process group id.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The pgid is %d\n", $pgid);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.pid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.pid.d
new file mode 100644
index 000000000000..1364366c37b5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.pid.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Script which prints pid.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The pid is %d\n", $pid);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.d
new file mode 100644
index 000000000000..8712cd963493
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Script which prints parent processid
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The ppid is %d\n", $ppid);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh
new file mode 100644
index 000000000000..bbd9a5364797
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# To verify ppid of child process.
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+bname=`/bin/basename $0`
+dfilename=/var/tmp/$bname.$$.d
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+
+BEGIN
+/\$ppid != \$1/
+{
+ exit(1);
+}
+
+BEGIN
+/\$ppid == \$1/
+{
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#chmod the .d file to 555
+
+chmod 555 $dfilename >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+ print -u2 "chmod 555 $dfilename failed"
+ exit 1
+fi
+
+#Pass current pid (I mean parent pid for .d script).
+
+$dfilename $$ >/dev/null 2>&1
+
+if [ $? -ne 0 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+#/bin/rm -f $dfilename
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.d
new file mode 100644
index 000000000000..a81ab8ee6e02
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Script which prints current project id.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The projid is %d\n", $projid);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh
new file mode 100644
index 000000000000..62bc817af5f6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# To verify projid of child process.
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+bname=`/bin/basename $0`
+dfilename=/var/tmp/$bname.$$
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+
+BEGIN
+/\$projid != \$1/
+{
+ exit(1);
+}
+
+BEGIN
+/\$projid == \$1/
+{
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#Call dtrace -C -s <.d>
+
+chmod 555 $dfilename
+
+projectid=`ps -o pid,projid | grep "$$ " | awk '{print $2}' 2>/dev/null`
+if [ $? -ne 0 ]; then
+ print -u2 "unable to get uid of the current process with pid = $$"
+ exit 1
+fi
+
+$dfilename $projectid >/dev/null 2>&1
+
+if [ $? -ne 0 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+#/bin/rm -f $dfilename
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.quite.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.quite.d
new file mode 100644
index 000000000000..c61debed1bdd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.quite.d
@@ -0,0 +1,42 @@
+#!/usr/sbin/dtrace -qs
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Script which uses -qs in scripting line
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.d
new file mode 100644
index 000000000000..87bab5369efb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Script which prints session id.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The sid is %d\n", $sid);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh
new file mode 100644
index 000000000000..477ebc0290a5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# To verify sid of current process.
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+bname=`/bin/basename $0`
+dfilename=/var/tmp/$bname.$$
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+
+BEGIN
+/\$sid != \$1/
+{
+ exit(1);
+}
+
+BEGIN
+/\$sid == \$1/
+{
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#Call dtrace -C -s <.d>
+
+chmod 555 $dfilename
+
+sessionid=`ps -o pid,sid | grep "$$ " | awk '{print $2}' 2>/dev/null`
+if [ $? -ne 0 ]; then
+ print -u2 "unable to get sid of the current process with pid = $$"
+ exit 1
+fi
+
+$dfilename $sessionid >/dev/null 2>&1
+
+if [ $? -ne 0 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+#/bin/rm -f $dfilename
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh
new file mode 100644
index 000000000000..724bd5fda7f0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh
@@ -0,0 +1,78 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# Pass a bunch of strings as a sentence and print them
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+bname=`/bin/basename $0`
+dfilename=/var/tmp/$bname.$$.d
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+BEGIN
+{
+ printf("%s", \$\$1);
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#Call dtrace -C -s <.d>
+
+chmod 555 $dfilename
+
+output=`$dfilename 'this is test' 2>/dev/null`
+
+if [ $? -ne 0 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+if [ "$output" != "this is test" ]; then
+ print -u2 "Expected output not returned"
+ exit 1
+fi
+
+/bin/rm -f $dfilename
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.d
new file mode 100644
index 000000000000..617827c8d35c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Script which prints taskid.
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The taskid is %d\n", $taskid);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh
new file mode 100644
index 000000000000..88b450d381ff
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# To verify taskid of current process.
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+bname=`/bin/basename $0`
+dfilename=/var/tmp/$bname.$$
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+
+BEGIN
+/\$taskid != \$1/
+{
+ exit(1);
+}
+
+BEGIN
+/\$taskid == \$1/
+{
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#Call dtrace -C -s <.d>
+
+chmod 555 $dfilename
+
+taskidval=`ps -o pid,taskid | grep "$$ " | awk '{print $2}' 2>/dev/null`
+if [ $? -ne 0 ]; then
+ print -u2 "unable to get uid of the current process with pid = $$"
+ exit 1
+fi
+
+$dfilename $taskidval >/dev/null 2>&1
+
+if [ $? -ne 0 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+#/bin/rm -f $dfilename
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.trace.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.trace.d
new file mode 100644
index 000000000000..34ba243ef978
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.trace.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * To use trace in a script
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ trace("hello");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.d
new file mode 100644
index 000000000000..f3ebca615001
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.d
@@ -0,0 +1,43 @@
+#!/usr/sbin/dtrace -s
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * print uid in a script
+ *
+ * SECTION: Scripting
+ *
+ */
+
+BEGIN
+{
+ printf("The uid is %d\n", $uid);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh
new file mode 100644
index 000000000000..fabf0eda7433
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh
@@ -0,0 +1,86 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#ident "%Z%%M% %I% %E% SMI"
+
+############################################################################
+# ASSERTION:
+# To verify uid of current process.
+#
+# SECTION: Scripting
+#
+############################################################################
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+bname=`/bin/basename $0`
+dfilename=/var/tmp/$bname.$$
+
+## Create .d file
+##########################################################################
+cat > $dfilename <<-EOF
+#!$dtrace -qs
+
+
+BEGIN
+/\$uid != \$1/
+{
+ exit(1);
+}
+
+BEGIN
+/\$uid == \$1/
+{
+ exit(0);
+}
+EOF
+##########################################################################
+
+
+#Call dtrace -C -s <.d>
+
+chmod 555 $dfilename
+
+userid=`ps -o pid,uid | grep "$$ " | awk '{print $2}' 2>/dev/null`
+if [ $? -ne 0 ]; then
+ print -u2 "unable to get uid of the current process with pid = $$"
+ exit 1
+fi
+
+$dfilename $userid >/dev/null 2>&1
+
+if [ $? -ne 0 ]; then
+ print -u2 "Error in executing $dfilename"
+ exit 1
+fi
+
+#/bin/rm -f $dfilename
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c
new file mode 100644
index 000000000000..013a9e7c7897
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+#include <err.h>
+#include <unistd.h>
+
+int
+main(int argc, char **argv)
+{
+ int val = 1;
+
+ while (1) {
+ if (sysctlbyname("debug.dtracetest.sdttest", NULL, NULL, &val,
+ sizeof(val)))
+ err(1, "sysctlbyname");
+
+ sleep(1);
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d
new file mode 100644
index 000000000000..e965b05f2405
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Verify that argN (1..7) variables are properly remapped.
+ */
+
+BEGIN
+{
+ /* Timeout after 5 seconds */
+ timeout = timestamp + 5000000000;
+ ignore = $1;
+}
+
+ERROR
+{
+ printf("sdt:::test failed.\n");
+ exit(1);
+}
+
+test:::sdttest
+/arg0 != 1 || arg1 != 2 || arg2 != 3 || arg3 != 4 || arg4 != 5 || arg5 != 6 ||
+ arg6 != 7/
+{
+ printf("sdt arg mismatch\n\n");
+ printf("args are : %d, %d, %d, %d, %d, %d, %d\n", arg0, arg1, arg2,
+ arg3, arg4, arg5, arg6);
+ printf("should be : 1, 2, 3, 4, 5, 6, 7\n");
+ exit(1);
+}
+
+test:::sdttest
+{
+ exit(0);
+}
+
+profile:::tick-1
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_BADREF.SizeofAssoc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_BADREF.SizeofAssoc.d
new file mode 100644
index 000000000000..9ace4197659a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_BADREF.SizeofAssoc.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: sizeof returns the size in bytes of any D expression or data
+ * type. For an associative array, the D compiler should throw an error since
+ * an associative array does not have a fixed size.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ assoc_array[0] = 010;
+ assoc_array[1] = 100;
+ assoc_array[2] = 210;
+
+ printf("sizeof (assoc_array): %d\n", sizeof (assoc_array));
+ printf("sizeof (assoc_array[0]): %d\n", sizeof (assoc_array[0]));
+ printf("sizeof (assoc_array[1]): %d\n", sizeof (assoc_array[1]));
+ printf("sizeof (assoc_array[2]): %d\n", sizeof (assoc_array[2]));
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d
new file mode 100644
index 000000000000..f2dcdfab20da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: The D compiler throws a D_IDENT_UNDEF error when sizeof is passed
+ * an unknown symbol.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ printf("sizeof (`): %d\n", sizeof (`));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d
new file mode 100644
index 000000000000..c921db88b62d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ trace(sizeof (struct suckitlarry));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.d
new file mode 100644
index 000000000000..43c493a594b2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * sizeof() should handle invalid types
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ */
+
+BEGIN
+{
+ trace(sizeof (void));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SYNTAX.SizeofBadType.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SYNTAX.SizeofBadType.d
new file mode 100644
index 000000000000..85519e6dd7f7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SYNTAX.SizeofBadType.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: sizeof returns the size in bytes of any D expression or data
+ * type. When an operator or non-symbol is passed as an argument to sizeof
+ * operator, the D_SYNTAX error is thrown by the compiler.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ printf("sizeof (*): %d\n", sizeof (*));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofArray.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofArray.d
new file mode 100644
index 000000000000..8843728c409e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofArray.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: sizeof returns the size in bytes of any D expression or data
+ * type. For a simpler array, the sizeof on the array variable itself gives
+ * the sum total of memory allocated to the array in bytes. With individual
+ * members of the array it gives their respective sizes.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ */
+#pragma D option quiet
+
+int array[5];
+
+BEGIN
+{
+ array[0] = 010;
+ array[1] = 100;
+ array[2] = 210;
+
+ printf("sizeof (array): %d\n", sizeof (array));
+ printf("sizeof (array[0]): %d\n", sizeof (array[0]));
+ printf("sizeof (array[1]): %d\n", sizeof (array[1]));
+ printf("sizeof (array[2]): %d\n", sizeof (array[2]));
+
+ exit(0);
+}
+
+END
+/(20 != sizeof (array)) || (4 != sizeof (array[0])) || (4 != sizeof (array[1]))
+ || (4 != sizeof (array[2]))/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofDataTypes.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofDataTypes.d
new file mode 100644
index 000000000000..fe558e8e0bc0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofDataTypes.d
@@ -0,0 +1,122 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: sizeof returns the size in bytes of any D expression or data
+ * type.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ */
+#pragma D option quiet
+
+char new_char;
+short new_short;
+int new_int;
+long new_long;
+long long new_long_long;
+int8_t new_int8;
+int16_t new_int16;
+int32_t new_int32;
+int64_t new_int64;
+intptr_t new_intptr;
+uint8_t new_uint8;
+uint16_t new_uint16;
+uint32_t new_uint32;
+uint64_t new_uint64;
+uintptr_t new_uintptr;
+
+/*
+float new_float;
+double new_double;
+long double new_long_double;
+
+string new_string;
+*/
+
+struct record {
+ char ch;
+ int in;
+} new_struct;
+
+struct {
+ char ch;
+ int in;
+} anon_struct;
+
+union record {
+ char ch;
+ int in;
+} new_union;
+
+union {
+ char ch;
+ int in;
+} anon_union;
+
+enum colors {
+ RED,
+ GREEN,
+ BLUE
+} new_enum;
+
+
+int *pointer;
+
+BEGIN
+{
+ printf("sizeof (new_char): %d\n", sizeof (new_char));
+ printf("sizeof (new_short): %d\n", sizeof (new_short));
+ printf("sizeof (new_int): %d\n", sizeof (new_int));
+ printf("sizeof (new_long): %d\n", sizeof (new_long));
+ printf("sizeof (new_long_long): %d\n", sizeof (new_long_long));
+ printf("sizeof (new_int8): %d\n", sizeof (new_int8));
+ printf("sizeof (new_int16): %d\n", sizeof (new_int16));
+ printf("sizeof (new_int32): %d\n", sizeof (new_int32));
+ printf("sizeof (new_int64): %d\n", sizeof (new_int64));
+ printf("sizeof (pointer): %d\n", sizeof (pointer));
+ printf("sizeof (intptr_t): %d\n", sizeof (intptr_t));
+ printf("sizeof (new_struct): %d\n", sizeof (new_struct));
+ printf("sizeof (anon_struct): %d\n", sizeof (anon_struct));
+ printf("sizeof (new_union): %d\n", sizeof (new_union));
+ printf("sizeof (anon_union): %d\n", sizeof (anon_union));
+ printf("sizeof (new_enum): %d\n", sizeof (new_enum));
+ exit(0);
+}
+
+END
+/(1 != sizeof (new_char)) || (2 != sizeof (new_short)) ||
+ (4 != sizeof (new_int)) ||
+ ((4 != sizeof (new_long)) && (8 != sizeof (new_long))) ||
+ (8 != sizeof (new_long_long)) ||
+ (1 != sizeof (new_int8)) || (2 != sizeof (new_int16)) ||
+ (4 != sizeof (new_int32)) || (8 != sizeof (new_int64)) ||
+ (sizeof (pointer) != sizeof (new_intptr)) || (8 != sizeof (new_struct)) ||
+ (4 != sizeof (new_union)) || (4 != sizeof (new_enum))/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofExpression.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofExpression.d
new file mode 100644
index 000000000000..0bb7f686eec2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofExpression.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the use of sizeof with expressions.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("sizeof ('c') : %d\n", sizeof ('c'));
+ printf("sizeof (10 * 'c') : %d\n", sizeof (10 * 'c'));
+ printf("sizeof (100 + 12345) : %d\n", sizeof (100 + 12345));
+ printf("sizeof (1234567890) : %d\n", sizeof (1234567890));
+
+ printf("sizeof (1234512345 * 1234512345 * 12345678 * 1ULL) : %d\n",
+ sizeof (1234512345 * 1234512345 * 12345678 * 1ULL));
+ printf("sizeof (-129) : %d\n", sizeof (-129));
+ printf("sizeof (0x67890/0x77000) : %d\n", sizeof (0x67890/0x77000));
+
+ printf("sizeof (3 > 2 ? 3 : 2) : %d\n", sizeof (3 > 2 ? 3 : 2));
+
+ exit(0);
+}
+
+END
+/(4 != sizeof ('c')) || (4 != sizeof (10 * 'c')) ||
+ (4 != sizeof (100 + 12345)) || (4 != sizeof (1234567890)) ||
+ (8 != sizeof (1234512345 * 1234512345 * 12345678 * 1ULL)) ||
+ (4 != sizeof (-129)) || (4 != sizeof (0x67890/0x77000)) ||
+ (4 != sizeof (3 > 2 ? 3 : 2))/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofNULL.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofNULL.d
new file mode 100644
index 000000000000..4bd8a48421a8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofNULL.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: The size of the inbuilt variable NULL is the same as that of an
+ * integer.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ printf("sizeof (NULL): %d\n", sizeof (NULL));
+ exit(0);
+}
+
+END
+/4 != sizeof (NULL)/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d
new file mode 100644
index 000000000000..51f72505a2da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d
@@ -0,0 +1,42 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: sizeof returns the size in bytes of any D expression or data
+ * type. When a raw string is passed to the sizeof operator, the compiler
+ * throws a D_SYNTAX error.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ printf("sizeof \"hi\": %d\n", sizeof ("hi"));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d.out
new file mode 100644
index 000000000000..3fe02aafb04a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d.out
@@ -0,0 +1,2 @@
+sizeof "hi": 3
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d
new file mode 100644
index 000000000000..0be9e45793ef
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: sizeof returns the size in bytes of any D expression or data
+ * type. For sizeof strings the D compiler throws D_SIZEOF_TYPE.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ */
+#pragma D option quiet
+#pragma D option strsize=256
+
+BEGIN
+{
+ assoc_array["hello"] = "hello";
+ assoc_array["hi"] = "hi";
+ assoc_array["hello"] = "hello, world";
+
+ printf("sizeof (assoc_array[\"hello\"]): %d\n",
+ sizeof (assoc_array["hello"]));
+ printf("sizeof (assoc_array[\"hi\"]): %d\n",
+ sizeof (assoc_array["hi"]));
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d.out
new file mode 100644
index 000000000000..9c43b1e3064b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d.out
@@ -0,0 +1,3 @@
+sizeof (assoc_array["hello"]): 256
+sizeof (assoc_array["hi"]): 256
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d
new file mode 100644
index 000000000000..f12a6003affc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: sizeof returns the size in bytes of any D expression or data
+ * type. For a string variable, the D compiler throws a D_SIZEOF_TYPE.
+ *
+ * SECTION: Structs and Unions/Member Sizes and Offsets
+ *
+ */
+#pragma D option quiet
+#pragma D option strsize=256
+
+BEGIN
+{
+ var = "hello";
+ printf("sizeof (var): %d\n", sizeof (var));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d.out
new file mode 100644
index 000000000000..fdeca6991289
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d.out
@@ -0,0 +1,2 @@
+sizeof (var): 256
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/bug.1001148.SpecSizeVariations.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/bug.1001148.SpecSizeVariations.d
new file mode 100644
index 000000000000..318a2d052fab
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/bug.1001148.SpecSizeVariations.d
@@ -0,0 +1,87 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify the behavior of variations in specsize.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/specsize
+ *
+ * BUG: 1001148
+ *
+ * NOTES: This code has four different behaviors.
+ * 1. 0 < specsize < 8
+ * 2. 8 <= specsize <= 39 || 0 == specsize
+ * 3. 40 <= specsize
+ * 4. 0 > specsize
+ *
+ */
+
+#pragma D option quiet
+#pragma D option specsize=10
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ printf("Lots of data\n");
+ printf("Has to be crammed into this buffer\n");
+ printf("Until it overflows\n");
+ printf("And causes flops\n");
+ self->speculateFlag++;
+
+}
+
+BEGIN
+/1 <= self->speculateFlag/
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/1 <= self->commitFlag/
+{
+ printf("Statement was executed\n");
+ exit(0);
+}
+
+BEGIN
+/1 > self->commitFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d
new file mode 100644
index 000000000000..c59ea3bee57d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d
@@ -0,0 +1,84 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+
+/*
+ * ASSERTION:
+ * Verify the behavior of variations in bufsize.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/bufsize
+ *
+ * NOTES: This test behaves differently depending on the values
+ * assigned to bufsize.
+ */
+
+#pragma D option quiet
+#pragma D option bufsize=49
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ printf("Lots of data\n");
+ printf("Has to be crammed into this buffer\n");
+ printf("Until it overflows\n");
+ printf("And causes flops\n");
+ self->speculateFlag++;
+
+}
+
+BEGIN
+/1 <= self->speculateFlag/
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/1 <= self->commitFlag/
+{
+ printf("Statement was executed\n");
+ exit(0);
+}
+
+BEGIN
+/1 > self->commitFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d
new file mode 100644
index 000000000000..5ac7957ced85
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d
@@ -0,0 +1,90 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ * Verify the behavior of variations in bufsize.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/bufsize
+ *
+ * NOTES: This test behaves differently depending on the values
+ * assigned to bufsize.
+ * 1. 0 > bufsize.
+ * 2. 0 == bufsize.
+ * 3. 0 < bufsize <= 7
+ * 4. 8 <= bufsize <= 31
+ * 5. 32 <= bufsize <= 47
+ * 6. 48 <= bufsize <= 71
+ * 7. 72 <= bufsize
+ */
+
+#pragma D option quiet
+#pragma D option bufsize=4
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ printf("Lots of data\n");
+ printf("Has to be crammed into this buffer\n");
+ printf("Until it overflows\n");
+ printf("And causes flops\n");
+ self->speculateFlag++;
+
+}
+
+BEGIN
+/1 <= self->speculateFlag/
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/1 <= self->commitFlag/
+{
+ printf("Statement was executed\n");
+ exit(0);
+}
+
+BEGIN
+/1 > self->commitFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d
new file mode 100644
index 000000000000..958ce68612a1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d
@@ -0,0 +1,69 @@
+#!/usr/sbin/dtrace -ws
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Destructive actions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ * SECTION: dtrace(1M) Utility/ -w option
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+syscall:::
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ breakpoint();
+ i++;
+}
+
+syscall:::
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d
new file mode 100644
index 000000000000..ebb3b016019d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d
@@ -0,0 +1,69 @@
+#!/usr/sbin/dtrace -ws
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Destructive actions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ * SECTION: dtrace (1M) Utility/ -w option
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ chill(10);
+ i++;
+}
+
+profile:::tick-1sec
+/1 == 1/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d
new file mode 100644
index 000000000000..9c14bb5a5956
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d
@@ -0,0 +1,69 @@
+#!/usr/sbin/dtrace -ws
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Destructive actions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ * SECTION: dtrace(1M) Utility/ -w option
+ *
+ */
+#pragma D option quiet
+
+char a[2];
+void *buf;
+uintptr_t addr;
+size_t nbytes;
+BEGIN
+{
+ self->i = 0;
+ addr = (uintptr_t) &a[0];
+ nbytes = 10;
+ var = speculation();
+}
+
+BEGIN
+{
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ self->i++;
+ copyout(buf, addr, nbytes);
+}
+
+BEGIN
+{
+ printf("This test should not have compiled\n");
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d
new file mode 100644
index 000000000000..695eb8c8dea4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d
@@ -0,0 +1,68 @@
+#!/usr/sbin/dtrace -ws
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Destructive actions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ * SECTION: dtrace(1M) Utility/ -w option
+ */
+#pragma D option quiet
+
+string str;
+char a[2];
+uintptr_t addr;
+size_t maxlen;
+BEGIN
+{
+ self->i = 0;
+ addr = (uintptr_t) &a[0];
+ maxlen = 10;
+ var = speculation();
+}
+
+BEGIN
+{
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ self->i++;
+ copyoutstr(str, addr, maxlen);
+}
+
+BEGIN
+{
+ printf("This test should not have compiled\n");
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d
new file mode 100644
index 000000000000..dcba0801946e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d
@@ -0,0 +1,69 @@
+#!/usr/sbin/dtrace -ws
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Destructive actions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ * SECTION: dtrace(1M) Utility/ -w option
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ panic();
+ i++;
+}
+
+profile:::tick-1sec
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d
new file mode 100644
index 000000000000..e4fe06b6a3b8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d
@@ -0,0 +1,68 @@
+#!/usr/sbin/dtrace -ws
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Destructive actions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ * SECTION: dtrace(1M) Utility/ -w option
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ raise(9);
+ i++;
+}
+
+profile:::tick-1sec
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d
new file mode 100644
index 000000000000..468e8f20e2e4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d
@@ -0,0 +1,68 @@
+#!/usr/sbin/dtrace -ws
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Destructive actions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ * SECTION: dtrace(1M) Utility/ -w option
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ stop();
+ i++;
+}
+
+profile:::tick-1sec
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_COMM.AggAftCommit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_COMM.AggAftCommit.d
new file mode 100644
index 000000000000..89a15c032dad
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_COMM.AggAftCommit.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * A clause cannot contain a commit() followed by an aggregating action.
+ *
+ * SECTION: Speculative Tracing/Committing a Speculation;
+ */
+
+BEGIN
+{
+ commit(1);
+ @a["foo"] = count();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithAvg.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithAvg.d
new file mode 100644
index 000000000000..a763543428bc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithAvg.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Aggregating actions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ @avrg["speculate"] = avg(i);
+ i++;
+}
+
+profile:::tick-1sec
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithCount.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithCount.d
new file mode 100644
index 000000000000..57d0d03c5437
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithCount.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Aggregating functions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ @counts["speculate"] = count();
+ i++;
+}
+
+profile:::tick-1sec
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithLquant.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithLquant.d
new file mode 100644
index 000000000000..90a899d251ce
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithLquant.d
@@ -0,0 +1,72 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Aggregating functions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+syscall:::entry
+{
+ self->ts = timestamp;
+}
+
+syscall:::return
+/self->ts/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ @Lqauntus[execname] = lquantize(timestamp - self->ts, 0, 100, 1);
+ i++;
+}
+
+syscall:::
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMax.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMax.d
new file mode 100644
index 000000000000..a10fff1bb3fd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMax.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Aggregating functions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ @Maximus["speculate"] = max(i);
+ i++;
+}
+
+profile:::tick-1sec
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMin.d
new file mode 100644
index 000000000000..4ad8dee33c63
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMin.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Aggregating functions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ @Minimus["speculate"] = min(i);
+ i++;
+}
+
+profile:::tick-1sec
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d
new file mode 100644
index 000000000000..38e816ec2ce6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Aggregating functions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+syscall:::entry
+{
+ self->ts = timestamp;
+}
+
+syscall:::return
+/self->ts/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ @Qauntus[execname] = quantize(timestamp - self->ts);
+ i++;
+}
+
+syscall:::
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d
new file mode 100644
index 000000000000..22953c2a55f4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d
@@ -0,0 +1,65 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Aggregating actions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ @sdev["speculate"] = stddev(i);
+ i++;
+}
+
+profile:::tick-1sec
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithSum.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithSum.d
new file mode 100644
index 000000000000..620a0768d0e5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithSum.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Aggregating functions may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+profile:::tick-1sec
+/i < 1/
+{
+ var = speculation();
+ speculate(var);
+ printf("Speculation ID: %d", var);
+ @sums["speculate"] = sum(i);
+ i++;
+}
+
+profile:::tick-1sec
+/1 == i/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.CommitAftCommit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.CommitAftCommit.d
new file mode 100644
index 000000000000..ebc316a9fe99
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.CommitAftCommit.d
@@ -0,0 +1,82 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * A clause cannot contain multiple commit() calls to same buffer.
+ *
+ * SECTION: Speculative Tracing/Committing a Speculation;
+ * Options and Tunables/cleanrate
+ */
+#pragma D option quiet
+#pragma D option cleanrate=3000hz
+
+BEGIN
+{
+ self->i = 0;
+ var1 = 0;
+}
+
+profile:::tick-1sec
+/!var1/
+{
+ var1 = speculation();
+ printf("Speculation ID: %d\n", var1);
+}
+
+profile:::tick-1sec
+/var1/
+{
+ speculate(var1);
+ printf("Speculating on id: %d\n", var1);
+ self->i++;
+}
+
+profile:::tick-1sec
+/(!self->i)/
+{
+}
+
+profile:::tick-1sec
+/(self->i)/
+{
+ commit(var1);
+ commit(var1);
+ exit(0);
+}
+
+END
+{
+ printf("Succesfully commited both buffers");
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.DisjointCommit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.DisjointCommit.d
new file mode 100644
index 000000000000..e482d07ee47e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.DisjointCommit.d
@@ -0,0 +1,102 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * A clause cannot contain multiple commit() calls to disjoint buffers.
+ *
+ * SECTION: Speculative Tracing/Committing a Speculation;
+ * Options and Tunables/cleanrate
+ */
+#pragma D option quiet
+#pragma D option cleanrate=3000hz
+
+BEGIN
+{
+ self->i = 0;
+ self->j = 0;
+ self->commit = 0;
+ var1 = 0;
+ var2 = 0;
+}
+
+BEGIN
+{
+ var1 = speculation();
+ printf("Speculation ID: %d\n", var1);
+}
+
+BEGIN
+{
+ var2 = speculation();
+ printf("Speculation ID: %d\n", var2);
+}
+
+BEGIN
+/var1/
+{
+ speculate(var1);
+ printf("Speculating on id: %d\n", var1);
+ self->i++;
+}
+
+BEGIN
+/var2/
+{
+ speculate(var2);
+ printf("Speculating on id: %d", var2);
+ self->j++;
+
+}
+
+BEGIN
+/(self->i) && (self->j)/
+{
+ commit(var1);
+ commit(var2);
+ self->commit++;
+}
+
+BEGIN
+/self->commit/
+{
+ printf("Succesfully commited both buffers");
+ exit(0);
+}
+
+BEGIN
+/!self->commit/
+{
+ printf("Couldnt commit both buffers");
+ exit(1);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_DREC.CommitAftDataRec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_DREC.CommitAftDataRec.d
new file mode 100644
index 000000000000..268b68fbb98c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_DREC.CommitAftDataRec.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Commit may not follow data recording actions.
+ *
+ * SECTION: Speculative Tracing/Committing a Speculation
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+ exit(0);
+}
+
+END
+{
+ printf("This test shouldnt have compiled\n");
+ commit(self->spec);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.DataRecAftCommit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.DataRecAftCommit.d
new file mode 100644
index 000000000000..75560d831759
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.DataRecAftCommit.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Data recording actions may not follow commit.
+ *
+ * SECTION: Speculative Tracing/Committing a Speculation;
+ * Options and Tunables/cleanrate
+ *
+ */
+#pragma D option quiet
+#pragma D option cleanrate=2000hz
+
+BEGIN
+{
+ self->speculateFlag = 0;
+}
+
+syscall:::entry
+{
+ self->spec = speculation();
+}
+
+syscall:::
+/self->spec/
+{
+ speculate(self->spec);
+ printf("Called speculate with id: %d\n", self->spec);
+ self->speculateFlag++;
+}
+
+syscall:::
+/(self->spec) && (self->speculateFlag)/
+{
+ commit(self->spec);
+ printf("Data recording after commit\n");
+}
+
+END
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.ExitAfterCommit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.ExitAfterCommit.d
new file mode 100644
index 000000000000..c190740bf787
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.ExitAfterCommit.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Exit after commit should throw a D_DREC_COMM.
+ *
+ * SECTION: Speculative Tracing/Committing a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ self->i = 0;
+ self->spec = speculation();
+}
+
+BEGIN
+/self->spec/
+{
+ speculate(self->spec);
+ self->i++;
+ printf("self->i: %d\n", self->i);
+}
+
+BEGIN
+/self->i/
+{
+ commit(self->spec);
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_EXIT_SPEC.ExitAftSpec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_EXIT_SPEC.ExitAftSpec.d
new file mode 100644
index 000000000000..70964f916e26
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_EXIT_SPEC.ExitAftSpec.d
@@ -0,0 +1,70 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Exit action may never be speculative.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+BEGIN
+{
+ i = 0;
+}
+
+syscall:::entry
+{
+ self->spec = speculation();
+}
+
+syscall:::
+/self->spec/
+{
+ speculate(self->spec);
+ i++;
+ printf("i: %d\n", i);
+ exit(0);
+}
+
+syscall:::
+/1 == i/
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_MALFORM.NspecExpr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_MALFORM.NspecExpr.d
new file mode 100644
index 000000000000..91168e300826
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_MALFORM.NspecExpr.d
@@ -0,0 +1,77 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using an expression in the pragma for nspec throws a D_PRAGMA_MALFORM
+ * error.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/nspec
+ *
+ */
+
+#pragma D option quiet
+#pragma D option cleanrate=3000hz
+#pragma D option nspec=24 * 44
+
+BEGIN
+{
+ var1 = 0;
+ var2 = 0;
+ var3 = 0;
+}
+
+BEGIN
+{
+ var1 = speculation();
+ printf("Speculation ID: %d\n", var1);
+ var2 = speculation();
+ printf("Speculation ID: %d\n", var2);
+ var3 = speculation();
+ printf("Speculation ID: %d\n", var3);
+}
+
+BEGIN
+/var1 && var2 && (!var3)/
+{
+ printf("Succesfully got two speculative buffers");
+ exit(0);
+}
+
+BEGIN
+/(!var1) || (!var2) || var3/
+{
+ printf("Test failed");
+ exit(1);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.HugeNspecValue.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.HugeNspecValue.d
new file mode 100644
index 000000000000..d13132ef5879
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.HugeNspecValue.d
@@ -0,0 +1,76 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Setting the nspec option to a huge integer throws a D_PRAGMA_OPTSET error.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/nspec
+ *
+ */
+
+#pragma D option quiet
+#pragma D option cleanrate=3000hz
+#pragma D option nspec=245566729809009887663
+
+BEGIN
+{
+ var1 = 0;
+ var2 = 0;
+ var3 = 0;
+}
+
+BEGIN
+{
+ var1 = speculation();
+ printf("Speculation ID: %d\n", var1);
+ var2 = speculation();
+ printf("Speculation ID: %d\n", var2);
+ var3 = speculation();
+ printf("Speculation ID: %d\n", var3);
+}
+
+BEGIN
+/var1 && var2 && (!var3)/
+{
+ printf("Succesfully got two speculative buffers");
+ exit(0);
+}
+
+BEGIN
+/(!var1) || (!var2) || var3/
+{
+ printf("Test failed");
+ exit(1);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.InvalidSpecSize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.InvalidSpecSize.d
new file mode 100644
index 000000000000..d957f678aed1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.InvalidSpecSize.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Setting the specsize option to an illegal value throws the compiler error
+ * D_PRAGMA_OPTSET.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/specsize
+ */
+
+#pragma D option quiet
+#pragma D option specsize=1b
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+ exit(0);
+}
+
+END
+{
+ printf("This shouldnt have compiled\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d
new file mode 100644
index 000000000000..c5fa9f503e72
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * ASSERTION:
+ * Verify the behavior of speculations with changes in specsize.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/specsize
+ *
+ */
+
+#pragma D option quiet
+#pragma D option specsize=-40
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ printf("Lots of data\n");
+ printf("Has to be crammed into this buffer\n");
+ printf("Until it overflows\n");
+ printf("And causes flops\n");
+ self->speculateFlag++;
+
+}
+
+BEGIN
+/1 <= self->speculateFlag/
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/1 <= self->commitFlag/
+{
+ printf("Statement was executed\n");
+ exit(0);
+}
+
+BEGIN
+/1 > self->commitFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PROTO_LEN.SpecNoId.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PROTO_LEN.SpecNoId.d
new file mode 100644
index 000000000000..65d53ba66f66
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PROTO_LEN.SpecNoId.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * An identifier returned from speculation must be passed to the speculate()
+ * function.
+ *
+ * SECTION: Speculative Tracing/Creating a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ var = speculation();
+ printf("Speculation ID: %d", var);
+ self->i = 0;
+}
+
+profile:::tick-1sec
+{
+ speculate();
+ self->i++;
+}
+
+profile:::tick-1sec
+/1 <= self->i/
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_COMM.SpecAftCommit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_COMM.SpecAftCommit.d
new file mode 100644
index 000000000000..ec4b22b8092f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_COMM.SpecAftCommit.d
@@ -0,0 +1,72 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * A clause cannot contain a speculate after a commit.
+ *
+ * SECTION: Speculative Tracing/Committing a Speculation;
+ * Options and Tunables/cleanrate
+ *
+ */
+#pragma D option quiet
+#pragma D option cleanrate=3000hz
+
+BEGIN
+{
+ self->i = 0;
+ var1 = 0;
+ var1 = speculation();
+ printf("Speculation ID: %d\n", var1);
+}
+
+profile:::tick-1sec
+/var1/
+{
+ speculate(var1);
+ printf("Speculating on id: %d\n", var1);
+ self->i++;
+}
+
+profile:::tick-1sec
+/(!self->i)/
+{
+}
+
+profile:::tick-1sec
+/(self->i)/
+{
+ commit(var1);
+ speculate(var1);
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_DREC.SpecAftDataRec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_DREC.SpecAftDataRec.d
new file mode 100644
index 000000000000..80f1fdd2c131
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_DREC.SpecAftDataRec.d
@@ -0,0 +1,70 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * speculate() may not follow data recording actions.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+BEGIN
+{
+ i = 0;
+}
+
+syscall:::entry
+{
+ self->spec = speculation();
+}
+
+syscall:::
+/self->spec/
+{
+ printf("Entering syscall clause\n");
+ speculate(self->spec);
+ i++;
+ printf("i: %d\n", i);
+}
+
+syscall:::
+/1 == i/
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_SPEC.SpecAftSpec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_SPEC.SpecAftSpec.d
new file mode 100644
index 000000000000..67af53b976a6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_SPEC.SpecAftSpec.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * A clause can contain only one speculate() call.
+ *
+ * SECTION: Speculative Tracing/Using a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ self->i = 0;
+ var1 = speculation();
+ printf("Speculation ID: %d\n", var1);
+ var2 = speculation();
+ printf("Speculation ID: %d\n", var2);
+}
+
+profile:::tick-1sec
+{
+ speculate(var1);
+ printf("Speculating on id: %d\n", var1);
+ speculate(var2);
+ printf("Speculating on id: %d", var2);
+ self->i++;
+
+}
+
+profile:::tick-1sec
+/1 > self->i/
+{
+ exit(0);
+}
+
+END
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeBufSize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeBufSize.d
new file mode 100644
index 000000000000..7d2f4b36b9f2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeBufSize.d
@@ -0,0 +1,88 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify the behavior of variations in bufsize.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/bufsize
+ *
+ * NOTES: This test behaves differently depending on the values
+ * assigned to bufsize.
+ * 1. 0 > bufsize.
+ * 2. 0 == bufsize.
+ * 3. 0 < bufsize <= 7
+ * 4. 8 <= bufsize <= 31
+ * 5. 32 <= bufsize <= 47
+ * 6. 48 <= bufsize <= 71
+ * 7. 72 <= bufsize
+ */
+
+#pragma D option quiet
+#pragma D option bufsize=-72
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ printf("Lots of data\n");
+ printf("Has to be crammed into this buffer\n");
+ printf("Until it overflows\n");
+ printf("And causes flops\n");
+ self->speculateFlag++;
+
+}
+
+BEGIN
+/1 <= self->speculateFlag/
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/1 <= self->commitFlag/
+{
+ printf("Statement was executed\n");
+ exit(0);
+}
+
+BEGIN
+/1 > self->commitFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeNspec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeNspec.d
new file mode 100644
index 000000000000..9e1d063d51ad
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeNspec.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using a negative value for nspec throws a compiler error.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/nspec
+ */
+
+#pragma D option quiet
+#pragma D option nspec=-72
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+ printf("This test shouldnt have compiled\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeSpecSize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeSpecSize.d
new file mode 100644
index 000000000000..233257a444d8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeSpecSize.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Setting the specsize to a negative number should throw a compiler error.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/specsize
+ *
+ * NOTES: Why dont we have an error tag for this error?
+ */
+
+#pragma D option quiet
+#pragma D option specsize=-10
+
+BEGIN
+{
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations1.d
new file mode 100644
index 000000000000..c42029c3f3c8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations1.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * ASSERTION:
+ * Verify the behavior of variations in specsize.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/specsize
+ *
+ */
+
+#pragma D option quiet
+#pragma D option specsize=2
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ printf("Lots of data\n");
+ printf("Has to be crammed into this buffer\n");
+ printf("Until it overflows\n");
+ printf("And causes flops\n");
+ self->speculateFlag++;
+
+}
+
+BEGIN
+/1 <= self->speculateFlag/
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/1 <= self->commitFlag/
+{
+ printf("Statement was executed\n");
+ exit(0);
+}
+
+BEGIN
+/1 > self->commitFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations2.d
new file mode 100644
index 000000000000..8a57280734fb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations2.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * ASSERTION:
+ * Verify the behavior of variations in specsize.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/specsize
+ *
+ */
+
+#pragma D option quiet
+#pragma D option specsize=0
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ printf("Lots of data\n");
+ printf("Has to be crammed into this buffer\n");
+ printf("Until it overflows\n");
+ printf("And causes flops\n");
+ self->speculateFlag++;
+
+}
+
+BEGIN
+/1 <= self->speculateFlag/
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/1 <= self->commitFlag/
+{
+ printf("Statement was executed\n");
+ exit(0);
+}
+
+BEGIN
+/1 > self->commitFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.CommitAfterDiscard.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.CommitAfterDiscard.d
new file mode 100644
index 000000000000..a874ab5b5590
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.CommitAfterDiscard.d
@@ -0,0 +1,86 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Call to commit() on a buffer after it has been discarded is silently
+ * ignored.
+ *
+ * SECTION: Speculative Tracing/Committing a Speculation;
+ * Options and Tunables/cleanrate
+ *
+ */
+#pragma D option quiet
+#pragma D option cleanrate=3000hz
+
+BEGIN
+{
+ self->i = 0;
+ self->commit = 0;
+ self->discard = 0;
+ var1 = speculation();
+ printf("Speculation ID: %d\n", var1);
+}
+
+BEGIN
+/var1/
+{
+ speculate(var1);
+ printf("This statement and the following are speculative!!\n");
+ printf("Speculating on id: %d\n", var1);
+ self->i++;
+}
+
+BEGIN
+/(self->i)/
+{
+ discard(var1);
+ self->discard++;
+ commit(var1);
+ self->commit++;
+}
+
+BEGIN
+/self->commit/
+{
+ printf("Commited a discarded buffer\n");
+ exit(0);
+}
+
+
+BEGIN
+/!self->commit/
+{
+ printf("Couldnt commit a discarded buffer\n");
+ exit(1);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.CommitWithZero.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.CommitWithZero.d
new file mode 100644
index 000000000000..647552fbbfde
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.CommitWithZero.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: An Id of zero though invalid may be passed to speculate(),
+ * commit() and discard() without any ill effects.
+ *
+ * SECTION: Speculative Tracing/Creating a Speculation;
+ * Options and Tunables/cleanrate
+ */
+#pragma D option quiet
+#pragma D option cleanrate=4000hz
+
+BEGIN
+{
+ self->commitFlag = 0;
+ self->var1 = speculation();
+ printf("Speculative buffer ID: %d\n", self->var1);
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/0 < self->commitFlag/
+{
+ printf("commit(), self->commitFlag = %d\n", self->commitFlag);
+ exit(0);
+}
+
+BEGIN
+/0 == self->commitFlag/
+{
+ printf("commit(), self->commitFlag = %d\n", self->commitFlag);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DataRecAftDiscard.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DataRecAftDiscard.d
new file mode 100644
index 000000000000..03ae1b5ff1de
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DataRecAftDiscard.d
@@ -0,0 +1,77 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Data recording actions may follow discard.
+ *
+ * SECTION: Speculative Tracing/Discarding a Speculation;
+ * Options and Tunables/cleanrate
+ */
+#pragma D option quiet
+#pragma D option cleanrate=2000hz
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->discardFlag = 0;
+ self->spec = speculation();
+}
+
+BEGIN
+/self->spec/
+{
+ speculate(self->spec);
+ printf("Called speculate with id: %d\n", self->spec);
+ self->speculateFlag++;
+}
+
+BEGIN
+/(self->spec) && (self->speculateFlag)/
+{
+ discard(self->spec);
+ self->discardFlag++;
+ printf("Data recording after discard\n");
+}
+
+BEGIN
+/self->discardFlag/
+{
+ exit(0);
+}
+
+BEGIN
+/!self->discardFlag/
+{
+ exit(1);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftCommit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftCommit.d
new file mode 100644
index 000000000000..25fcfc542a7b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftCommit.d
@@ -0,0 +1,85 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Can call discard() on a buffer after it has been commited.
+ *
+ * SECTION: Speculative Tracing/Discarding a Speculation;
+ * Options and Tunables/cleanrate
+ *
+ */
+#pragma D option quiet
+#pragma D option cleanrate=3000hz
+
+BEGIN
+{
+ self->i = 0;
+ self->commit = 0;
+ self->discard = 0;
+ var1 = speculation();
+ printf("Speculation ID: %d\n", var1);
+}
+
+BEGIN
+/var1/
+{
+ speculate(var1);
+ printf("This statement and the following are speculative!!\n");
+ printf("Speculating on id: %d\n", var1);
+ self->i++;
+}
+
+BEGIN
+/(self->i)/
+{
+ commit(var1);
+ self->commit++;
+ discard(var1);
+ self->discard++;
+}
+
+BEGIN
+/self->discard/
+{
+ printf("Discarded a commited buffer\n");
+ exit(0);
+}
+
+
+BEGIN
+/!self->discard/
+{
+ printf("Couldnt discard a commited buffer\n");
+ exit(1);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDataRec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDataRec.d
new file mode 100644
index 000000000000..d5c573f9032e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDataRec.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Discard may not follow data recording actions.
+ *
+ * SECTION: Speculative Tracing/Discarding a Speculation
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ printf("Can have data recording before discarding\n");
+ discard(self->spec);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDiscard.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDiscard.d
new file mode 100644
index 000000000000..8c95cee748f5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDiscard.d
@@ -0,0 +1,85 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Can call discard on an already discarded buffer.
+ *
+ * SECTION: Speculative Tracing/Discarding a Speculation;
+ * Options and Tunables/cleanrate
+ *
+ */
+#pragma D option quiet
+#pragma D option cleanrate=3000hz
+
+BEGIN
+{
+ self->i = 0;
+ self->discard1 = 0;
+ self->discard2 = 0;
+ var1 = speculation();
+ printf("Speculation ID: %d\n", var1);
+}
+
+BEGIN
+/var1/
+{
+ speculate(var1);
+ printf("This statement and the following are speculative!!\n");
+ printf("Speculating on id: %d\n", var1);
+ self->i++;
+}
+
+BEGIN
+/(self->i)/
+{
+ discard(var1);
+ self->discard1++;
+ discard(var1);
+ self->discard2++;
+}
+
+BEGIN
+/(self->discard2) && (self->discard1)/
+{
+ printf("Discarded a discarded buffer\n");
+ exit(0);
+}
+
+
+BEGIN
+/(!self->discard2) || (!self->discard1)/
+{
+ printf("Couldnt discard a discarded buffer\n");
+ exit(1);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardWithZero.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardWithZero.d
new file mode 100644
index 000000000000..1a7856137825
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardWithZero.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: An Id of zero though invalid may be passed to speculate(),
+ * commit() and discard() without any ill effects.
+ *
+ * SECTION: Speculative Tracing/Creating a Speculation;
+ * Options and Tunables/cleanrate
+ */
+#pragma D option quiet
+#pragma D option cleanrate=4000hz
+
+BEGIN
+{
+ self->discardFlag = 0;
+ self->var1 = speculation();
+ printf("Speculative buffer ID: %d\n", self->var1);
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+/0 == self->spec/
+{
+ discard(self->spec);
+ self->discardFlag++;
+}
+
+BEGIN
+/0 < self->discardFlag/
+{
+ printf("discard(), self->discardFlag = %d\n", self->discardFlag);
+ exit(0);
+}
+
+BEGIN
+/0 == self->discardFlag/
+{
+ printf("discard(), self->discardFlag = %d\n", self->discardFlag);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.ExitAftDiscard.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.ExitAftDiscard.d
new file mode 100644
index 000000000000..f5bcd6624f19
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.ExitAftDiscard.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Using exit after discard should work fine.
+ *
+ * SECTION: Speculative Tracing/Discarding a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ self->i = 0;
+ self->spec = speculation();
+}
+
+BEGIN
+/self->spec/
+{
+ speculate(self->spec);
+ self->i++;
+ printf("self->i: %d\n", self->i);
+}
+
+BEGIN
+/self->i/
+{
+ discard(self->spec);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d
new file mode 100644
index 000000000000..8fe3a19d0c9c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * The number of speculative buffers defaults to one. If no speculative buffer
+ * is available when speculation is called, an ID of zero is returned.
+ *
+ * SECTION: Speculative Tracing/Creating a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ i = 0;
+}
+
+syscall::open:entry
+/i < 2/
+{
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+ i++;
+}
+
+syscall:::
+/(2 == i) && (0 == self->spec)/
+{
+ printf("i: %d\tself->spec: %d", i, self->spec);
+ exit(0);
+}
+
+syscall:::
+/(2 == i) && (0 != self->spec)/
+{
+ printf("i: %d\tself->spec: %d", i, self->spec);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations1.d
new file mode 100644
index 000000000000..17df6b548434
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations1.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * ASSERTION:
+ * Verify the behavior of speculations with changes in specsize.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/specsize
+ *
+ */
+
+#pragma D option quiet
+#pragma D option specsize=8
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ printf("Lots of data\n");
+ printf("Has to be crammed into this buffer\n");
+ printf("Until it overflows\n");
+ printf("And causes flops\n");
+ self->speculateFlag++;
+
+}
+
+BEGIN
+/1 <= self->speculateFlag/
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/1 <= self->commitFlag/
+{
+ printf("Statement was executed\n");
+ exit(1);
+}
+
+BEGIN
+/1 > self->commitFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations2.d
new file mode 100644
index 000000000000..bcd2f2ea90ca
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations2.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * ASSERTION:
+ * Verify the behavior of speculations with changes in specsize.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/specsize
+ *
+ */
+
+#pragma D option quiet
+#pragma D option specsize=10
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ printf("Lots of data\n");
+ printf("Has to be crammed into this buffer\n");
+ printf("Until it overflows\n");
+ printf("And causes flops\n");
+ self->speculateFlag++;
+
+}
+
+BEGIN
+/1 <= self->speculateFlag/
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/1 <= self->commitFlag/
+{
+ printf("Statement was executed\n");
+ exit(1);
+}
+
+BEGIN
+/1 > self->commitFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d
new file mode 100644
index 000000000000..6b91efd9114b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * ASSERTION:
+ * Verify the behavior of speculations with changes in specsize.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/specsize
+ *
+ */
+
+#pragma D option quiet
+#pragma D option specsize=40
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->commitFlag = 0;
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ printf("Lots of data\n");
+ printf("Has to be crammed into this buffer\n");
+ printf("Until it overflows\n");
+ printf("And causes flops\n");
+ self->speculateFlag++;
+
+}
+
+BEGIN
+/1 <= self->speculateFlag/
+{
+ commit(self->spec);
+ self->commitFlag++;
+}
+
+BEGIN
+/1 <= self->commitFlag/
+{
+ printf("Statement was executed\n");
+ exit(0);
+}
+
+BEGIN
+/1 > self->commitFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculateWithRandom.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculateWithRandom.d
new file mode 100644
index 000000000000..24f1ff4b4fbd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculateWithRandom.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * When speculate() is called with an inactive buffer number, it is
+ * ignored.
+ *
+ * SECTION: Speculative Tracing/Creating a Speculation
+ *
+ */
+#pragma D option quiet
+BEGIN
+{
+ self->i = 0;
+}
+
+BEGIN
+{
+ speculate(3456710);
+ self->i++;
+ printf("self->i: %d\n", self->i);
+
+}
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationCommit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationCommit.d
new file mode 100644
index 000000000000..744ba676645c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationCommit.d
@@ -0,0 +1,75 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test the normal behavior of speculate() and commit().
+ *
+ * SECTION: Speculative Tracing/Committing a Speculation;
+ * Actions and Subroutines/speculation();
+ * Options and Tunables/cleanrate
+ *
+ */
+#pragma D option quiet
+#pragma D option cleanrate=2000hz
+
+BEGIN
+{
+ self->var = speculation();
+ printf("Speculation ID: %d\n", self->var);
+ self->speculate = 0;
+ self->commit = 0;
+}
+
+BEGIN
+/1 > self->speculate/
+{
+ speculate(self->var);
+ self->speculate++;
+ printf("Called speculate on id: %d\n", self->var);
+}
+
+BEGIN
+/1 <= self->speculate/
+{
+ commit(self->var);
+ self->commit++;
+}
+
+BEGIN
+/(1 == self->commit)/
+{
+ printf("Succesfully tested buffer commit\n");
+ exit(0);
+}
+
+BEGIN
+/(0 == self->commit)/
+{
+ printf("Failed to commit buffer\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationDiscard.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationDiscard.d
new file mode 100644
index 000000000000..4ac0e236d13f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationDiscard.d
@@ -0,0 +1,74 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Test the normal behavior of speculate() and discard().
+ *
+ * SECTION: Speculative Tracing/Discarding a Speculation;
+ * Options and Tunables/cleanrate
+ *
+ */
+#pragma D option quiet
+#pragma D option cleanrate=2000hz
+
+BEGIN
+{
+ self->var = speculation();
+ printf("Speculation ID: %d\n", self->var);
+ self->speculate = 0;
+ self->discard = 0;
+}
+
+BEGIN
+/1 > self->speculate/
+{
+ speculate(self->var);
+ self->speculate++;
+ printf("Called speculate on id: %d\n", self->var);
+}
+
+BEGIN
+/1 <= self->speculate/
+{
+ discard(self->var);
+ self->discard++;
+}
+
+BEGIN
+/(1 == self->discard)/
+{
+ printf("Succesfully tested buffer discard\n");
+ exit(0);
+}
+
+BEGIN
+/(0 == self->discard)/
+{
+ printf("Failed to discard buffer\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationID.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationID.d
new file mode 100644
index 000000000000..b2e3678a1143
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationID.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * The speculation() function returns a speculative identifier when a
+ * speculative buffer is available.
+ *
+ * SECTION: Speculative Tracing/Creating a Speculation
+ *
+ */
+#pragma D option quiet
+
+BEGIN
+{
+ var = speculation();
+ printf("Speculation ID: %d", var);
+ exit(0);
+}
+
+END
+/0 == var/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationWithZero.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationWithZero.d
new file mode 100644
index 000000000000..76600dbaf93a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationWithZero.d
@@ -0,0 +1,65 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Calling speculate() with zero does not have any ill effects.
+ * Statement after speculate does not execute.
+ *
+ * SECTION: Speculative Tracing/Creating a Speculation
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ self->speculateFlag = 0;
+ self->spec = speculation();
+ self->spec = speculation();
+ printf("Speculative buffer ID: %d\n", self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+ self->speculateFlag++;
+}
+
+BEGIN
+/1 == self->speculateFlag/
+{
+ printf("Statement was executed\n");
+ exit(1);
+}
+
+BEGIN
+/1 != self->speculateFlag/
+{
+ printf("Statement wasn't executed\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.TwoSpecBuffers.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.TwoSpecBuffers.d
new file mode 100644
index 000000000000..8016b200c500
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.TwoSpecBuffers.d
@@ -0,0 +1,77 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Increasing the value of nspec to two should will increase the number of
+ * speculative buffers to two.
+ *
+ * SECTION: Speculative Tracing/Options and Tuning;
+ * Options and Tunables/nspec
+ *
+ */
+
+#pragma D option quiet
+#pragma D option cleanrate=3000hz
+#pragma D option nspec=2
+
+BEGIN
+{
+ var1 = 0;
+ var2 = 0;
+ var3 = 0;
+}
+
+BEGIN
+{
+ var1 = speculation();
+ printf("Speculation ID: %d\n", var1);
+ var2 = speculation();
+ printf("Speculation ID: %d\n", var2);
+ var3 = speculation();
+ printf("Speculation ID: %d\n", var3);
+}
+
+BEGIN
+/var1 && var2 && (!var3)/
+{
+ printf("Succesfully got two speculative buffers");
+ exit(0);
+}
+
+BEGIN
+/(!var1) || (!var2) || var3/
+{
+ printf("Test failed");
+ exit(1);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.negcommit.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.negcommit.d
new file mode 100644
index 000000000000..cf17c71ee063
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.negcommit.d
@@ -0,0 +1,37 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ commit(-1);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.negspec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.negspec.d
new file mode 100644
index 000000000000..72965c7d13d6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.negspec.d
@@ -0,0 +1,37 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+BEGIN
+{
+ speculate(-1);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.zerosize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.zerosize.d
new file mode 100644
index 000000000000..a4b40014e0fd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.zerosize.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option destructive
+
+BEGIN
+{
+ self->spec = speculation();
+ speculate(self->spec);
+}
+
+BEGIN
+{
+ this->one = 1;
+ this->two = 2;
+ chill(1);
+ speculate(self->spec);
+}
+
+BEGIN
+{
+ speculate(self->spec);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stability/err.D_ATTR_MIN.MinAttributes.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stability/err.D_ATTR_MIN.MinAttributes.d
new file mode 100644
index 000000000000..99fcede74972
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stability/err.D_ATTR_MIN.MinAttributes.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: If a program has a set of attributes less than the predefined
+ * minimum a D_ATTR_MIN is thrown
+ *
+ * SECTION: Stability/Stability Enforcement
+ * SECTION: Errtags/D_ATTR_MIN
+ *
+ */
+
+#pragma D option quiet
+#pragma D option amin=Evolving/Evolving/Common
+
+BEGIN
+{
+ trace(curthread->t_procp);
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_STACK_PROTO.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_STACK_PROTO.bad.d
new file mode 100644
index 000000000000..0af06e6c6344
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_STACK_PROTO.bad.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * stack() accepts one argument
+ *
+ * SECTION: Actions and Subroutines/stack()
+ *
+ */
+
+
+BEGIN
+{
+ stack(1, 2);
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_STACK_SIZE.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_STACK_SIZE.d
new file mode 100644
index 000000000000..8344e5c2b708
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_STACK_SIZE.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test stack() with an invalid argument.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ stack("i'm not an integer constant");
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_FRAMES.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_FRAMES.bad.d
new file mode 100644
index 000000000000..bfd7376362fb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_FRAMES.bad.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * ustack() first argument must be a non-zero positive integer constant
+ *
+ * SECTION: User Process Tracing/ustack();
+ * Actions and Subroutines/ustack()
+ *
+ */
+
+
+BEGIN
+{
+ ustack(0, 200);
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_PROTO.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_PROTO.bad.d
new file mode 100644
index 000000000000..5360d982dcb1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_PROTO.bad.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * ustack() accepts two arguments
+ *
+ * SECTION: User Process Tracing/ustack();
+ * Actions and Subroutines/ustack()
+ *
+ */
+
+
+BEGIN
+{
+ ustack(1, 10, "badarg");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_STRSIZE.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_STRSIZE.bad.d
new file mode 100644
index 000000000000..4c89ed5d1ab6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_STRSIZE.bad.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * ustack() second argument must be a positive integer constant.
+ *
+ * SECTION: User Process Tracing/ustack();
+ * Actions and Subroutines/ustack()
+ *
+ */
+
+
+BEGIN
+{
+ ustack(1, "badarg");
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/tst.default.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/tst.default.d
new file mode 100644
index 000000000000..f7a4f06b1bf6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/tst.default.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the stack action with the default stack depth.
+ *
+ * SECTION: Output Formatting/printf()
+ *
+ */
+
+BEGIN
+{
+ stack();
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stackdepth/tst.default.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stackdepth/tst.default.d
new file mode 100644
index 000000000000..c37380d53a16
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stackdepth/tst.default.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the stackdepth variable.
+ *
+ * SECTION: Variables/Built-in Variables
+ *
+ */
+
+BEGIN
+{
+ trace(stackdepth);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c
new file mode 100644
index 000000000000..28ce1b87a951
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c
@@ -0,0 +1,37 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <unistd.h>
+
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ getpid();
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.d
new file mode 100644
index 000000000000..dd5a4b99844f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for stop
+ *
+ * SECTION: Actions and Subroutines/stop()
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ /*
+ * Wait no more than a second for the process to call getpid().
+ */
+ timeout = timestamp + 1000000000;
+ stopped = 0;
+}
+
+syscall::getpid:entry
+/pid == $1 && stopped == 1/
+{
+ trace("looks like it's still going");
+ exit(1);
+}
+
+syscall::getpid:entry
+/pid == $1 && stopped == 0/
+{
+ stop();
+ trace("stopped");
+ stopped = 1;
+ /*
+ * Wait for a quarter second before declaring victory.
+ */
+ timeout = timestamp + 1000000000 / 4;
+}
+
+profile:::tick-8
+/timestamp > timeout && stopped == 1/
+{
+ trace("looks like it really stopped");
+ exit(0);
+}
+
+profile:::tick-8
+/timestamp > timeout/
+{
+ trace("timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c
new file mode 100644
index 000000000000..28ce1b87a951
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c
@@ -0,0 +1,37 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <unistd.h>
+
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ getpid();
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.d
new file mode 100644
index 000000000000..4c79cd8492d6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive test for stop
+ *
+ * SECTION: Actions and Subroutines/stop()
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ /*
+ * Wait no more than a second for the process to call getpid().
+ */
+ timeout = timestamp + 1000000000;
+ stopped = 0;
+}
+
+syscall::getpid:entry
+/pid == $1 && stopped == 1/
+{
+ trace("looks like it's still going");
+ exit(1);
+}
+
+syscall::getpid:return
+/pid == $1 && stopped == 0/
+{
+ stop();
+ trace("stopped");
+ stopped = 1;
+ /*
+ * Wait for a quarter second before declaring victory.
+ */
+ timeout = timestamp + 1000000000 / 4;
+}
+
+profile:::tick-8
+/timestamp > timeout && stopped == 1/
+{
+ trace("looks like it really stopped");
+ exit(0);
+}
+
+profile:::tick-8
+/timestamp > timeout/
+{
+ trace("timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/strlen/tst.strlen1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/strlen/tst.strlen1.d
new file mode 100644
index 000000000000..7775395b78ef
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/strlen/tst.strlen1.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the strlen() subroutine.
+ *
+ * SECTION: Actions and Subroutines/strlen()
+ *
+ */
+
+BEGIN
+/strlen("I like DTrace") == 13/
+{
+ correct = 1;
+}
+
+BEGIN
+{
+ exit(correct ? 0 : 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_ADDROF_VAR.StructPointer.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_ADDROF_VAR.StructPointer.d
new file mode 100644
index 000000000000..85e49fa0e2cd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_ADDROF_VAR.StructPointer.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Trying to access the members of a user defined struct by means of
+ * a pointer to it should throw a D_ADDROF_VAR compiler error.
+ *
+ * SECTION: Structs and Unions/Pointers to Structs
+ *
+ */
+
+#pragma D option quiet
+
+struct record {
+ int position;
+ int content;
+
+};
+
+struct record var;
+struct record *ptr;
+BEGIN
+{
+
+ var.position = 1;
+ var.content = 'a';
+
+ ptr = &var;
+
+ printf("ptr->position: %d\tptr->content: %c\n",
+ ptr->position, ptr->content);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon.d
new file mode 100644
index 000000000000..004e9019bf7b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon.d
@@ -0,0 +1,74 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Combining multiple struct definitions in a single line should throw a
+ * compiler error.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+#pragma D option quiet
+
+struct superStruct {
+ int position;
+ char content;
+}
+
+struct record {
+ int position;
+ char content;
+}
+
+
+struct pirate {
+ int position;
+ char content;
+};
+
+struct superStruct super;
+struct record rec;
+struct pirate pir;
+
+BEGIN
+{
+ rec.content = 'a';
+ rec.position = 1;
+
+ pir.content = 'b';
+ pir.position = 2;
+
+ printf(
+ "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d",
+ rec.content, rec.position, pir.content, pir.position);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon1.d
new file mode 100644
index 000000000000..1c403b67d36a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon1.d
@@ -0,0 +1,68 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Combining multiple struct definitions in a single line should throw a
+ * compiler error.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+#pragma D option quiet
+
+struct record {
+ int position;
+ char content;
+};
+
+
+struct pirate {
+ int position;
+ char content;
+}
+
+struct record rec;
+struct pirate pir;
+
+BEGIN
+{
+ rec.content = 'a';
+ rec.position = 1;
+
+ pir.content = 'b';
+ pir.position = 2;
+
+ printf(
+ "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d",
+ rec.content, rec.position, pir.content, pir.position);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.circular.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.circular.d
new file mode 100644
index 000000000000..dcbc8ee209e3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.circular.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * A circular definition of structs (two structs defining each other as
+ * members) should throw an error at compile time.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+#pragma D option quiet
+
+
+struct record {
+ struct pirate p;
+ int position;
+ char content;
+};
+
+
+struct pirate {
+ struct record r;
+ int position;
+ char content;
+};
+
+struct record rec;
+struct pirate pir;
+
+BEGIN
+{
+ rec.position = 0;
+ rec.content = 'a';
+ printf("rec.position: %d\nrec.content: %c\n",
+ rec.position, rec.content);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order.d
new file mode 100644
index 000000000000..932f4dc9eac7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order.d
@@ -0,0 +1,69 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * When two struct are defined such that one of them contains the other, the
+ * inner struct has to be defined first.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+#pragma D option quiet
+
+
+struct record {
+ struct pirate p;
+ int position;
+ char content;
+};
+
+struct pirate {
+ int position;
+ char content;
+};
+
+struct record rec;
+struct pirate pir;
+
+BEGIN
+{
+ rec.content = 'y';
+ rec.position = 2;
+
+ pir.content = 'z';
+ pir.position = 26;
+
+ printf(
+ "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d",
+ rec.content, rec.position, pir.content, pir.position);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order2.d
new file mode 100644
index 000000000000..807b61866902
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order2.d
@@ -0,0 +1,108 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * When struct definitions are nested inside one another, the inner struct
+ * should be defined before the outer one can declare it as a variable.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+#pragma D option quiet
+
+struct InnerMore {
+ struct InnerMost IMost;
+ int dummy_More;
+};
+
+struct InnerMost {
+ int position;
+ char content;
+};
+
+struct Inner {
+ struct InnerMore IMore;
+ int dummy_More;
+};
+
+struct Outer {
+ struct Inner I;
+ int dummy_More;
+};
+
+struct OuterMore {
+ struct Outer O;
+ int dummy_More;
+};
+
+struct OuterMost {
+ struct OuterMore OMore;
+ int dummy_More;
+} OMost;
+
+
+BEGIN
+{
+
+ OMost.dummy_More = 0;
+ OMost.OMore.dummy_More = 1;
+ OMost.OMore.O.dummy_More = 2;
+ OMost.OMore.O.I.dummy_More = 3;
+ OMost.OMore.O.I.IMore.dummy_More = 4;
+ OMost.OMore.O.I.IMore.IMost.position = 5;
+ OMost.OMore.O.I.IMore.IMost.content = 'e';
+
+ printf("OMost.dummy_More: %d\nOMost.OMore.dummy_More: %d\n",
+ OMost.dummy_More, OMost.OMore.dummy_More);
+
+ printf("OMost.OMore.O.dummy_More: %d\nOMost.OMore.O.I.dummy_More: %d\n",
+ OMost.OMore.O.dummy_More, OMost.OMore.O.I.dummy_More);
+
+ printf("OMost.OMore.O.I.IMore.dummy_More:%d\n",
+ OMost.OMore.O.I.IMore.dummy_More);
+
+ printf("OMost.OMore.O.I.IMore.IMost.position: %d\n",
+ OMost.OMore.O.I.IMore.IMost.position);
+
+ printf("OMost.OMore.O.I.IMore.IMost.content: %c\n",
+ OMost.OMore.O.I.IMore.IMost.content);
+
+ exit(0);
+}
+
+END
+/(0 != OMost.dummy_More) || (1 != OMost.OMore.dummy_More)
+ (2 != OMost.OMore.O.dummy_More) || (3 != OMost.OMore.O.I.dummy_More)
+ (4 != OMost.OMore.O.I.IMore.dummy_More)
+ (5 != OMost.OMore.O.I.IMore.IMost.position)
+ ('e' != OMost.OMore.O.I.IMore.IMost.content)/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.recursive.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.recursive.d
new file mode 100644
index 000000000000..011fbdd31c50
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.recursive.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION: Recursive naming of structures should produce compiler error.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+#pragma D option quiet
+
+struct record {
+ struct record rec;
+ int position;
+ char content;
+};
+
+struct record r1;
+struct record r2;
+
+BEGIN
+{
+ r1.position = 1;
+ r1.content = 'a';
+
+ r2.position = 2;
+ r2.content = 'b';
+
+ printf("r1.position: %d\nr1.content: %c\n", r1.position, r1.content);
+ printf("r2.position: %d\nr2.content: %c\n", r2.position, r2.content);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.simple.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.simple.d
new file mode 100644
index 000000000000..7fc54ff04dd3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.simple.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Declaring an inner struct within another struct and not defining it should
+ * throw a compiler error.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+#pragma D option quiet
+
+
+struct record {
+ struct pirate p;
+ int position;
+ char content;
+};
+
+
+struct record rec;
+
+BEGIN
+{
+ rec.position = 0;
+ rec.content = 'a';
+ printf("rec.position: %d\nrec.content: %c\n",
+ rec.position, rec.content);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_VOIDOBJ.baddec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_VOIDOBJ.baddec.d
new file mode 100644
index 000000000000..bba126fe73b9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_VOIDOBJ.baddec.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Declaring void objects will result in a D_DECL_VOIDOBJ error
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+#pragma D option quiet
+
+struct {
+ int trace();
+};
+
+BEGIN
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_PROTO_ARG.DupStructAssoc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_PROTO_ARG.DupStructAssoc.d
new file mode 100644
index 000000000000..0eea2d8dafc2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_PROTO_ARG.DupStructAssoc.d
@@ -0,0 +1,80 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Declaring an associative array with a struct to be its key type and trying to
+ * index with another struct having the same composition throws an error.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+#pragma D option quiet
+
+struct record {
+ int position;
+ char content;
+};
+
+struct pirate {
+ int position;
+ char content;
+};
+
+struct record r1;
+struct record r2;
+struct pirate p1;
+struct pirate p2;
+
+BEGIN
+{
+ r1.position = 1;
+ r1.content = 'a';
+
+ r2.position = 2;
+ r2.content = 'b';
+
+ p1.position = 1;
+ p1.content = 'a';
+
+ p2.position = 2;
+ p2.content = 'b';
+
+ assoc_array[r1] = 1000;
+ assoc_array[r2] = 2000;
+ assoc_array[p1] = 3333;
+ assoc_array[p2] = 4444;
+
+ printf("assoc_array[r1]: %d\n", assoc_array[r1]);
+ printf("assoc_array[r2]: %d\n", assoc_array[r2]);
+ printf("assoc_array[p1]: %d\n", assoc_array[p1]);
+ printf("assoc_array[p2]: %d\n", assoc_array[p2]);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructAssoc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructAssoc.d
new file mode 100644
index 000000000000..ead235da6ffe
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructAssoc.d
@@ -0,0 +1,71 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * When a struct is used as a key for an associative array, the key is formed
+ * by using the values of the members of the struct variable and not the
+ * address of the struct variable.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+#pragma D option quiet
+
+struct record {
+ int position;
+ char content;
+};
+
+struct record r1;
+struct record r2;
+
+BEGIN
+{
+ r1.position = 1;
+ r1.content = 'a';
+
+ r2.position = 1;
+ r2.content = 'a';
+
+ assoc_array[r1] = 1000;
+ assoc_array[r2] = 2000;
+
+ printf("assoc_array[r1]: %d\n", assoc_array[r1]);
+ printf("assoc_array[r2]: %d\n", assoc_array[r2]);
+
+ exit(0);
+}
+
+END
+/assoc_array[r1] != assoc_array[r2]/
+{
+ printf("Error");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructDataTypes.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructDataTypes.d
new file mode 100644
index 000000000000..5cfdc32553c6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructDataTypes.d
@@ -0,0 +1,133 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Declaration of the different data types within a struct and
+ * their definitions in a later clause should work fine.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ * NOTES: The floats, doubles and strings have not been implemented yet.
+ * When they do, appropriate lines in the code below should be uncommented.
+ * Similarly, the lines with the kmem_flags pointer assignment should be
+ * uncommented when the issues pertaining to it are clarified.
+ *
+ */
+#pragma D option quiet
+
+struct record {
+ char new_char;
+ short new_short;
+ int new_int;
+ long new_long;
+ long long new_long_long;
+ int8_t new_int8;
+ int16_t new_int16;
+ int32_t new_int32;
+ int64_t new_int64;
+ intptr_t new_intptr;
+ uint8_t new_uint8;
+ uint16_t new_uint16;
+ uint32_t new_uint32;
+ uint64_t new_uint64;
+ uintptr_t new_uintptr;
+
+ /*
+ float new_float;
+ double new_double;
+ long double new_long_double;
+
+ string new_string;
+ */
+
+ struct {
+ char ch;
+ int in;
+ long lg;
+ } new_struct;
+
+ union {
+ char ch;
+ int in;
+ long lg;
+ } new_union;
+
+enum colors {
+ RED,
+ GREEN,
+ BLUE
+} new_enum;
+
+
+ int *pointer;
+} var;
+
+/*
+ var.pointer = &`kmem_flags;
+*/
+BEGIN
+{
+ var.new_char = 'c';
+ var.new_short = 10;
+ var.new_int = 100;
+ var.new_long = 1234567890;
+ var.new_long_long = 1234512345;
+ var.new_int8 = 'p';
+ var.new_int16 = 20;
+ var.new_int32 = 200;
+ var.new_int64 = 2000000;
+ var.new_intptr = 0x12345;
+ var.new_uint8 = 'q';
+ var.new_uint16 = 30;
+ var.new_uint32 = 300;
+ var.new_uint64 = 3000000;
+ var.new_uintptr = 0x67890;
+
+/* var.new_float = 1.23456;
+ var.new_double = 2.34567890;
+ var.new_long_double = 3.567890123;
+
+ var.new_string = "hello";
+*/
+
+/*
+ var.pointer = &`kmem_flags;
+*/
+
+ var.new_struct.ch = 'c';
+ var.new_struct.in = 4;
+ var.new_struct.lg = 4;
+
+ var.new_union.ch = 'd';
+ var.new_union.in = 5;
+ var.new_union.lg = 5;
+
+ this->var = var;
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructInside.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructInside.d
new file mode 100644
index 000000000000..159accc406f6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructInside.d
@@ -0,0 +1,124 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify the nested behavior of structs.
+ *
+ * SECTION: Structs and Unions/Structs
+ *
+ */
+
+#pragma D option quiet
+
+struct InnerMost {
+ int position;
+ char content;
+};
+
+struct InnerMore {
+ struct InnerMost IMost;
+ int dummy_More;
+};
+
+struct Inner {
+ struct InnerMore IMore;
+ int dummy_More;
+};
+
+struct Outer {
+ struct Inner I;
+ int dummy_More;
+};
+
+struct OuterMore {
+ struct Outer O;
+ int dummy_More;
+};
+
+struct OuterMost {
+ struct OuterMore OMore;
+ int dummy_More;
+} OMost;
+
+struct OuterMost OMostCopy;
+
+BEGIN
+{
+
+ OMost.dummy_More = 0;
+ OMost.OMore.dummy_More = 1;
+ OMost.OMore.O.dummy_More = 2;
+ OMost.OMore.O.I.dummy_More = 3;
+ OMost.OMore.O.I.IMore.dummy_More = 4;
+ OMost.OMore.O.I.IMore.IMost.position = 5;
+ OMost.OMore.O.I.IMore.IMost.content = 'e';
+
+ printf("OMost.dummy_More: %d\nOMost.OMore.dummy_More: %d\n",
+ OMost.dummy_More, OMost.OMore.dummy_More);
+
+ printf("OMost.OMore.O.dummy_More: %d\n",
+ OMost.OMore.O.dummy_More);
+
+ printf("OMost.OMore.O.I.dummy_More: %d\n",
+ OMost.OMore.O.I.dummy_More);
+
+ printf("OMost.OMore.O.I.IMore.dummy_More:%d\n",
+ OMost.OMore.O.I.IMore.dummy_More);
+
+ printf("OMost.OMore.O.I.IMore.IMost.position: %d\n",
+ OMost.OMore.O.I.IMore.IMost.position);
+
+ printf("OMost.OMore.O.I.IMore.IMost.content: %c\n",
+ OMost.OMore.O.I.IMore.IMost.content);
+
+ OMostCopy = OMost;
+
+ exit(0);
+}
+
+END
+/(0 != OMost.dummy_More) || (1 != OMost.OMore.dummy_More) ||
+ (2 != OMost.OMore.O.dummy_More) || (3 != OMost.OMore.O.I.dummy_More) ||
+ (4 != OMost.OMore.O.I.IMore.dummy_More) ||
+ (5 != OMost.OMore.O.I.IMore.IMost.position) ||
+ ('e' != OMost.OMore.O.I.IMore.IMost.content)/
+{
+ exit(1);
+}
+
+END
+/(0 != OMostCopy.dummy_More) || (1 != OMostCopy.OMore.dummy_More) ||
+ (2 != OMostCopy.OMore.O.dummy_More) ||
+ (3 != OMostCopy.OMore.O.I.dummy_More) ||
+ (4 != OMostCopy.OMore.O.I.IMore.dummy_More) ||
+ (5 != OMostCopy.OMore.O.I.IMore.IMost.position) ||
+ ('e' != OMostCopy.OMore.O.I.IMore.IMost.content)/
+{
+ exit(2);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d
new file mode 100644
index 000000000000..0a7e80e43b2a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+struct foo {
+ int x;
+ char y;
+ short z;
+};
+
+this struct foo bar;
+long bignum;
+
+BEGIN
+{
+ this->bar.x = 1;
+ this->bar.y = ',';
+ this->bar.z = 1234;
+}
+
+BEGIN
+{
+ printf("Die %s%c %s.\n", this->bar.x == 1 ? "SystemTap" : "DTrace",
+ this->bar.y, this->bar.z == 1234 ? "Die" : "The");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d.out
new file mode 100644
index 000000000000..c3fbf224fc6d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d.out
@@ -0,0 +1,2 @@
+Die SystemTap, Die.
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c
new file mode 100644
index 000000000000..209160bd75f1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <stdio.h>
+#include <sys/syscall.h>
+
+/*ARGSUSED*/
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ (void) syscall(SYS_mmap, NULL, 1, 2, 3, -1, 0x12345678);
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.d
new file mode 100644
index 000000000000..8e473b466ea8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Make sure we're correctly reporting arguments to syscall probes.
+ */
+
+#pragma D option quiet
+
+syscall::mmap*:entry
+/pid == $1 && arg0 == 0 && arg1 == 1 && arg2 == 2 && arg3 == 3 &&
+ (int)arg4 == -1 && arg5 == 0x12345678/
+{
+ exit(0);
+}
+
+tick-1s
+/i++ == 3/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.openret.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.openret.ksh
new file mode 100644
index 000000000000..6469db7703fa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.openret.ksh
@@ -0,0 +1,75 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+script() {
+ $dtrace -c 'cat shajirosan' -qs /dev/stdin <<EOF
+ syscall::open*:entry
+ /pid == \$target/
+ {
+ self->p = arg0;
+ }
+
+ syscall::open*:return
+ /self->p && copyinstr(self->p) == "shajirosan"/
+ {
+ self->err = 1;
+ self->p = 0;
+ }
+
+ syscall::open*:return
+ /self->err && (int)arg0 == -1 && (int)arg1 == -1/
+ {
+ exit(0);
+ }
+
+ syscall::open*:return
+ /self->err/
+ {
+ printf("a failed open(2) returned %d\n", (int)arg0);
+ exit(1);
+ }
+
+ syscall::open*:return
+ /self->p/
+ {
+ self->p = 0;
+ }
+EOF
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+script
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post.c
new file mode 100644
index 000000000000..1e7f957f1e63
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post.c
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <libsysevent.h>
+#include <stdio.h>
+
+int
+main(int argc, char **argv)
+{
+ sysevent_id_t id;
+
+ for (;;) {
+ if (sysevent_post_event("class_dtest", "subclass_dtest",
+ "vendor_dtest", "publisher_dtest", NULL, &id) != 0) {
+ (void) fprintf(stderr, "failed to post sysevent\n");
+ return (1);
+ }
+
+ sleep(1);
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post.d
new file mode 100644
index 000000000000..e547a2610cb9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post.d
@@ -0,0 +1,88 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ $1 + 0; /* make sure pid is referenced */
+
+ /*
+ * Wait no more than a five seconds for the sysevent to be posted
+ */
+ timeout = timestamp + 5000000000;
+}
+
+sysevent:::post
+/args[0]->ec_name != NULL/
+{
+ printf("channel name is non-NULL (%s)\n",
+ args[0]->ec_name);
+ exit(1);
+}
+
+sysevent:::post
+/strstr(args[1]->se_publisher, "vendor_dtest") == NULL/
+{
+ printf("missing vendor name from publisher (%s)\n",
+ args[1]->se_publisher);
+ exit(1);
+}
+
+sysevent:::post
+/strstr(args[1]->se_publisher, "publisher_dtest") == NULL/
+{
+ printf("missing publisher name from publisher (%s)\n",
+ args[1]->se_publisher);
+ exit(1);
+}
+
+sysevent:::post
+/args[1]->se_class != "class_dtest"/
+{
+ printf("unexpected class name (%s)\n", args[1]->se_class);
+ exit(1);
+}
+
+sysevent:::post
+/args[1]->se_subclass != "subclass_dtest"/
+{
+ printf("unexpected subclass name (%s)\n", args[1]->se_subclass);
+ exit(1);
+}
+
+sysevent:::post
+{
+ exit(0);
+}
+
+profile:::tick-8
+/timestamp > timeout/
+{
+ printf("timed out\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.c
new file mode 100644
index 000000000000..4a452a7ad2de
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.c
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <libsysevent.h>
+#include <stdio.h>
+
+int
+main(int argc, char **argv)
+{
+ evchan_t *ch;
+
+ if (sysevent_evc_bind("channel_dtest", &ch,
+ EVCH_CREAT | EVCH_HOLD_PEND) != 0) {
+ (void) fprintf(stderr, "failed to bind to sysevent channel\n");
+ return (1);
+ }
+
+ for (;;) {
+ if (sysevent_evc_publish(ch, "class_dtest", "subclass_dtest",
+ "vendor_dtest", "publisher_dtest", NULL, EVCH_SLEEP) != 0) {
+ (void) sysevent_evc_unbind(ch);
+ (void) fprintf(stderr, "failed to publisth sysevent\n");
+ return (1);
+ }
+ sleep(1);
+ }
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.d
new file mode 100644
index 000000000000..9d12e1eccc08
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.d
@@ -0,0 +1,87 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ $1 + 0; /* make sure pid is referenced */
+
+ /*
+ * Wait no more than five seconds for the sysevent to be posted
+ */
+ timeout = timestamp + 5000000000;
+}
+
+sysevent:::post
+/args[0]->ec_name != "channel_dtest"/
+{
+ printf("unexpected channel name (%s)\n", args[0]->ec_name);
+ exit(1);
+}
+
+sysevent:::post
+/strstr(args[1]->se_publisher, "vendor_dtest") == NULL/
+{
+ printf("missing vendor name from publisher (%s)\n",
+ args[1]->se_publisher);
+ exit(1);
+}
+
+sysevent:::post
+/strstr(args[1]->se_publisher, "publisher_dtest") == NULL/
+{
+ printf("missing publisher name from publisher (%s)\n",
+ args[1]->se_publisher);
+ exit(1);
+}
+
+sysevent:::post
+/args[1]->se_class != "class_dtest"/
+{
+ printf("unexpected class name (%s)\n", args[1]->se_class);
+ exit(1);
+}
+
+sysevent:::post
+/args[1]->se_subclass != "subclass_dtest"/
+{
+ printf("unexpected subclass name (%s)\n", args[1]->se_subclass);
+ exit(1);
+}
+
+sysevent:::post
+{
+ exit(0);
+}
+
+profile:::tick-8
+/timestamp > timeout/
+{
+ printf("timed out\n");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZERO.tick.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZERO.tick.d
new file mode 100644
index 000000000000..015ae2b0e613
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZERO.tick.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Negative test; calls tick without valid value.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-n
+{
+ printf("This test is a simple tick-n negative test\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonens.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonens.d
new file mode 100644
index 000000000000..3ed28b1b15ba
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonens.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call profile-'ns' less than 200 micro seconds.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+#pragma D option quiet
+
+profile-1ns
+{
+ printf("Calls 'ns' less than 200 micro seconds\n");
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonensec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonensec.d
new file mode 100644
index 000000000000..7b4df199d303
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonensec.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call profile-1nsec; less than 200 micro seconds.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+#pragma D option quiet
+
+profile-1nsec
+{
+ printf("Call profile-1nsec; less than 200 micro seconds\n");
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneus.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneus.d
new file mode 100644
index 000000000000..6a64a3a2d4e1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneus.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Call profile-us; less than 200 micro seconds.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+#pragma D option quiet
+
+profile-1us
+{
+ printf(" Calling profile-us less than 200 micro seconds should fail\n");
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneusec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneusec.d
new file mode 100644
index 000000000000..b6b80bea03bd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneusec.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * profile-usec; less than 200 micro seconds.
+ *
+ * SECTION: profile Provider/profile-n probes
+ *
+ */
+
+#pragma D option quiet
+
+profile-1usec
+{
+ printf("profile-usec; less than 200 micro seconds \n");
+ exit (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickarg0.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickarg0.d
new file mode 100644
index 000000000000..4dda358c4913
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickarg0.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * Simple tick-n 'arg0' test.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-1
+{
+ printf("The arg0 is %d\n", (int)arg0);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d
new file mode 100644
index 000000000000..602f3a91a08e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * tick-ms simple test.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-1ms
+{
+ printf("This test is a simple tick-ms provider test\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d.out
new file mode 100644
index 000000000000..1e267598c0d4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d.out
@@ -0,0 +1,2 @@
+This test is a simple tick-ms provider test
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d
new file mode 100644
index 000000000000..1cf3b742ebff
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * tick-msec simple test.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-1msec
+{
+ printf("This test is a simple tick-msec provider test\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d.out
new file mode 100644
index 000000000000..286bb14b7092
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d.out
@@ -0,0 +1,2 @@
+This test is a simple tick-msec provider test
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d
new file mode 100644
index 000000000000..917139cab8ff
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * tick-ns simple test.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-20000000ns
+{
+ printf("This test is a simple tick-ns provider test\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d.out
new file mode 100644
index 000000000000..26adddebc943
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d.out
@@ -0,0 +1,2 @@
+This test is a simple tick-ns provider test
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d
new file mode 100644
index 000000000000..3eedead2a43c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * tick-nsec simple test.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-20000000nsec
+{
+ printf("This test is a simple tick-nsec provider test\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d.out
new file mode 100644
index 000000000000..4ad77b587d60
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d.out
@@ -0,0 +1,2 @@
+This test is a simple tick-nsec provider test
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d
new file mode 100644
index 000000000000..05f2657da46b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * tick-1s simple test.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-1s
+{
+ printf("This test is a simple tick-s provider test\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d.out
new file mode 100644
index 000000000000..b0631218745a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d.out
@@ -0,0 +1,2 @@
+This test is a simple tick-s provider test
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d
new file mode 100644
index 000000000000..703af4d52cac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * tick-1sec simple test.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-1sec
+{
+ printf("This test is a simple tick-sec provider test\n");
+}
+tick-1sec
+{
+ printf("This test is a simple tick-sec provider test");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d.out
new file mode 100644
index 000000000000..d9d4f45a6d4d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d.out
@@ -0,0 +1,2 @@
+This test is a simple tick-sec provider test
+This test is a simple tick-sec provider test
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d
new file mode 100644
index 000000000000..aa10cbb50de9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * tick-2000us simple test.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-2000us
+{
+ printf("This test is a simple tick-us provider test\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d.out
new file mode 100644
index 000000000000..00baa3dce635
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d.out
@@ -0,0 +1,2 @@
+This test is a simple tick-us provider test
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d
new file mode 100644
index 000000000000..9deb8f4c57f7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * tick-2000usec simple test.
+ *
+ * SECTION: profile Provider/tick-n probes
+ *
+ */
+
+
+#pragma D option quiet
+
+tick-2000usec
+{
+ printf("This test is a simple tick-usec provider test\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d.out
new file mode 100644
index 000000000000..40987e325c7e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d.out
@@ -0,0 +1,2 @@
+This test is a simple tick-usec provider test
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d
new file mode 100644
index 000000000000..68c11950b51c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ * Test trace() with no arguments.
+ *
+ * SECTION: Actions and Subroutines/trace()
+ */
+
+BEGIN
+{
+
+ trace();
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d
new file mode 100644
index 000000000000..b29b9f179964
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+BEGIN
+{
+ @ = count();
+ trace(@);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d
new file mode 100644
index 000000000000..ed044b2236fb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ * Test an invalid specification of trace() with a void argument.
+ *
+ * SECTION: Actions and Subroutines/trace()
+ */
+
+BEGIN
+{
+ trace((void)`kmem_flags);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d
new file mode 100644
index 000000000000..24ad80fb469c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d
@@ -0,0 +1,28 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+BEGIN
+{
+ trace(*curpsinfo);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.misc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.misc.d
new file mode 100644
index 000000000000..70ad5fc6d969
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.misc.d
@@ -0,0 +1,68 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test a variety of trace() action invocations.
+ *
+ * SECTION: Actions and Subroutines/trace();
+ * Output Formatting/trace()
+ *
+ * NOTES:
+ * We test things that exercise different kinds of DIFO return types
+ * to ensure each one can be traced.
+ */
+
+BEGIN
+{
+ i = 1;
+}
+
+
+tick-1
+/i != 5/
+{
+ trace("test trace"); /* DT_TYPE_STRING */
+ trace(12345); /* DT_TYPE_INT (constant) */
+ trace(x++); /* DT_TYPE_INT (derived) */
+ trace(timestamp); /* DT_TYPE_INT (variable) */
+ trace(`kmem_flags); /* CTF type (by value) */
+ trace(*`rootvp); /* CTF type (by ref) */
+ i++;
+}
+
+tick-1
+/i == 5/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.qstring.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.qstring.d
new file mode 100644
index 000000000000..a81d147b0969
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.qstring.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+/*
+ * ASSERTION:
+ * Positive trace tests - trace with strings, using quiet option
+ *
+ * SECTION: Actions and Subroutines/trace()
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ trace("this");
+ trace(" %should work.\n");
+ trace("%don't w%orry -- this won't cause a %segfault.\n");
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.qstring.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.qstring.d.out
new file mode 100644
index 000000000000..908ffb2a2657
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.qstring.d.out
@@ -0,0 +1,3 @@
+this %should work.
+%don't w%orry -- this won't cause a %segfault.
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.string.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.string.d
new file mode 100644
index 000000000000..c5e7c2ccbd54
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.string.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive trace tests - trace with strings
+ *
+ * SECTION: Actions and Subroutines/trace()
+ */
+
+BEGIN
+{
+ trace("this");
+ trace(" %should work.\n");
+ trace("%don't w%orry -- this won't cause a %segfault.\n");
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_ARG.badsize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_ARG.badsize.d
new file mode 100644
index 000000000000..4e137cec5974
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_ARG.badsize.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test tracemem() with an invalid size argument.
+ *
+ * SECTION: Actions and Subroutines/tracemem()
+ */
+
+BEGIN
+{
+ tracemem(123, "i'm a string");
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toofew.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toofew.d
new file mode 100644
index 000000000000..91c4f77bbcf8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toofew.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test tracemem() with too few arguments.
+ *
+ * SECTION: Actions and Subroutines/tracemem()
+ */
+
+
+BEGIN
+{
+ tracemem(123);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d
new file mode 100644
index 000000000000..68145774e8d5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test tracemem() with an invalid address argument.
+ *
+ * SECTION: Actions and Subroutines/tracemem()
+ */
+
+BEGIN
+{
+ tracemem(`v, 123);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d
new file mode 100644
index 000000000000..1eb96be529cc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ tracemem(`dtrace_zero, 256, 0, "fishpong");
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d
new file mode 100644
index 000000000000..554bb7dfb4df
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d
@@ -0,0 +1,30 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+BEGIN
+{
+ tracemem(`dtrace_zero, 256, "fishpong");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.negsize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.negsize.d
new file mode 100644
index 000000000000..b3dd4381e3d0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.negsize.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test tracemem() with a negative size argument.
+ *
+ * SECTION: Actions and Subroutines/tracemem()
+ */
+
+BEGIN
+{
+ tracemem(123, -456);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.zerosize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.zerosize.d
new file mode 100644
index 000000000000..595bfcc030bf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.zerosize.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test tracemem() with a zero size argument.
+ *
+ * SECTION: Actions and Subroutines/tracemem()
+ */
+
+BEGIN
+{
+ tracemem(123, 0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d
new file mode 100644
index 000000000000..de530e811cb1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ i = -10;
+}
+
+tick-10ms
+/i++ < 150/
+{
+ printf("%d:", i);
+ tracemem(`dtrace_zero, 128, i);
+ printf("\n");
+}
+
+tick-10ms
+/i >= 150/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out
new file mode 100644
index 000000000000..6415893b8db1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out
@@ -0,0 +1,1313 @@
+-9:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+-8:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+-7:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+-6:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+-5:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+-4:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+-3:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+-2:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+-1:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+0:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+1:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 .
+
+2:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 ..
+
+3:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 ...
+
+4:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 ....
+
+5:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 .....
+
+6:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 ......
+
+7:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 .......
+
+8:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 ........
+
+9:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 .........
+
+10:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 ..........
+
+11:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 ...........
+
+12:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 ............
+
+13:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
+
+14:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
+
+15:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
+
+16:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+17:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 .
+
+18:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 ..
+
+19:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 ...
+
+20:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 ....
+
+21:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 .....
+
+22:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 ......
+
+23:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 .......
+
+24:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 ........
+
+25:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 .........
+
+26:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 ..........
+
+27:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 ...........
+
+28:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 ............
+
+29:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
+
+30:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
+
+31:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
+
+32:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+33:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 .
+
+34:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 ..
+
+35:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 ...
+
+36:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 ....
+
+37:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 .....
+
+38:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 ......
+
+39:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 .......
+
+40:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 ........
+
+41:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 .........
+
+42:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 ..........
+
+43:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 ...........
+
+44:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 ............
+
+45:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
+
+46:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
+
+47:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
+
+48:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+49:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 .
+
+50:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 ..
+
+51:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 ...
+
+52:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 ....
+
+53:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 .....
+
+54:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 ......
+
+55:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 .......
+
+56:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 ........
+
+57:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 .........
+
+58:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 ..........
+
+59:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 ...........
+
+60:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 ............
+
+61:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
+
+62:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
+
+63:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
+
+64:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+65:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 .
+
+66:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 ..
+
+67:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 ...
+
+68:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 ....
+
+69:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 .....
+
+70:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 ......
+
+71:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 .......
+
+72:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 ........
+
+73:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 .........
+
+74:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 ..........
+
+75:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 ...........
+
+76:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 ............
+
+77:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
+
+78:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
+
+79:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
+
+80:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+81:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 .
+
+82:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 ..
+
+83:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 ...
+
+84:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 ....
+
+85:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 .....
+
+86:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 ......
+
+87:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 .......
+
+88:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 ........
+
+89:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 .........
+
+90:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 ..........
+
+91:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 ...........
+
+92:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 ............
+
+93:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
+
+94:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
+
+95:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
+
+96:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+97:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 .
+
+98:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 ..
+
+99:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 ...
+
+100:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 ....
+
+101:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 .....
+
+102:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 ......
+
+103:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 .......
+
+104:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 ........
+
+105:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 .........
+
+106:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 ..........
+
+107:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 ...........
+
+108:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 ............
+
+109:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
+
+110:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
+
+111:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
+
+112:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+113:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 .
+
+114:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 ..
+
+115:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 ...
+
+116:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 ....
+
+117:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 .....
+
+118:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 ......
+
+119:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 .......
+
+120:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 ........
+
+121:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 .........
+
+122:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 ..........
+
+123:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 ...........
+
+124:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 ............
+
+125:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 .............
+
+126:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
+
+127:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
+
+128:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+129:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+130:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+131:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+132:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+133:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+134:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+135:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+136:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+137:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+138:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+139:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+140:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+141:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+142:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+143:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+144:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+145:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+146:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+147:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+148:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+149:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+150:
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
+ 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.rootvp.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.rootvp.d
new file mode 100644
index 000000000000..537b72281254
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.rootvp.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test tracemem() by tracing out the contents of the root vnode
+ * as a raw stream of bytes.
+ *
+ * SECTION: Actions and Subroutines/tracemem()
+ */
+
+
+BEGIN
+{
+ i = 1;
+}
+
+tick-1
+/i != 5/
+{
+ tracemem(`rootvp, 20);
+ i++;
+}
+
+tick-1
+/i == 5/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_DECL_TYPERED.BadTransDecl.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_DECL_TYPERED.BadTransDecl.d
new file mode 100644
index 000000000000..2a44778e334d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_DECL_TYPERED.BadTransDecl.d
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a translator with the input type enclosed in
+ * between braces rather than angle brackets.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *uvar;
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct
+{
+ struct input_struct *uvar
+}
+{
+ myi = ((struct input_struct *) uvar)->i;
+ myc = ((struct input_struct *) uvar)->c;
+}
+
+BEGIN
+{
+ printf("Using braces instead of angle brackets for translator input");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_OP_INCOMPLETE.NonExistentInput1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_OP_INCOMPLETE.NonExistentInput1.d
new file mode 100644
index 000000000000..0c8c84d35b59
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_OP_INCOMPLETE.NonExistentInput1.d
@@ -0,0 +1,54 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a translator with a non-existent input type.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ */
+
+#pragma D option quiet
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < struct input_struct *ivar >
+{
+ myi = ((struct input_struct *) ivar)->nonexistentI;
+ myc = ((struct input_struct *) ivar)->nonexistentC;
+};
+
+BEGIN
+{
+ printf("Test the translation of a non existing input type");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl1.d
new file mode 100644
index 000000000000..52e5c9aea96f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl1.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a translator with the input type enclosed in
+ * between parantheses rather than angle brackets.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *uvar;
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct ( struct input_struct *uvar )
+{
+ myi = ((struct input_struct *) uvar)->i;
+ myc = ((struct input_struct *) uvar)->c;
+}
+
+BEGIN
+{
+ printf("Test translator with input type in parantheses");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl3.d
new file mode 100644
index 000000000000..6be8128a76a1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl3.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a translator without enclosing braces { }.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *uvar;
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < struct input_struct *uvar >
+ myi = ((struct input_struct *) uvar)->i;
+ myc = ((struct input_struct *) uvar)->c;
+;
+
+BEGIN
+{
+ printf("Test the translator definition without enclosing braces");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl4.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl4.d
new file mode 100644
index 000000000000..926f74c7ee9a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl4.d
@@ -0,0 +1,65 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a translator without terminating semi-colon (;).
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *uvar;
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < struct input_struct *uvar >
+{
+ myi = ((struct input_struct *) uvar)->i;
+ myc = ((struct input_struct *) uvar)->c;
+}
+
+translator struct output_struct < struct new_struct *newvar >
+{
+};
+
+
+BEGIN
+{
+ printf("Test translator declaration without terminating semi-colon");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_TYPE_MEMBER.NonExistentInput2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_TYPE_MEMBER.NonExistentInput2.d
new file mode 100644
index 000000000000..16deff89396f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_TYPE_MEMBER.NonExistentInput2.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a translator with a non-existent member
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *ivar;
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < struct input_struct *ivar >
+{
+ myi = ((struct input_struct *) ivar)->i;
+ myc = ((struct input_struct *) ivar)->nonexistent;
+};
+
+BEGIN
+{
+ printf("Testing the assignment of a non-existent input member");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_INCOMPAT.BadInputType1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_INCOMPAT.BadInputType1.d
new file mode 100644
index 000000000000..26cab45821a8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_INCOMPAT.BadInputType1.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a translator with a mismatch in types.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *uvar;
+
+struct output_struct {
+ int myi;
+ char *myc;
+};
+
+translator struct output_struct < struct input_struct *uvar >
+{
+ myi = ((struct input_struct *) uvar)->i;
+ myc = ((struct input_struct *) uvar)->c;
+};
+
+BEGIN
+{
+ printf("Translating against the rules of assignment operator");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_MEMB.NonExistentOutput2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_MEMB.NonExistentOutput2.d
new file mode 100644
index 000000000000..6d6eba1b93a4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_MEMB.NonExistentOutput2.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a translator with a non-existent output member.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *ivar;
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < struct input_struct *ivar >
+{
+ myi = ((struct input_struct *) ivar)->i;
+ yourc = ((struct input_struct *) ivar)->nonexistent;
+};
+
+BEGIN
+{
+ printf("Testing translation with non existent output member");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_NONE.BadTransDecl6.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_NONE.BadTransDecl6.d
new file mode 100644
index 000000000000..4cfabcea354c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_NONE.BadTransDecl6.d
@@ -0,0 +1,72 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * When xlate is used on a variable for which no translation exists a
+ * D_XLATE_NONE is thrown
+ *
+ * SECTION: Translators/Translate Operator
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct myinput_struct {
+ int i;
+ char c;
+};
+
+struct myoutput_struct {
+ int myi;
+ char myc;
+};
+
+translator struct myoutput_struct < struct myinput_struct *ivar >
+{
+ myi = ((struct myinput_struct *) ivar)->i;
+ myc = ((struct myinput_struct *) ivar)->c;
+
+};
+
+struct myinput_struct f;
+BEGIN
+{
+ f.i = 10;
+ f.c = 'c';
+
+ xlate < struct myoutput_struct >(f)->myi;
+ printf("Translate operator used without correct translator decl\n");
+ exit(0);
+}
+
+ERROR
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_REDECL.RepeatTransDecl.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_REDECL.RepeatTransDecl.d
new file mode 100644
index 000000000000..62f8482e334e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_REDECL.RepeatTransDecl.d
@@ -0,0 +1,67 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Redeclaring the same translation twice throws a D_XLATE_REDECL error.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int ii1;
+ char ic1;
+} *ivar1;
+
+struct output_struct {
+ int oi;
+ char oc;
+};
+
+
+translator struct output_struct < struct input_struct *ivar1 >
+{
+ oi = ((struct input_struct *) ivar1)->ii1;
+ oc = ((struct input_struct *) ivar1)->ic1;
+};
+
+translator struct output_struct < struct input_struct *ivar1 >
+{
+ oi = ((struct input_struct *) ivar1)->ii1;
+ oc = ((struct input_struct *) ivar1)->ic1;
+};
+
+
+BEGIN
+{
+ printf("Redeclaration of the same translation");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransDecl8.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransDecl8.d
new file mode 100644
index 000000000000..63786c7da673
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransDecl8.d
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * When the output type of the translator declaration is not a struct or
+ * union a D_XLATE_SOU is thrown.
+ *
+ * SECTION: Translators/Translator Declarations
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int ii;
+ char ic;
+};
+
+enum colors
+{
+ RED,
+ BLUE
+};
+
+translator enum colors < struct input_struct *ivar >
+{
+};
+
+BEGIN
+{
+ printf("Output type of translation is an enum");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransInt.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransInt.d
new file mode 100644
index 000000000000..6545569721bb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransInt.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * When the output type of the translator declaration is not a struct or
+ * union a D_XLATE_SOU is thrown.
+ *
+ * SECTION: Translators/Translator Declarations
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int ii;
+ char ic;
+};
+
+translator int < struct input_struct *ivar >
+{
+};
+
+BEGIN
+{
+ printf("Output type of translation is an int");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.NonExistentOutput1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.NonExistentOutput1.d
new file mode 100644
index 000000000000..1ebb94ccedbb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.NonExistentOutput1.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a translator with a non-existent output type.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *ivar;
+
+translator struct output_struct < struct input_struct *ivar >
+{
+ myi = ((struct input_struct *) ivar)->i;
+ myc = ((struct input_struct *) ivar)->nonexistent;
+};
+
+BEGIN
+{
+ printf("Translation with non existent output type struct");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.CircularTransDecl.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.CircularTransDecl.d
new file mode 100644
index 000000000000..58466f703a8c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.CircularTransDecl.d
@@ -0,0 +1,100 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test circular declaration of translations
+ *
+ * SECTION: Translators/ Translator Declarations
+ * SECTION: Translators/ Translate Operator
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+};
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < struct input_struct ivar >
+{
+ myi = ((struct input_struct ) ivar).i;
+ myc = ((struct input_struct ) ivar).c;
+};
+
+translator struct input_struct < struct output_struct uvar >
+{
+ i = ((struct output_struct ) uvar).myi;
+ c = ((struct output_struct ) uvar).myc;
+};
+
+struct input_struct f1;
+struct output_struct f2;
+
+BEGIN
+{
+ f1.i = 10;
+ f1.c = 'c';
+
+ f2.myi = 100;
+ f2.myc = 'd';
+
+ printf("Testing circular translations\n");
+ forwardi = xlate < struct output_struct > (f1).myi;
+ forwardc = xlate < struct output_struct > (f1).myc;
+ backwardi = xlate < struct input_struct > (f2).i;
+ backwardc = xlate < struct input_struct > (f2).c;
+
+ printf("forwardi: %d\tforwardc: %c\n", forwardi, forwardc);
+ printf("backwardi: %d\tbackwardc: %c", backwardi, backwardc);
+ exit(0);
+}
+
+BEGIN
+/(10 == forwardi) && ('c' == forwardc) && (100 == backwardi) &&
+ ('d' == backwardc)/
+{
+ exit(0);
+}
+
+BEGIN
+/(10 != forwardi) || ('c' != forwardc) || (100 != backwardi) ||
+ ('d' != backwardc)/
+{
+ exit(1);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.EmptyTransDecl.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.EmptyTransDecl.d
new file mode 100644
index 000000000000..5a292071f16f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.EmptyTransDecl.d
@@ -0,0 +1,79 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the empty declaration of a translator
+ *
+ * SECTION: Translators/ Translator Declarations
+ * SECTION: Translators/ Translate Operator
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *uvar;
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < struct input_struct uvar >
+{
+};
+
+struct input_struct in;
+struct output_struct ou;
+
+BEGIN
+{
+ in.i = 10;
+ in.c = 'c';
+
+ ou = xlate < struct output_struct > (in);
+
+ printf("ou.myi: %d\tou.myc: %c\n", ou.myi, ou.myc);
+}
+
+BEGIN
+/(0 != ou.myi) || (0 != ou.myc)/
+{
+ printf("Failed\n");
+ exit(1);
+}
+
+BEGIN
+/(0 == ou.myi) || (0 == ou.myc)/
+{
+ printf("Passed\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.ForwardTag.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.ForwardTag.d
new file mode 100644
index 000000000000..246a8d2b087e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.ForwardTag.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a forward tag using a translator definition.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *uvar;
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < struct callmewhatever *idontcare >
+{
+ myi = ((struct input_struct *) uvar)->i;
+ myc = ((struct input_struct *) uvar)->c;
+};
+
+BEGIN
+{
+ printf("This test defines a forward tag");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.InputAliasTrans.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.InputAliasTrans.d
new file mode 100644
index 000000000000..a562b39447bf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.InputAliasTrans.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * The input type of the tranlator declaration is an alias.
+ *
+ * SECTION: Translators/ Translator Declarations.
+ *
+ */
+
+#pragma D option quiet
+
+typedef struct input_struct {
+ int ii;
+ char ic;
+} input_t;
+
+struct output_struct {
+ int oi;
+ char oc;
+};
+
+
+translator struct output_struct < input_t *ivar >
+{
+ oi = ((input_t *) ivar)->ii;
+ oc = ((input_t *) ivar)->ic;
+};
+
+BEGIN
+{
+ printf("Input type is an alias");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.InputIntTrans.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.InputIntTrans.d
new file mode 100644
index 000000000000..e5159ed64f2e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.InputIntTrans.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of a translator the input type in the translator
+ * declaration being different from the values being assigned inside.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int i;
+ char c;
+} *uvar;
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < int idontcare >
+{
+ myi = ((struct input_struct *) uvar)->i;
+ myi = ((struct input_struct *) uvar)->c;
+};
+
+BEGIN
+{
+ printf("Input type to the translator decl is different from members");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.OutputAliasTrans.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.OutputAliasTrans.d
new file mode 100644
index 000000000000..cd4715319913
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.OutputAliasTrans.d
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * The output type is an alias.
+ *
+ * SECTION: Translators/ Translator Declarations.
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int ii;
+ char ic;
+};
+
+struct output_struct {
+ int oi;
+ char oc;
+};
+
+typedef struct output_struct output_t;
+
+
+translator output_t < struct input_struct *ivar >
+{
+ oi = ((struct input_struct *) ivar)->ii;
+ oc = ((struct input_struct *) ivar)->ic;
+};
+
+BEGIN
+{
+ printf("Output type is an alias");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.PartialDereferencing.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.PartialDereferencing.d
new file mode 100644
index 000000000000..ae532cc4d1c7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.PartialDereferencing.d
@@ -0,0 +1,85 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * If you dereference a single member of the translation input, then the
+ * compiler will generate the code corresponding to that member
+ *
+ * SECTION: Translators/ Translate Operator
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int ii;
+ char ic;
+};
+
+struct output_struct {
+ int oi;
+ char oc;
+};
+
+
+translator struct output_struct < struct input_struct ivar >
+{
+ oi = ((struct input_struct) ivar).ii;
+ oc = ((struct input_struct) ivar).ic;
+};
+
+struct output_struct out;
+struct input_struct in;
+
+BEGIN
+{
+ in.ii = 100;
+ in.ic = 'z';
+
+ printf("Translating only a part of the input struct\n");
+ out.oi = xlate < struct output_struct > (in).oi;
+
+ printf("out.oi: %d\t out.oc: %d\n", out.oi, out.oc);
+}
+
+BEGIN
+/(100 != out.oi) || (0 != out.oc)/
+{
+ exit(1);
+}
+
+BEGIN
+/(100 == out.oi) && (0 == out.oc)/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.PartialOutputTransDefn.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.PartialOutputTransDefn.d
new file mode 100644
index 000000000000..9be52a9fc65a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.PartialOutputTransDefn.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * A translator declaration may omit expressions for one or more members
+ * of the output type
+ *
+ * SECTION: Translators/Translator Declarations;
+ * Translators/Translate Operator
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int ii;
+ char ic;
+};
+
+struct output_struct {
+ int oi;
+ char oc;
+};
+
+
+translator struct output_struct < struct input_struct *ivar >
+{
+ oi = ((struct input_struct *) ivar)->ii;
+};
+
+BEGIN
+{
+ printf("Translating only a part of the input struct");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.ProcModelTrans.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.ProcModelTrans.d
new file mode 100644
index 000000000000..ff313eca185f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.ProcModelTrans.d
@@ -0,0 +1,53 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Use the translators in /usr/lib/dtrace/procfs.d
+ *
+ * SECTION: Translators/ Translator Declarations
+ * SECTION: Translators/ Translate Operator
+ * SECTION: Translators/Process Model Translators
+ *
+ */
+
+#pragma D option quiet
+
+proc_t *T;
+
+BEGIN
+{
+ mypr_addr = xlate < psinfo_t > (T).pr_addr;
+ printf("pr_addr: %d", mypr_addr);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.RepeatDeclaration.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.RepeatDeclaration.d
new file mode 100644
index 000000000000..a928c3e20e7f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.RepeatDeclaration.d
@@ -0,0 +1,71 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Reassign the members of the output struct using another translator
+ * input struct.
+ *
+ * SECTION: Translators/Translator Declarations
+ */
+
+#pragma D option quiet
+
+struct input_struct1 {
+ int ii1;
+ char ic1;
+} *ivar1;
+
+struct input_struct2 {
+ long ii2;
+ long ic2;
+} *ivar2;
+
+struct output_struct {
+ int oi;
+ char oc;
+};
+
+
+translator struct output_struct < struct input_struct1 *ivar1 >
+{
+ oi = ((struct input_struct1 *) ivar1)->ii1;
+ oc = ((struct input_struct1 *) ivar1)->ic1;
+};
+
+translator struct output_struct < struct input_struct2 *ivar2 >
+{
+ oi = ((struct input_struct2 *) ivar2)->ii2;
+ oc = ((struct input_struct2 *) ivar2)->ic2;
+};
+
+BEGIN
+{
+ printf("Reassignment of a struct's members with different input");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.SimultaneousTranslators.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.SimultaneousTranslators.d
new file mode 100644
index 000000000000..63cd72cafd39
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.SimultaneousTranslators.d
@@ -0,0 +1,71 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Assign the different members of the output of the translator using
+ * different translator declarations.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct1 {
+ int ii1;
+ char ic1;
+} *ivar1;
+
+struct input_struct2 {
+ int ii2;
+ char ic2;
+} *ivar2;
+
+struct output_struct {
+ int oi;
+ char oc;
+};
+
+
+translator struct output_struct < struct input_struct1 *ivar1 >
+{
+ oi = ((struct input_struct1 *) ivar1)->ii1;
+};
+
+translator struct output_struct < struct input_struct2 *ivar2 >
+{
+ oc = ((struct input_struct2 *) ivar2)->ic2;
+};
+
+BEGIN
+{
+ printf("Translate members of output with different input structs");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.StructureAssignment.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.StructureAssignment.d
new file mode 100644
index 000000000000..277d95fed290
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.StructureAssignment.d
@@ -0,0 +1,85 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * If the entire output is copied by means of a structure assignment, any
+ * members for which no translation expressions are defined will be filled
+ * with zeroes.
+ *
+ * SECTION: Translators/ Translate Operator
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int ii;
+ char ic;
+};
+
+struct output_struct {
+ int oi;
+ char oc;
+};
+
+
+translator struct output_struct < struct input_struct ivar >
+{
+ oi = ((struct input_struct) ivar).ii;
+};
+
+struct output_struct out;
+struct input_struct in;
+
+BEGIN
+{
+ in.ii = 100;
+ in.ic = 'z';
+
+ printf("Translating via struct assignment\n");
+ out = xlate < struct output_struct > (in);
+
+ printf("out.oi: %d\t out.oc: %d\n", out.oi, out.oc);
+}
+
+BEGIN
+/(100 != out.oi) || (0 != out.oc)/
+{
+ exit(1);
+}
+
+BEGIN
+/(100 == out.oi) && (0 == out.oc)/
+{
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh
new file mode 100644
index 000000000000..16eeda32916b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh
@@ -0,0 +1,62 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012 by Delphix. All rights reserved.
+#
+
+#
+# Test the output for stable translations.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -v -s /dev/stdin <<EOF
+
+#pragma D option quiet
+
+inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread);
+
+#pragma D attributes Stable/Stable/Common myinfo
+
+BEGIN
+{
+ this->a = myinfo->pr_flag;
+ exit(0);
+}
+
+BEGIN
+{
+ exit(1);
+}
+EOF
+
+exit $?
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out
new file mode 100644
index 000000000000..43c1adb1a54f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out
@@ -0,0 +1,14 @@
+
+Stability attributes for script /dev/stdin:
+
+ Minimum Probe Description Attributes
+ Identifier Names: Unstable
+ Data Semantics: Unstable
+ Dependency Class: Common
+
+ Minimum Statement Attributes
+ Identifier Names: Stable
+ Data Semantics: Stable
+ Dependency Class: Common
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh
new file mode 100644
index 000000000000..82070cde9237
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh
@@ -0,0 +1,60 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright (c) 2012 by Delphix. All rights reserved.
+#
+
+#
+# Test the output of unstable translations.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -v -s /dev/stdin <<EOF
+
+#pragma D option quiet
+
+inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread);
+
+BEGIN
+{
+ this->a = myinfo->pr_flag;
+ exit(0);
+}
+
+BEGIN
+{
+ exit(1);
+}
+EOF
+
+exit $?
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out
new file mode 100644
index 000000000000..f4b70f9573db
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out
@@ -0,0 +1,14 @@
+
+Stability attributes for script /dev/stdin:
+
+ Minimum Probe Description Attributes
+ Identifier Names: Unstable
+ Data Semantics: Unstable
+ Dependency Class: Common
+
+ Minimum Statement Attributes
+ Identifier Names: Private
+ Data Semantics: Private
+ Dependency Class: Unknown
+
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransNonPointer.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransNonPointer.d
new file mode 100644
index 000000000000..3ec81434e9a7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransNonPointer.d
@@ -0,0 +1,84 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Translate the input expression to output struct type
+ *
+ * SECTION: Translators/ Translator Declarations
+ * SECTION: Translators/ Translate Operator
+ *
+ */
+
+#pragma D option quiet
+
+struct myinput_struct {
+ int i;
+ char c;
+};
+
+struct myoutput_struct {
+ int myi;
+ char myc;
+};
+
+translator struct myoutput_struct < struct myinput_struct ivar >
+{
+ myi = ((struct myinput_struct ) ivar).i;
+ myc = ((struct myinput_struct ) ivar).c;
+
+};
+
+struct myinput_struct f;
+BEGIN
+{
+ f.i = 10;
+ f.c = 'c';
+
+ realmyi = xlate < struct myoutput_struct > (f).myi;
+ realmyc = xlate < struct myoutput_struct > (f).myc;
+}
+
+BEGIN
+/(10 != f.i) || ('c' != f.c)/
+{
+ exit(1);
+}
+
+BEGIN
+/(10 == f.i) && ('c' == f.c)/
+{
+ printf("realmyi: %d\n", realmyi);
+ printf("realmyc: %c\n", realmyc);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransOutputPointer.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransOutputPointer.d
new file mode 100644
index 000000000000..9069bf5d3aa5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransOutputPointer.d
@@ -0,0 +1,80 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Translate an input expression to a pointer to a struct
+ *
+ * SECTION: Translators/ Translator Declarations
+ * SECTION: Translators/ Translate Operator
+ *
+ */
+
+#pragma D option quiet
+
+struct myinput_struct {
+ int i;
+ char c;
+};
+
+struct myoutput_struct {
+ int myi;
+ char myc;
+};
+
+translator struct myoutput_struct < struct myinput_struct ivar >
+{
+ myi = ((struct myinput_struct ) ivar).i;
+ myc = ((struct myinput_struct ) ivar).c;
+
+};
+
+struct myinput_struct f;
+
+BEGIN
+{
+ f.i = 1203;
+ f.c = 'v';
+
+ realmyi = xlate < struct myoutput_struct *> (f)->myi;
+ realmyc = xlate < struct myoutput_struct *> (f)->myc;
+}
+
+BEGIN
+/(1203 != realmyi) || ('v' != realmyc)/
+{
+ printf("Failure");
+ exit(1);
+}
+
+BEGIN
+/(1203 == realmyi) && ('v' == realmyc)/
+{
+ printf("Success");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransPointer.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransPointer.d
new file mode 100644
index 000000000000..34d31d444e00
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransPointer.d
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the normal declaration of translators.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct myinput_struct {
+ int i;
+ char c;
+};
+
+struct myoutput_struct {
+ int myi;
+ char myc;
+};
+
+translator struct myoutput_struct < struct myinput_struct *ivar >
+{
+ myi = ((struct myinput_struct *) ivar)->i;
+ myc = ((struct myinput_struct *) ivar)->c;
+
+};
+
+struct myinput_struct *f;
+
+BEGIN
+{
+ printf("Good translator defn");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TranslateSelf.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TranslateSelf.d
new file mode 100644
index 000000000000..9059093f33cd
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TranslateSelf.d
@@ -0,0 +1,76 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the translation of a struct to itself.
+ *
+ * SECTION: Translators/ Translator Declarations.
+ * SECTION: Translators/ Translate operator.
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < struct output_struct uvar >
+{
+ myi = ((struct output_struct ) uvar).myi;
+ myc = ((struct output_struct ) uvar).myc;
+};
+
+struct output_struct out;
+struct output_struct outer;
+
+BEGIN
+{
+ out.myi = 1234;
+ out.myc = 'a';
+
+ printf("Test translation of a struct to itself\n");
+ outer = xlate < struct output_struct > (out);
+
+ printf("outer.myi: %d\t outer.myc: %c\n", outer.myi, outer.myc);
+}
+
+BEGIN
+/(1234 != outer.myi) || ('a' != outer.myc)/
+{
+ exit(1);
+}
+
+BEGIN
+/(1234 == outer.myi) && ('a' == outer.myc)/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.UnionInputTrans.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.UnionInputTrans.d
new file mode 100644
index 000000000000..fb2dcf0938d4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.UnionInputTrans.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test the declaration of translators with a union to be the input type.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+union input_union {
+ int i;
+ char c;
+} *ivar;
+
+struct output_struct {
+ int myi;
+ char myc;
+};
+
+translator struct output_struct < union input_union *ivar >
+{
+ myi = ((union input_union *) ivar)->i;
+ myc = ((union input_union *) ivar)->c;
+
+};
+
+BEGIN
+{
+ printf("Translator definition good\n");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.UnionOutputTrans.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.UnionOutputTrans.d
new file mode 100644
index 000000000000..3b2c588d2aa9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.UnionOutputTrans.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * The output type in a translator definition can be a union.
+ *
+ * SECTION: Translators/Translator Declarations
+ *
+ *
+ */
+
+#pragma D option quiet
+
+struct input_struct {
+ int ii;
+ char ic;
+} *ivar;
+
+union output_union {
+ int oi;
+ char oc;
+};
+
+translator union output_union < struct input_struct *ivar >
+{
+ oi = ((struct input_struct *) ivar)->ii;
+ oc = ((struct input_struct *) ivar)->ic;
+
+};
+
+BEGIN
+{
+ printf("Test translator definition with union output");
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_DECL_IDRED.DupTypeDef.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_DECL_IDRED.DupTypeDef.d
new file mode 100644
index 000000000000..47a9fdfed730
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_DECL_IDRED.DupTypeDef.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+/*
+ * ASSERTION: Cannot redeclare identifier using typedef.
+ *
+ * SECTION: Type and Constant Definitions/Typedef
+ *
+ * NOTES:
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+typedef int new_int;
+
+BEGIN
+{
+ exit(0);
+}
+
+typedef char new_int;
+
+END
+{
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.BadExistingTypedef.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.BadExistingTypedef.d
new file mode 100644
index 000000000000..38521a05161e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.BadExistingTypedef.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+/*
+ * ASSERTION:
+ * The typedef keyword throws an D_SYNTAX error when a bad existing type is
+ * used.
+ *
+ * SECTION: Type and Constant Definitions/Typedef
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+typedef pint new_int;
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.TypedefInClause.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.TypedefInClause.d
new file mode 100644
index 000000000000..0cb8cf733881
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.TypedefInClause.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+/*
+ * ASSERTION:
+ * The typedef keyword can be used outside of the probe clauses only.
+ *
+ * SECTION: Type and Constant Definitions/Typedef
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ typedef int new_int;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/tst.ChainTypedef.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/tst.ChainTypedef.d
new file mode 100644
index 000000000000..00810a52f8f8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/tst.ChainTypedef.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION: An identifier used to alias a primitive data type can be further
+ * used to typedef other aliases. typedef is transitive.
+ *
+ * SECTION: Type and Constant Definitions/Typedef
+ *
+ * NOTES:
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+typedef int new_int;
+typedef new_int latest_int;
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/tst.TypedefDataAssign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/tst.TypedefDataAssign.d
new file mode 100644
index 000000000000..4565be5593ad
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/tst.TypedefDataAssign.d
@@ -0,0 +1,118 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Test the typedef keyword with the different D data types. Declare different
+ * data types and test some of them with values.
+ *
+ * SECTION: Type and Constant Definitions/Typedef
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+typedef char new_char;
+typedef short new_short;
+typedef int new_int;
+typedef long new_long;
+typedef long long new_long_long;
+typedef int8_t new_int8;
+typedef int16_t new_int16;
+typedef int32_t new_int32;
+typedef int64_t new_int64;
+typedef intptr_t new_intptr;
+typedef uint8_t new_uint8;
+typedef uint16_t new_uint16;
+typedef uint32_t new_uint32;
+typedef uint64_t new_uint64;
+typedef uintptr_t new_uintptr;
+typedef float new_float;
+typedef double new_double;
+typedef long double new_long_double;
+
+typedef int * pointer;
+
+typedef struct {
+ char ch;
+ int in;
+ long lg;
+} new_struct;
+
+typedef union {
+ char ch;
+ int in;
+ long lg;
+} new_union;
+
+typedef enum {
+ RED,
+ GREEN,
+ BLUE
+} new_enum;
+
+new_char c;
+new_short s;
+new_int i;
+new_long l;
+new_long_long ll;
+new_int8 i8;
+new_int16 i16;
+new_int32 i32;
+new_int64 i64;
+new_intptr iptr;
+new_uint8 ui8;
+new_uint16 ui16;
+new_uint32 ui32;
+new_uint64 ui64;
+new_uintptr uiptr;
+new_float f;
+new_double d;
+new_long_double ld;
+new_struct ns;
+new_union nu;
+new_enum ne;
+
+pointer p;
+
+BEGIN
+{
+ ns.ch = 'c';
+ ns.in = 4;
+ ns.lg = 4;
+
+ nu.ch = 'd';
+ nu.in = 5;
+ nu.lg = 5;
+
+ i = 10;
+
+ printf("Struct: %c, %d, %d\n", ns.ch, ns.in, ns.lg);
+ printf("Union: %c, %d, %d\n", nu.ch, nu.in, nu.lg);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CAST_INVAL.badcast.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CAST_INVAL.badcast.d
new file mode 100644
index 000000000000..13d58eac9570
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CAST_INVAL.badcast.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Test an illegal cast - make sure dtrace catches it.
+ *
+ * SECTION: Aggregations/Clearing aggregations
+ *
+ *
+ */
+
+
+BEGIN
+{
+ (char)trace(`kmem_flags);
+ exit();
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CG_DYN.ResultDynType.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CG_DYN.ResultDynType.d
new file mode 100644
index 000000000000..74f2d7011dae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CG_DYN.ResultDynType.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * An expression cannot evaluate to result of dynamic type.
+ *
+ * SECTION: Errtag/D_CG_DYN
+ */
+
+#pragma D option quiet
+
+translator lwpsinfo_t < int i >
+{
+ pr_flag = i;
+};
+
+BEGIN
+{
+ xlate < lwpsinfo_t * > (0);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CHR_OFLOW.charconst.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CHR_OFLOW.charconst.d
new file mode 100644
index 000000000000..b158c3ca1c70
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CHR_OFLOW.charconst.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * verify the use of multi-char constants in single quotes
+ *
+ * SECTION: Types, Operators, and Expressions/Constants
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ char_bad = 'abc\fefghi';
+
+ printf("decimal value = %d", char_bad);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_BADCLASS.bad.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_BADCLASS.bad.d
new file mode 100644
index 000000000000..5064a5916ffa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_BADCLASS.bad.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invalid class names should be handled as an error.
+ *
+ * SECTION: Types, Operators, and Expressions/Data Types and Sizes
+ *
+ */
+
+register x;
+
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_CHARATTR.badtype3.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_CHARATTR.badtype3.d
new file mode 100644
index 000000000000..e1407bc45923
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_CHARATTR.badtype3.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invalid type name
+ *
+ * SECTION: Types, Operators, and Expressions/Data Types and Sizes
+ *
+ */
+
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ i = (char long)0;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype4.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype4.d
new file mode 100644
index 000000000000..e925a8607548
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype4.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invalid type name
+ *
+ * SECTION: Types, Operators, and Expressions/Data Types and Sizes
+ *
+ */
+
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ i = (char int)0;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype5.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype5.d
new file mode 100644
index 000000000000..b7a3b050af8e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype5.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invalid type name
+ *
+ * SECTION: Types, Operators, and Expressions/Data Types and Sizes
+ *
+ */
+
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ i = (double double)0;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENCONST.badeval.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENCONST.badeval.d
new file mode 100644
index 000000000000..5e1c19db4d46
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENCONST.badeval.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Attempt a bogus enum declaration by assigning a non-constant expression
+ * to an enumerator.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ */
+
+enum e {
+ TAG = "i am not an integer constant!"
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enoflow.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enoflow.d
new file mode 100644
index 000000000000..25e14a69f19f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enoflow.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Define an enumerations with a overflow value.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ */
+
+enum e {
+ toobig = 2147483648
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enuflow.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enuflow.d
new file mode 100644
index 000000000000..3709cb2f6a5b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enuflow.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Define an enumerations with a overflow value using negative value.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ */
+
+
+enum e {
+ toosmall = -2147483649
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_SCOPE.scopeop.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_SCOPE.scopeop.d
new file mode 100644
index 000000000000..ddac451f03f7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_SCOPE.scopeop.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Using the scope operator in a declaration will result in a
+ * D_DECL_SCOPE error.
+ *
+ * SECTION: Variables/External Variables
+ *
+ */
+
+#pragma D option quiet
+
+int `xyz;
+
+BEGIN
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_USELESS.baddec.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_USELESS.baddec.d
new file mode 100644
index 000000000000..7e3606e0b99d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_USELESS.baddec.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Bad external declarations will result in a D_DECL_USELESS
+ * error.
+ *
+ * SECTION: Types, Operators, and Expressions/Data Types and Sizes
+ *
+ */
+
+extern int;
+
+BEGIN
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_ACT.badcond.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_ACT.badcond.d
new file mode 100644
index 000000000000..b139f9e7ecee
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_ACT.badcond.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Tracing functions may not be second and third expressions
+ * of a conditional expr.
+ *
+ * SECTION: Types, Operators, and Expressions/Conditional Expressions
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ i = 1;
+ x = i == 0 ? trace(0): trace(1);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_ARITH.badoperand.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_ARITH.badoperand.d
new file mode 100644
index 000000000000..9fefb170fee6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_ARITH.badoperand.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Arithmetic operations with a +/- must be followed by an arithmetic
+ * type.
+ *
+ * SECTION: Types, Operators, and Expressions/Arithmetic Operators
+ *
+ */
+
+
+
+BEGIN
+{
+ p = 123 + -trace(0);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INCOMPAT.badassign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INCOMPAT.badassign.d
new file mode 100644
index 000000000000..04815a9d6689
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INCOMPAT.badassign.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Assignment operators do not supported on all types
+ *
+ * SECTION: Types, Operators, and Expressions/Assignment Operators
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ a = 3;
+ a += "foobar";
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badbitop.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badbitop.d
new file mode 100644
index 000000000000..a210ea15ea46
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badbitop.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Bitwise operators not supported on all types
+ *
+ * SECTION: Types, Operators, and Expressions/Bitwise Operators
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+/"char" & "foo"/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badshift.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badshift.d
new file mode 100644
index 000000000000..978df1d43f70
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badshift.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Shift operators not supported on all types
+ *
+ * SECTION: Types, Operators, and Expressions/Bitwise Operators
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ x = "char" << 2;
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badcond.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badcond.d
new file mode 100644
index 000000000000..2972ac239295
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badcond.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Conditional expressions not supported on all types
+ *
+ * SECTION: Types, Operators, and Expressions/Conditional Expressions
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ a = "boo";
+ c = "boo" ? "should": "fail";
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badincop.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badincop.d
new file mode 100644
index 000000000000..dfd5a315df13
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badincop.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Increment operators not supported on all types
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ a = "boo";
+ c = a++;
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badlogop.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badlogop.d
new file mode 100644
index 000000000000..4f084c779166
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badlogop.d
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Logical operators not supported on all types
+ *
+ * SECTION: Types, Operators, and Expressions/Logical Operators
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+/"char" && "foo"/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_PROTO_LEN.badcond1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_PROTO_LEN.badcond1.d
new file mode 100644
index 000000000000..8e327509685b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_PROTO_LEN.badcond1.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Conditional expressions do not accept tracing functions in
+ * the second or third expression
+ *
+ * SECTION: Types, Operators, and Expressions/Conditional Expressions
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ a = "boo";
+ c = a == "boo" ? printf("error\n") : trace();
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badenum.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badenum.d
new file mode 100644
index 000000000000..3b5377595cff
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badenum.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test a bogus enum declaration using an invalid identifer.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ */
+
+
+enum foo`bar
+{
+
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badid.d
new file mode 100644
index 000000000000..a28182cdcc29
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badid.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Identifiers cannot begin with a digit
+ *
+ * SECTION: Types, Operators, and Expressions/Identifier Names and Keywords
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+int 0abc;
+
+BEGIN
+{
+ 0abc = 5;
+ printf("0abc is %d", 0abc);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badstruct.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badstruct.d
new file mode 100644
index 000000000000..6c57d215c055
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badstruct.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Attempt a bogus struct declaration using an invalid identifer.
+ *
+ * SECTION: Structs and Unions/Structs
+ */
+
+struct foo`bar {
+
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype1.d
new file mode 100644
index 000000000000..4f6d1e321d02
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype1.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invalid type name
+ *
+ * SECTION: Types, Operators, and Expressions/Data Types and Sizes
+ *
+ */
+
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ i = (long short)0;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype2.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype2.d
new file mode 100644
index 000000000000..f40e95f1d814
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype2.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Invalid type name
+ *
+ * SECTION: Types, Operators, and Expressions/Data Types and Sizes
+ *
+ */
+
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ i = (short long)0;
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupenum.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupenum.d
new file mode 100644
index 000000000000..2282f2d885e9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupenum.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Attempt a bogus enum declaration that contains duplicated enumerator names.
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ */
+
+enum foo {
+ x = 3,
+ x = 4
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupstruct.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupstruct.d
new file mode 100644
index 000000000000..4102cd909ca5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupstruct.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Attempt a bogus struct declaration that contains duplicated member names.
+ *
+ * SECTION: Structs and Unions/Structs
+ */
+
+struct foo {
+ int x;
+ char x;
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d
new file mode 100644
index 000000000000..f4e7dfd14fd2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * An expression cannot evaluate to result of dynamic type.
+ *
+ * SECTION: Errtag/D_CG_DYN
+ */
+
+#pragma D option quiet
+
+translator lwpsinfo_t < kthread_t *T >
+{
+ pr_flag = T->t_flag;
+ pr_lwpid = T->t_tid;
+};
+
+BEGIN
+{
+ xlate < lwpsinfo_t * > (curthread);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.assignops.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.assignops.d
new file mode 100644
index 000000000000..6bc27b092dca
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.assignops.d
@@ -0,0 +1,82 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify assignment operators
+ *
+ * SECTION: Types, Operators, and Expressions/Assignment Operators
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ int_1 = 0x100;
+ int_2 = 0xf0f0;
+ int_3 = 0x0f0f;
+
+ intn = 0x1;
+
+ intn += int_1;
+ printf("%x\n", intn);
+ intn -= int_1;
+ printf("%x\n", intn);
+ intn *= int_1;
+ printf("%x\n", intn);
+ intn /= int_1;
+ printf("%x\n", intn);
+ intn %= int_1;
+ printf("%x\n", intn);
+ printf("\n");
+
+ intb = 0x0000;
+
+ intb |= (int_2 | intb);
+ printf("%x\n", intb);
+ intb &= (int_2 | int_3);
+ printf("%x\n", intb);
+ intb ^= (int_2 | int_3);
+ printf("%x\n", intb);
+ intb |= ~(intb);
+ printf("%x\n", intb);
+ printf("\n");
+
+ intb = int_2;
+
+ printf("%x\n", intb);
+ intb <<= 3;
+ printf("%x\n", intb);
+ intb >>= 3;
+ printf("%x\n", intb);
+
+ exit(0);
+
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.badshiftops.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.badshiftops.d
new file mode 100644
index 000000000000..ac3c014e6375
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.badshiftops.d
@@ -0,0 +1,49 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Negative values and values greater than the LH operand are
+ * accepted.
+ *
+ * SECTION: Types, Operators, and Expressions/Bitwise Operators
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ int_1 = 0xffff;
+
+ nint = int_1 << -6;
+ printf("%x %x\n", int_1, nint);
+ nint = int_1 << 100;
+ printf("%x %x\n", int_1, nint);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.basics.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.basics.d
new file mode 100644
index 000000000000..8e762d5bc152
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.basics.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test declaration processing of all the fundamental kinds of type
+ * declarations. Check their sizes.
+ *
+ * SECTION: Types, Operators, and Expressions/Data Types and Sizes
+ */
+
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("\nsizeof (char) = %u\n", sizeof (char));
+ printf("sizeof (signed char) = %u\n", sizeof (signed char));
+ printf("sizeof (unsigned char) = %u\n", sizeof (unsigned char));
+ printf("sizeof (short) = %u\n", sizeof (short));
+ printf("sizeof (signed short) = %u\n", sizeof (signed short));
+ printf("sizeof (unsigned short) = %u\n", sizeof (unsigned short));
+ printf("sizeof (int) = %u\n", sizeof (int));
+ printf("sizeof (signed int) = %u\n", sizeof (signed int));
+ printf("sizeof (unsigned int) = %u\n", sizeof (unsigned int));
+ printf("sizeof (long long) = %u\n", sizeof (long long));
+ printf("sizeof (signed long long) = %u\n", sizeof (signed long long));
+ printf("sizeof (unsigned long long) = %u\n",
+ sizeof (unsigned long long));
+ printf("sizeof (float) = %u\n", sizeof (float));
+ printf("sizeof (double) = %u\n", sizeof (double));
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.basics.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.basics.d.out
new file mode 100644
index 000000000000..fd05217f82e5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.basics.d.out
@@ -0,0 +1,16 @@
+
+sizeof (char) = 1
+sizeof (signed char) = 1
+sizeof (unsigned char) = 1
+sizeof (short) = 2
+sizeof (signed short) = 2
+sizeof (unsigned short) = 2
+sizeof (int) = 4
+sizeof (signed int) = 4
+sizeof (unsigned int) = 4
+sizeof (long long) = 8
+sizeof (signed long long) = 8
+sizeof (unsigned long long) = 8
+sizeof (float) = 4
+sizeof (double) = 8
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.bitops.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.bitops.d
new file mode 100644
index 000000000000..fc643bab9c34
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.bitops.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify relational operators with pointers
+ *
+ * SECTION: Types, Operators, and Expressions/Bitwise Operators
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ int_1 = 0xffff;
+ int_2 = 0;
+ int_3 = 0x0f0f;
+
+
+ printf("%x %x %x\n", int_1 & int_2, int_1 & int_3, int_2 & int_3);
+ printf("%x %x %x\n", int_1 | int_2, int_1 | int_3, int_2 | int_3);
+ printf("%x %x %x\n", int_1 ^ int_2, int_1 ^ int_3, int_2 ^ int_3);
+
+ printf("%x\n", int_1 & int_2 & int_3);
+ printf("%x\n", int_1 & int_2 ^ int_3);
+ printf("%x\n", int_1 & int_2 | int_3);
+ printf("%x\n", int_1 | int_2 & int_3);
+ printf("%x\n", int_1 | int_2 ^ int_3);
+ printf("%x\n", int_1 | int_2 | int_3);
+ printf("%x\n", int_1 ^ int_2 & int_3);
+ printf("%x\n", int_1 ^ int_2 ^ int_3);
+ printf("%x\n", int_1 ^ int_2 | int_3);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.charconstants.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.charconstants.d
new file mode 100644
index 000000000000..84aa61bfbc74
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.charconstants.d
@@ -0,0 +1,68 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * verify the use of char constants
+ *
+ * SECTION: Types, Operators, and Expressions/Constants
+ *
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ char_1 = 'a';
+ char_2 = '\"';
+ char_3 = '\"\ba';
+ char_4 = '\?';
+ char_5 = '\'';
+ char_6 = '\\';
+ char_7 = '\0103';
+ char_8 = '\x4E';
+ char_9 = '\c'; /* Note - this is not an escape sequence */
+ char_10 = 'ab\"d';
+ char_11 = 'a\bcdefgh';
+
+ printf("decimal value = %d; character value = %c\n", char_1, char_1);
+ printf("decimal value = %d; character value = %c\n", char_2, char_2);
+ printf("decimal value = %d; character value = %c\n", char_3, char_3);
+ printf("decimal value = %d; character value = %c\n", char_4, char_4);
+ printf("decimal value = %d; character value = %c\n", char_5, char_5);
+ printf("decimal value = %d; character value = %c\n", char_6, char_6);
+ printf("decimal value = %d; character value = %c\n", char_7, char_7);
+ printf("decimal value = %d; character value = %c\n", char_8, char_8);
+ printf("decimal value = %d; character value = %c\n", char_9, char_9);
+ printf("decimal value = %d; character value = %c\n", char_10, char_10);
+ printf("decimal value = %d\n", char_11);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.complex.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.complex.d
new file mode 100644
index 000000000000..a912670af2af
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.complex.d
@@ -0,0 +1,74 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Test a complex structure and verify that tracemem can be used to
+ * look at it.
+ *
+ * SECTION: Structs and Unions/Structs;
+ * Actions and Subroutines/tracemem()
+ */
+
+
+
+#pragma D option quiet
+
+struct s {
+ int i;
+ char c;
+ double d;
+ float f;
+ long l;
+ long long ll;
+ union sigval u;
+ enum uio_rw e;
+ struct vnode s;
+ struct s1 {
+ int i;
+ char c;
+ double d;
+ float f;
+ long l;
+ long long ll;
+ union sigval u;
+ enum uio_rw e;
+ struct vnode s;
+ } sx;
+ int a[2];
+ int *p;
+ int *ap[4];
+ int (*fp)();
+ int (*afp[2])();
+};
+
+BEGIN
+{
+ tracemem(curthread, sizeof (struct s));
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.condexpr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.condexpr.d
new file mode 100644
index 000000000000..fe23a73b720f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.condexpr.d
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * positive check conditional expressions
+ *
+ * SECTION: Types, Operators, and Expressions/Conditional Expressions
+ *
+ * NOTES: these tests are from the User's Guide
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ i = 0;
+ x = i == 0 ? "zero" : "non-zero";
+
+ c = 'd';
+ hexval = (c >= '0' && c <= '9') ? c - '0':
+ (c >= 'a' && c <= 'z') ? c + 10 - 'a' : c + 10 - 'A';
+}
+
+tick-1
+/x == "zero" && hexval == 13/
+{
+ exit(0);
+}
+
+tick-1
+/x != "zero" || hexval != 13/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d
new file mode 100644
index 000000000000..dae3d9041ed3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
+/*
+ * Make sure we can scope types with modifiers.
+ */
+
+BEGIN
+{
+ trace((D`int *)0);
+ trace((const D`int *)0);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.constants.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.constants.d
new file mode 100644
index 000000000000..101bb8b8281f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.constants.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * verify that integer constants can be written in decimal
+ * octal or hexadecimal
+ *
+ * SECTION: Types, Operators, and Expressions/Constants
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ decimal = 12345;
+ octal = 012345;
+ hexadecimal_1 = 0x12345;
+ hexadecimal_2 = 0X12345;
+
+ printf("%d %d %d %d", decimal, octal, hexadecimal_1, hexadecimal_2);
+ printf("%d %o %x %x", decimal, octal, hexadecimal_1, hexadecimal_2);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.conv.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.conv.d
new file mode 100644
index 000000000000..9020424572b3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.conv.d
@@ -0,0 +1,109 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * positive type conversion checks
+ *
+ * SECTION: Types, Operators, and Expressions/Type Conversions
+ *
+ * NOTES: not all type conversions are checked. A lot of this section
+ * is tested within other tests.
+ */
+
+#pragma D option quiet
+
+unsigned int i;
+char c;
+short s;
+long l;
+long long ll;
+
+BEGIN
+{
+/* char -> int */
+ c = 'A';
+ i = c;
+ printf("c is %c i is %d\n", c, i);
+
+/* int -> char */
+
+ i = 1601;
+ c = i;
+ printf("i is %d c is %c\n", i, c);
+
+/* char -> short */
+ c = 'A';
+ s = c;
+ printf("c is %c s is %d\n", c, s);
+
+/* short -> char */
+
+ s = 1601;
+ c = s;
+ printf("s is %d c is %c\n", s, c);
+
+/* int -> short */
+
+ i = 1601;
+ s = i;
+ printf("i is %d s is %d\n", i, s);
+
+/* short -> int */
+
+ s = 1601;
+ i = s;
+ printf("s is %d i is %d\n", s, i);
+
+/* int -> long long */
+
+ i = 4294967295;
+ ll = i;
+ printf("i is %d ll is %x\n", i, ll);
+
+/* long long -> int */
+
+ ll = 8589934591;
+ i = ll;
+ printf("ll is %d i is %x\n", ll, i);
+
+/* char -> long long */
+
+ c = 'A';
+ ll = c;
+ printf("c is %c ll is %x\n", c, ll);
+
+/* long long -> char */
+
+ ll = 8589934401;
+ c = ll;
+ printf("ll is %x c is %c\n", ll, c);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.enum.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.enum.d
new file mode 100644
index 000000000000..49a97bff6f3e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.enum.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Positive enumeration test
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ */
+
+#pragma D option quiet
+
+enum my_enum {
+ zero,
+ one = 1,
+ two,
+ three,
+ four = 4,
+ minimum = -2147483648,
+ maximum = 2147483647
+};
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.intincop.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.intincop.d
new file mode 100644
index 000000000000..77eb7025978a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.intincop.d
@@ -0,0 +1,70 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify increment operator using integers
+ *
+ * SECTION: Type and Constant Definitions/Enumerations
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ int_orig = 100;
+ int_pos = 100+1;
+ int_neg = 100-1;
+
+ int_pos_before = ++int_orig;
+ int_orig = 100;
+ int_neg_before = --int_orig;
+ int_orig = 100;
+ int_pos_after = int_orig++;
+ int_orig = 100;
+ int_neg_after = int_orig--;
+ int_orig = 100;
+
+}
+
+tick-1
+/int_pos_before == int_pos && int_neg_before == int_neg &&
+ int_pos_after == int_orig && int_pos_after == int_orig/
+{
+ exit(0);
+}
+
+
+tick-1
+/int_pos_before != int_pos || int_neg_before != int_neg ||
+ int_pos_after != int_orig || int_pos_after != int_orig/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.intops.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.intops.d
new file mode 100644
index 000000000000..a374480440ae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.intops.d
@@ -0,0 +1,70 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify relational operators with integers
+ *
+ * SECTION: Types, Operators, and Expressions/Relational Operators;
+ * Types, Operators, and Expressions/Precedence
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ int_1 = 0x100;
+ int_2 = 0x101;
+ int_3 = 0x99;
+}
+
+tick-1
+/int_1 >= int_2 || int_2 <= int_1 || int_1 == int_2/
+{
+ printf("Shouldn't end up here (1)\n");
+ printf("int_1 = %x int_2 = %x int_3 = %x\n",
+ (int) int_1, (int) int_2, (int) int_3);
+ exit(1);
+}
+
+tick-1
+/int_3 > int_1 || int_1 < int_3 || int_3 == int_1/
+{
+ printf("Shouldn't end up here (2)\n");
+ printf("int_1 = %x int_2 = %x int_3 = %x\n",
+ (int) int_1, (int) int_2, (int) int_3);
+ exit(1);
+}
+
+tick-1
+/int_2 > int_3 && int_1 < int_2 ^^ int_3 == int_2 && !(int_1 != int_2)/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.inttypes.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.inttypes.d
new file mode 100644
index 000000000000..80bfa1f2975b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.inttypes.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * Verify integer type aliases
+ *
+ * SECTION: Types, Operators, and Expressions/Data Types and Sizes
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+BEGIN
+{
+ printf("sizeof (int8_t) = %u\n", sizeof (int8_t));
+ printf("sizeof (int16_t) = %u\n", sizeof (int16_t));
+ printf("sizeof (int32_t) = %u\n", sizeof (int32_t));
+ printf("sizeof (int64_t) = %u\n", sizeof (int64_t));
+ printf("sizeof (intptr_t) = %u\n", sizeof (intptr_t));
+ printf("sizeof (uint8_t) = %u\n", sizeof (uint8_t));
+ printf("sizeof (uint16_t) = %u\n", sizeof (uint16_t));
+ printf("sizeof (uint32_t) = %u\n", sizeof (uint32_t));
+ printf("sizeof (uint64_t) = %u\n", sizeof (uint64_t));
+ printf("sizeof (uintptr_t) = %u\n", sizeof (uintptr_t));
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.ptrincop.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.ptrincop.d
new file mode 100644
index 000000000000..0fdd561a8208
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.ptrincop.d
@@ -0,0 +1,72 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify increment/decrement operator using pointers
+ *
+ * SECTION: Types, Operators, and Expressions/Increment and Decrement Operators
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ ptr_orig = &`kmem_flags;
+ ptr_pos = &`kmem_flags+1;
+ ptr_neg = &`kmem_flags-1;
+
+ ptr_pos_before = ++ptr_orig;
+ ptr_orig = &`kmem_flags;
+ ptr_neg_before = --ptr_orig;
+
+ ptr_orig = &`kmem_flags;
+ ptr_pos_after = ptr_orig++;
+ ptr_orig = &`kmem_flags;
+ ptr_neg_after = ptr_orig--;
+ ptr_orig = &`kmem_flags;
+
+}
+
+tick-1
+/ptr_pos_before == ptr_pos && ptr_neg_before == ptr_neg &&
+ ptr_pos_after == ptr_orig && ptr_pos_after == ptr_orig/
+{
+ exit(0);
+}
+
+
+tick-1
+/ptr_pos_before != ptr_pos || ptr_neg_before != ptr_neg ||
+ ptr_pos_after != ptr_orig || ptr_pos_after != ptr_orig/
+{
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.ptrops.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.ptrops.d
new file mode 100644
index 000000000000..d4144b09ce21
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.ptrops.d
@@ -0,0 +1,71 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify relational operators with pointers
+ *
+ * SECTION: Types, Operators, and Expressions/Relational Operators;
+ * Types, Operators, and Expressions/Logical Operators;
+ * Types, Operators, and Expressions/Precedence
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ ptr_1 = &`kmem_flags;
+ ptr_2 = (&`kmem_flags) + 1;
+ ptr_3 = (&`kmem_flags) - 1 ;
+}
+
+tick-1
+/ptr_1 >= ptr_2 || ptr_2 <= ptr_1 || ptr_1 == ptr_2/
+{
+ printf("Shouldn't end up here (1)\n");
+ printf("ptr_1 = %x ptr_2 = %x ptr_3 = %x\n",
+ (int) ptr_1, (int) ptr_2, (int) ptr_3);
+ exit(1);
+}
+
+tick-1
+/ptr_3 > ptr_1 || ptr_1 < ptr_3 || ptr_3 == ptr_1/
+{
+ printf("Shouldn't end up here (2)\n");
+ printf("ptr_1 = %x ptr_2 = %x ptr_3 = %x\n",
+ (int) ptr_1, (int) ptr_2, (int) ptr_3);
+ exit(1);
+}
+
+tick-1
+/ptr_3 > ptr_2 || ptr_1 < ptr_2 ^^ ptr_3 == ptr_2 && !(ptr_1 != ptr_2)/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.relenum.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.relenum.d
new file mode 100644
index 000000000000..8fa6d585d3ae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.relenum.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify relational operators with enumerations
+ *
+ * SECTION: Types, Operators, and Expressions/Relational Operators
+ *
+ */
+
+#pragma D option quiet
+
+enum numbers_1 {
+ zero,
+ one,
+ two
+};
+
+enum numbers_2 {
+ null,
+ first,
+ second
+};
+
+tick-1
+/zero >= one || second <= first || zero == second/
+{
+ printf("Shouldn't end up here (1)\n");
+ printf("zero = %d; one = %d; two = %d", zero, one, two);
+ printf("null = %d; first = %d; second = %d", null, first, second);
+ exit(1);
+}
+
+tick-1
+/second < one || two > second || null == first/
+{
+ printf("Shouldn't end up here (2)\n");
+ printf("zero = %d; one = %d; two = %d", zero, one, two);
+ printf("null = %d; first = %d; second = %d", null, first, second);
+ exit(1);
+}
+
+tick-1
+/first < two && second > one && one != two && zero != first/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.relstring.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.relstring.d
new file mode 100644
index 000000000000..9e9ef29d4c8e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.relstring.d
@@ -0,0 +1,70 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify relational operators with strings
+ *
+ * SECTION: Types, Operators, and Expressions/Relational Operators
+ *
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ string_1 = "abcde";
+ string_2 = "aabcde";
+ string_3 = "abcdef";
+}
+
+tick-1
+/string_1 <= string_2 || string_2 >= string_1 || string_1 == string_2/
+{
+ printf("Shouldn't end up here (1)\n");
+ printf("string_1 = %s string_2 = %s string_3 = %s\n",
+ string_1, string_2, string_3);
+ exit(1);
+}
+
+tick-1
+/string_3 < string_1 || string_1 > string_3 || string_3 == string_1/
+{
+ printf("Shouldn't end up here (2)\n");
+ printf("string_1 = %s string_2 = %s string_3 = %s n",
+ string_1, string_2, string_3);
+ exit(1);
+}
+
+tick-1
+/string_3 > string_1 && string_1 > string_2 &&
+ string_1 != string_2 && string_2 != string_3/
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.shiftops.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.shiftops.d
new file mode 100644
index 000000000000..a26023850f66
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.shiftops.d
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify shift operators
+ *
+ * SECTION: Types, Operators, and Expressions/Bitwise Operators;
+ * Types, Operators, and Expressions/Precedence
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ int_1 = 0xffff;
+
+ nint = (((((((((((int_1 << 2 >> 2) << 3 >> 3) << 4 >> 4) << 5 >> 5)
+ << 6 >> 6) << 7 >> 7) << 8 >>8) << 9 >> 9) << 10 >> 10)
+ << 11 >> 11) << 12 >> 12);
+
+}
+
+tick-1
+/nint != int_1/
+{
+ printf("Unexpected error nint = %x, expected %x\n", nint, int_1);
+ exit(1);
+}
+
+tick-1
+/nint == int_1/
+{
+ exit(0);
+
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.stringconstants.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.stringconstants.d
new file mode 100644
index 000000000000..9fa080569309
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.stringconstants.d
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * verify the use of char type
+ *
+ * SECTION: Types, Operators, and Expressions/Constants
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+string string_1;
+
+BEGIN
+{
+ string_1 = "abcd\n\n\nefg";
+ string_2 = "abc\"\t\044\?\x4D";
+ string_3 = "\?\\\'\"\0";
+
+ printf("string_1 = %s\n", string_1);
+ printf("string_2 = %s\n", string_2);
+ printf("string_3 = %s\n", string_3);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.struct.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.struct.d
new file mode 100644
index 000000000000..86610f63fe13
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.struct.d
@@ -0,0 +1,84 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Declare a dynamic type and then use it to copyin the first 3 environment
+ * variable pointers from the current process.
+ *
+ * SECTION: Structs and Unions/Structs;
+ * Actions and Subroutines/copyin();
+ * Actions and Subroutines/copyinstr();
+ * Variables/External Variables
+ *
+ * NOTES:
+ * This test program declares a dynamic type and then uses it to copyin the
+ * first three environment variable pointers from the current process. We
+ * then use the dynamic type to access the result of our copyin(). The
+ * special "D" module type scope is also tested.
+ */
+
+#pragma D option quiet
+
+struct env_vars_32 {
+ uint32_t e1;
+ uint32_t e2;
+ uint32_t e3;
+};
+
+struct env_vars_64 {
+ uint64_t e1;
+ uint64_t e2;
+ uint64_t e3;
+};
+
+BEGIN
+/curpsinfo->pr_dmodel == PR_MODEL_ILP32/
+{
+ e32 = (struct D`env_vars_32 *)
+ copyin(curpsinfo->pr_envp, sizeof (struct D`env_vars_32));
+
+ printf("e1 = \"%s\"\n", stringof(copyinstr(e32->e1)));
+ printf("e2 = \"%s\"\n", stringof(copyinstr(e32->e2)));
+ printf("e3 = \"%s\"\n", stringof(copyinstr(e32->e3)));
+
+ exit(0);
+}
+
+BEGIN
+/curpsinfo->pr_dmodel == PR_MODEL_LP64/
+{
+ e64 = (struct D`env_vars_64 *)
+ copyin(curpsinfo->pr_envp, sizeof (struct D`env_vars_64));
+
+ printf("e1 = \"%s\"\n", stringof(copyinstr(e64->e1)));
+ printf("e2 = \"%s\"\n", stringof(copyinstr(e64->e2)));
+ printf("e3 = \"%s\"\n", stringof(copyinstr(e64->e3)));
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.typedef.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.typedef.d
new file mode 100644
index 000000000000..aabfc9ba78d4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.typedef.d
@@ -0,0 +1,85 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Declares a dynamic type and then uses it to copyin the first three
+ * environment variable pointers from the current process.
+ *
+ * SECTION: Structs and Unions/Structs;
+ * Actions and Subroutines/copyin();
+ * Actions and Subroutines/copyinstr();
+ * Variables/External Variables
+ *
+ * NOTES:
+ * This test program declares a dynamic type and then uses it to copyin the
+ * first three environment variable pointers from the current process. We
+ * then use the dynamic type to access the result of our copyin(). The
+ * special "D" module type scope is also tested. This is similar to our
+ * struct declaration test but here we use a typedef.
+ */
+
+#pragma D option quiet
+
+typedef struct env_vars_32 {
+ uint32_t e1;
+ uint32_t e2;
+ uint32_t e3;
+} env_vars_32_t;
+
+typedef struct env_vars_64 {
+ uint64_t e1;
+ uint64_t e2;
+ uint64_t e3;
+} env_vars_64_t;
+
+BEGIN
+/curpsinfo->pr_dmodel == PR_MODEL_ILP32/
+{
+ e32 = (D`env_vars_32_t *)
+ copyin(curpsinfo->pr_envp, sizeof (D`env_vars_32_t));
+
+ printf("e1 = \"%s\"\n", stringof(copyinstr(e32->e1)));
+ printf("e2 = \"%s\"\n", stringof(copyinstr(e32->e2)));
+ printf("e3 = \"%s\"\n", stringof(copyinstr(e32->e3)));
+
+ exit(0);
+}
+
+BEGIN
+/curpsinfo->pr_dmodel == PR_MODEL_LP64/
+{
+ e64 = (D`env_vars_64_t *)
+ copyin(curpsinfo->pr_envp, sizeof (D`env_vars_64_t));
+
+ printf("e1 = \"%s\"\n", stringof(copyinstr(e64->e1)));
+ printf("e2 = \"%s\"\n", stringof(copyinstr(e64->e2)));
+ printf("e3 = \"%s\"\n", stringof(copyinstr(e64->e3)));
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.unaryop.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.unaryop.d
new file mode 100644
index 000000000000..b9938e4ff18d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.unaryop.d
@@ -0,0 +1,50 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify unary operator
+ *
+ * SECTION: Types, Operators, and Expressions/Bitwise Operators
+ */
+
+#pragma D option quiet
+
+
+BEGIN
+{
+ int_1 = 0xffff;
+ int_2 = 0;
+ int_3 = 0x0f0f;
+
+ printf("%x %x %x\n", int_1, int_2, int_3);
+ printf("%x %x %x\n", ~int_1, ~int_2, ~int_3);
+ printf("%x %x %x\n", ~~int_1, ~~int_2, ~~int_3);
+ printf("%x %x %x\n", ~~~int_1, ~~~int_2, ~~~int_3);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_ADDROF_VAR.UnionPointer.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_ADDROF_VAR.UnionPointer.d
new file mode 100644
index 000000000000..0a292cdef20d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_ADDROF_VAR.UnionPointer.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Trying to access the members of a user defined union by means of
+ * a pointer to it should throw a D_ADDROF_VAR compiler error.
+ *
+ * SECTION: Structs and Unions/Pointers to Structs
+ *
+ */
+
+#pragma D option quiet
+
+union record {
+ int position;
+ int content;
+
+};
+
+union record var;
+union record *ptr;
+
+BEGIN
+{
+
+ var.position = 1;
+ var.content = 'a';
+
+ ptr = &var;
+
+ printf("ptr->position: %d\tptr->content: %c\n",
+ ptr->position, ptr->content);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon.d
new file mode 100644
index 000000000000..4adb36e94199
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon.d
@@ -0,0 +1,69 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Combining multiple union definitions in a single line should throw a
+ * compiler error.
+ *
+ * SECTION: Structs and Unions/Unions
+ *
+ */
+
+#pragma D option quiet
+
+union record {
+ int position;
+ char content;
+}
+
+
+union pirate {
+ int position;
+ char content;
+};
+
+union superStruct super;
+union record rec;
+union pirate pir;
+
+BEGIN
+{
+ rec.content = 'a';
+ rec.position = 1;
+
+ pir.content = 'b';
+ pir.position = 2;
+
+ printf(
+ "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d",
+ rec.content, rec.position, pir.content, pir.position);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon1.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon1.d
new file mode 100644
index 000000000000..5506a97645af
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon1.d
@@ -0,0 +1,68 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Combining multiple union definitions in a single line should throw a
+ * compiler error.
+ *
+ * SECTION: Structs and Unions/Unions
+ *
+ */
+
+#pragma D option quiet
+
+union record {
+ int position;
+ char content;
+};
+
+
+union pirate {
+ int position;
+ char content;
+}
+
+union record rec;
+union pirate pir;
+
+BEGIN
+{
+ rec.content = 'a';
+ rec.position = 1;
+
+ pir.content = 'b';
+ pir.position = 2;
+
+ printf(
+ "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d",
+ rec.content, rec.position, pir.content, pir.position);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.circular.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.circular.d
new file mode 100644
index 000000000000..ae6e647f5b8d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.circular.d
@@ -0,0 +1,65 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * A circular definition of unions (two unions defining each other as
+ * members) should throw an error at compile time.
+ *
+ * SECTION: Structs and Unions/Unions
+ *
+ */
+
+#pragma D option quiet
+
+union record {
+ union pirate p;
+ int position;
+ char content;
+};
+
+
+union pirate {
+ union record r;
+ int position;
+ char content;
+};
+
+union record rec;
+union pirate pir;
+
+BEGIN
+{
+ rec.position = 0;
+ rec.content = 'a';
+ printf(
+ "rec.position: %d\nrec.content: %c\n", rec.position, rec.content);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.order.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.order.d
new file mode 100644
index 000000000000..9e2ec69f4b7f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.order.d
@@ -0,0 +1,69 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * When two unions are defined such that one of them contains the other, the
+ * inner union has to be defined first.
+ *
+ * SECTION: Structs and Unions/Unions
+ *
+ */
+
+#pragma D option quiet
+
+
+union record {
+ union pirate p;
+ int position;
+ char content;
+};
+
+union pirate {
+ int position;
+ char content;
+};
+
+union record rec;
+union pirate pir;
+
+BEGIN
+{
+ rec.content = 'y';
+ rec.position = 2;
+
+ pir.content = 'z';
+ pir.position = 26;
+
+ printf(
+ "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d",
+ rec.content, rec.position, pir.content, pir.position);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.recursive.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.recursive.d
new file mode 100644
index 000000000000..2a86b9cd3795
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.recursive.d
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Recursive naming of unions should produce compiler error.
+ *
+ * SECTION: Structs and Unions/Unions
+ *
+ */
+
+#pragma D option quiet
+
+union record {
+ union record rec;
+ int position;
+ char content;
+};
+
+union record r1;
+union record r2;
+
+BEGIN
+{
+ r1.position = 1;
+ r1.content = 'a';
+
+ r2.position = 2;
+ r2.content = 'b';
+
+ printf("r1.position: %d\nr1.content: %c\n", r1.position, r1.content);
+ printf("r2.position: %d\nr2.content: %c\n", r2.position, r2.content);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.simple.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.simple.d
new file mode 100644
index 000000000000..781d72666764
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.simple.d
@@ -0,0 +1,58 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Declaring an inner union without defining it else where should throw
+ * a compiler error.
+ *
+ * SECTION: Structs and Unions/Unions
+ *
+ */
+#pragma D option quiet
+
+
+union record {
+ union pirate p;
+ int position;
+ char content;
+};
+
+
+union record rec;
+
+BEGIN
+{
+ rec.position = 0;
+ rec.content = 'a';
+ printf("rec.position: %d\nrec.content: %c\n",
+ rec.position, rec.content);
+
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_PROTO_ARG.DupUnionAssoc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_PROTO_ARG.DupUnionAssoc.d
new file mode 100644
index 000000000000..f91874124079
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_PROTO_ARG.DupUnionAssoc.d
@@ -0,0 +1,80 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Declaring an associative array with a union to be its key type and trying to
+ * index with another union having the same composition throws an error.
+ *
+ * SECTION: Structs and Unions/Unions
+ *
+ */
+
+#pragma D option quiet
+
+union record {
+ int position;
+ char content;
+};
+
+union pirate {
+ int position;
+ char content;
+};
+
+union record r1;
+union record r2;
+union pirate p1;
+union pirate p2;
+
+BEGIN
+{
+ r1.position = 1;
+ r1.content = 'a';
+
+ r2.position = 2;
+ r2.content = 'b';
+
+ p1.position = 1;
+ p1.content = 'a';
+
+ p2.position = 2;
+ p2.content = 'b';
+
+ assoc_array[r1] = 1000;
+ assoc_array[r2] = 2000;
+ assoc_array[p1] = 3333;
+ assoc_array[p2] = 4444;
+
+ printf("assoc_array[r1]: %d\n", assoc_array[r1]);
+ printf("assoc_array[r2]: %d\n", assoc_array[r2]);
+ printf("assoc_array[p1]: %d\n", assoc_array[p1]);
+ printf("assoc_array[p2]: %d\n", assoc_array[p2]);
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionAssoc.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionAssoc.d
new file mode 100644
index 000000000000..882b6ae05df9
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionAssoc.d
@@ -0,0 +1,71 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * When a union is used as a key for an associative array, the key is formed
+ * by using the values of the members of the union variable and not the
+ * address of the union variable.
+ *
+ * SECTION: Structs and Unions/Unions
+ *
+ */
+
+#pragma D option quiet
+
+union record {
+ int position;
+ char content;
+};
+
+union record r1;
+union record r2;
+
+BEGIN
+{
+ r1.position = 1;
+ r1.content = 'a';
+
+ r2.position = 1;
+ r2.content = 'a';
+
+ assoc_array[r1] = 1000;
+ assoc_array[r2] = 2000;
+
+ printf("assoc_array[r1]: %d\n", assoc_array[r1]);
+ printf("assoc_array[r2]: %d\n", assoc_array[r2]);
+
+ exit(0);
+}
+
+END
+/assoc_array[r1] != assoc_array[r2]/
+{
+ printf("Error");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionDataTypes.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionDataTypes.d
new file mode 100644
index 000000000000..d5d292d1728f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionDataTypes.d
@@ -0,0 +1,132 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Declaration of the different data types within a union and
+ * their definitions in a later clause should work fine.
+ *
+ * SECTION: Structs and Unions/Unions
+ *
+ * NOTES: The floats, doubles and strings have not been implemented yet.
+ * When they do, appropriate lines in the code below should be uncommented.
+ * Similarly, the lines with the kmem_flags pointer assignment should be
+ * uncommented when the issues pertaining to it are clarified.
+ *
+ */
+
+#pragma D option quiet
+
+union record {
+ char new_char;
+ short new_short;
+ int new_int;
+ long new_long;
+ long long new_long_long;
+ int8_t new_int8;
+ int16_t new_int16;
+ int32_t new_int32;
+ int64_t new_int64;
+ intptr_t new_intptr;
+ uint8_t new_uint8;
+ uint16_t new_uint16;
+ uint32_t new_uint32;
+ uint64_t new_uint64;
+ uintptr_t new_uintptr;
+
+ /*float new_float;
+ double new_double;
+ long double new_long_double;
+
+ string new_string;
+ */
+
+ struct {
+ char ch;
+ int in;
+ long lg;
+ } new_struct;
+
+ union {
+ char ch;
+ int in;
+ long lg;
+ } new_union;
+
+enum {
+ RED,
+ GREEN,
+ BLUE
+} new_enum;
+
+
+ int *pointer;
+} var;
+
+/*
+ var.pointer = &`kmem_flags;
+*/
+BEGIN
+{
+ var.new_char = 'c';
+ var.new_short = 10;
+ var.new_int = 100;
+ var.new_long = 1234567890;
+ var.new_long_long = 1234512345;
+ var.new_int8 = 'p';
+ var.new_int16 = 20;
+ var.new_int32 = 200;
+ var.new_int64 = 2000000;
+ var.new_intptr = 0x12345;
+ var.new_uint8 = 'q';
+ var.new_uint16 = 30;
+ var.new_uint32 = 300;
+ var.new_uint64 = 3000000;
+ var.new_uintptr = 0x67890;
+
+ /* var.new_float = 1.23456;
+ var.new_double = 2.34567890;
+ var.new_long_double = 3.567890123;
+
+ var.new_string = "hello";
+ */
+
+ /*
+ var.pointer = &`kmem_flags;
+ */
+
+ var.new_struct.ch = 'c';
+ var.new_struct.in = 4;
+ var.new_struct.lg = 4;
+
+ var.new_union.ch = 'd';
+ var.new_union.in = 5;
+ var.new_union.lg = 5;
+
+
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionInside.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionInside.d
new file mode 100644
index 000000000000..9569002b1c92
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionInside.d
@@ -0,0 +1,85 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * Verify the nested behavior of unions.
+ *
+ * SECTION: Structs and Unions/Unions
+ *
+ */
+#pragma D option quiet
+
+union InnerMost {
+ int position;
+ char content;
+};
+
+union InnerMore {
+ union InnerMost IMost;
+ int dummy_More;
+};
+
+union Inner {
+ union InnerMore IMore;
+ int dummy_More;
+};
+
+union Outer {
+ union Inner I;
+ int dummy_More;
+};
+
+union OuterMore {
+ union Outer O;
+ int dummy_More;
+};
+
+union OuterMost {
+ union OuterMore OMore;
+ int dummy_More;
+} OMost;
+
+
+BEGIN
+{
+
+ OMost.OMore.O.I.IMore.IMost.position = 5;
+ OMost.OMore.O.I.IMore.IMost.content = 'e';
+
+ printf("OMost.OMore.O.I.IMore.IMost.content: %c\n",
+ OMost.OMore.O.I.IMore.IMost.content);
+
+ exit(0);
+}
+
+END
+/'e' != OMost.OMore.O.I.IMore.IMost.content/
+{
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile
new file mode 100644
index 000000000000..77fe870aa91f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile
@@ -0,0 +1,13 @@
+all: main
+
+main: main.o prov.o
+ $(CC) -o main main.o prov.o
+
+main.o: main.c prov.h
+ $(CC) -c main.c
+
+prov.h: prov.d
+ /usr/sbin/dtrace -h -s prov.d
+
+prov.o: prov.d main.o
+ /usr/sbin/dtrace -G -32 -s prov.d main.o
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/argmap.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/argmap.d
new file mode 100644
index 000000000000..0a1c36093c1f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/argmap.d
@@ -0,0 +1,31 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+provider test_prov {
+ probe place(int i, int j) : (int j, int i, int i, int j);
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/args.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/args.d
new file mode 100644
index 000000000000..a11984c17a7d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/args.d
@@ -0,0 +1,31 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+provider test_prov {
+ probe place(int i, int j);
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/forker.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/forker.d
new file mode 100644
index 000000000000..f63b965df29b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/forker.d
@@ -0,0 +1,31 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+provider forker {
+ probe fire();
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/main.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/main.c
new file mode 100644
index 000000000000..9dc0a0e63beb
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/main.c
@@ -0,0 +1,11 @@
+#include <stdlib.h>
+#include <sys/sdt.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv, char **envp)
+{
+ envp[0] = (char*)0xff;
+ TESTER_ENTRY();
+ return 0;
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.d
new file mode 100644
index 000000000000..53e5ef3988d1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.d
@@ -0,0 +1,3 @@
+provider tester {
+ probe entry();
+};
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h
new file mode 100644
index 000000000000..e29654edb672
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h
@@ -0,0 +1,46 @@
+/*
+ * Generated by dtrace(1M).
+ */
+
+#ifndef _PROV_H
+#define _PROV_H
+
+#include <unistd.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if _DTRACE_VERSION
+
+#define TESTER_ENTRY() \
+ __dtrace_tester___entry()
+#ifndef __sparc
+#define TESTER_ENTRY_ENABLED() \
+ __dtraceenabled_tester___entry()
+#else
+#define TESTER_ENTRY_ENABLED() \
+ __dtraceenabled_tester___entry(0)
+#endif
+
+
+extern void __dtrace_tester___entry(void);
+#ifndef __sparc
+extern int __dtraceenabled_tester___entry(void);
+#else
+extern int __dtraceenabled_tester___entry(long);
+#endif
+
+#else
+
+#define TESTER_ENTRY()
+#define TESTER_ENTRY_ENABLED() (0)
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PROV_H */
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.andpid.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.andpid.ksh
new file mode 100644
index 000000000000..2096422b7b7c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.andpid.ksh
@@ -0,0 +1,46 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -c date -s /dev/stdin <<EOF
+plockstat\$target::mutex_lock_impl:,
+pid\$target::mutex_lock_impl:
+{}
+EOF
+
+if [ $? -ne 0 ]; then
+ print -u2 "dtrace failed"
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c
new file mode 100644
index 000000000000..5697ef51279f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/sdt.h>
+
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ DTRACE_PROBE2(test_prov, place, 10, 4);
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.d
new file mode 100644
index 000000000000..fd9f9f4743da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.d
@@ -0,0 +1,65 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Verify that argN and args[N] variables are properly remapped.
+ */
+
+BEGIN
+{
+ /* Timeout after 5 seconds */
+ timeout = timestamp + 5000000000;
+}
+
+test_prov$1:::place
+/arg0 != 4 || arg1 != 10 || arg2 != 10 || arg3 != 4/
+{
+ printf("args are %d, %d, %d, %d; should be 4, 10, 10, 4",
+ arg0, arg1, arg2, arg3);
+ exit(1);
+}
+
+test_prov$1:::place
+/args[0] != 4 || args[1] != 10 || args[2] != 10 || args[3] != 4/
+{
+ printf("args are %d, %d, %d, %d; should be 4, 10, 10, 4",
+ args[0], args[1], args[2], args[3]);
+ exit(1);
+}
+
+test_prov$1:::place
+{
+ exit(0);
+}
+
+profile:::tick-1
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c
new file mode 100644
index 000000000000..5697ef51279f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/sdt.h>
+
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ DTRACE_PROBE2(test_prov, place, 10, 4);
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.d
new file mode 100644
index 000000000000..bb74e80f72cf
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.d
@@ -0,0 +1,60 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * SECTION:
+ *
+ * NOTES:
+ *
+ */
+BEGIN
+{
+ /* Timeout after 5 seconds */
+ timeout = timestamp + 5000000000;
+}
+
+test_prov$1:::place
+/arg0 == 10 && arg1 == 4/
+{
+ exit(0);
+}
+
+test_prov$1:::place
+{
+ printf("args are %d, %d; should be 10, 4", arg0, arg1);
+ exit(1);
+}
+
+profile:::tick-1
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh
new file mode 100644
index 000000000000..91b6cf06f10d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh
@@ -0,0 +1,84 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <sys/types.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ if (TEST_PROV_GO_ENABLED()) {
+ TEST_PROV_GO();
+ }
+}
+EOF
+
+cc -xarch=generic64 -c -o test64.o test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c 64-bit"
+ exit 1
+fi
+cc -xarch=generic -c -o test32.o test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c 32-bit"
+ exit 1
+fi
+
+$dtrace -G -s prov.d test32.o test64.o
+if [ $? -eq 0 ]; then
+ print -u2 "DOF generation failed to generate a warning"
+ exit 1
+fi
+
+cd /
+/bin/rm -rf $DIR
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh
new file mode 100644
index 000000000000..68dbb03456cc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh
@@ -0,0 +1,107 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# This test verifies that a program that corrupts its own environment
+# without inducing a crash does not crash solely due to drti.o's use of
+# getenv(3C).
+#
+
+PATH=/usr/bin:/usr/sbin:$PATH
+
+if (( $# != 1 )); then
+ print -u2 'expected one argument: <dtrace-path>'
+ exit 2
+fi
+
+#
+# jdtrace does not implement the -h option that is required to generate
+# C header files.
+#
+if [[ "$1" == */jdtrace ]]; then
+ exit 0
+fi
+
+dtrace="$1"
+startdir="$PWD"
+dir=$(mktemp -td drtiXXXXXX)
+if (( $? != 0 )); then
+ print -u2 'Could not create safe temporary directory'
+ exit 2
+fi
+
+cd "$dir"
+
+cat > Makefile <<EOF
+all: main
+
+main: main.o prov.o
+ \$(CC) -o main main.o prov.o
+
+main.o: main.c prov.h
+ \$(CC) -c main.c
+
+prov.h: prov.d
+ $dtrace -h -s prov.d
+
+prov.o: prov.d main.o
+ $dtrace -G -32 -s prov.d main.o
+EOF
+
+cat > prov.d <<EOF
+provider tester {
+ probe entry();
+};
+EOF
+
+cat > main.c <<EOF
+#include <stdlib.h>
+#include <sys/sdt.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv, char **envp)
+{
+ envp[0] = (char*)0xff;
+ TESTER_ENTRY();
+ return 0;
+}
+EOF
+
+make > /dev/null
+status=$?
+if (( $status != 0 )) ; then
+ print -u2 "failed to build"
+else
+ ./main
+ status=$?
+fi
+
+cd "$startdir"
+rm -rf "$dir"
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
new file mode 100644
index 000000000000..1c155febb5ae
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
@@ -0,0 +1,159 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This test verifies that USDT providers are removed when its associated
+# load object is closed via dlclose(3dl).
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > Makefile <<EOF
+all: main livelib.so deadlib.so
+
+main: main.o prov.o
+ cc -o main main.o
+
+main.o: main.c
+ cc -c main.c
+
+
+livelib.so: livelib.o prov.o
+ cc -z defs -G -o livelib.so livelib.o prov.o -lc
+
+livelib.o: livelib.c prov.h
+ cc -c livelib.c
+
+prov.o: livelib.o prov.d
+ $dtrace -G -s prov.d livelib.o
+
+prov.h: prov.d
+ $dtrace -h -s prov.d
+
+
+deadlib.so: deadlib.o
+ cc -z defs -G -o deadlib.so deadlib.o -lc
+
+deadlib.o: deadlib.c
+ cc -c deadlib.c
+
+clean:
+ rm -f main.o livelib.o prov.o prov.h deadlib.o
+
+clobber: clean
+ rm -f main livelib.so deadlib.so
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+cat > livelib.c <<EOF
+#include "prov.h"
+
+void
+go(void)
+{
+ TEST_PROV_GO();
+}
+EOF
+
+cat > deadlib.c <<EOF
+void
+go(void)
+{
+}
+EOF
+
+
+cat > main.c <<EOF
+#include <dlfcn.h>
+#include <unistd.h>
+#include <stdio.h>
+
+int
+main(int argc, char **argv)
+{
+ void *live;
+
+ if ((live = dlopen("./livelib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) {
+ printf("dlopen of livelib.so failed: %s\n", dlerror());
+ return (1);
+ }
+
+ (void) dlclose(live);
+
+ pause();
+
+ return (0);
+}
+EOF
+
+/usr/bin/make > /dev/null
+if [ $? -ne 0 ]; then
+ print -u2 "failed to build"
+ exit 1
+fi
+
+script() {
+ $dtrace -w -x bufsize=1k -c ./main -qs /dev/stdin <<EOF
+ syscall::pause:entry
+ /pid == \$target/
+ {
+ system("$dtrace -l -P test_prov*");
+ system("kill %d", \$target);
+ exit(0);
+ }
+
+ tick-1s
+ /i++ == 5/
+ {
+ printf("failed\n");
+ exit(1);
+ }
+EOF
+}
+
+script 2>&1
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh.out
new file mode 100644
index 000000000000..2f5bb15fb5b7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh.out
@@ -0,0 +1,3 @@
+dtrace: failed to match test_prov*:::: No probe matches description
+ ID PROVIDER MODULE FUNCTION NAME
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
new file mode 100644
index 000000000000..107707ede32e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
@@ -0,0 +1,160 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > Makefile <<EOF
+all: main livelib.so deadlib.so
+
+main: main.o prov.o
+ cc -o main main.o
+
+main.o: main.c
+ cc -c main.c
+
+
+livelib.so: livelib.o prov.o
+ cc -z defs -G -o livelib.so livelib.o prov.o -lc
+
+livelib.o: livelib.c prov.h
+ cc -c livelib.c
+
+prov.o: livelib.o prov.d
+ $dtrace -G -s prov.d livelib.o
+
+prov.h: prov.d
+ $dtrace -h -s prov.d
+
+
+deadlib.so: deadlib.o
+ cc -z defs -G -o deadlib.so deadlib.o -lc
+
+deadlib.o: deadlib.c
+ cc -c deadlib.c
+
+clean:
+ rm -f main.o livelib.o prov.o prov.h deadlib.o
+
+clobber: clean
+ rm -f main livelib.so deadlib.so
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+cat > livelib.c <<EOF
+#include "prov.h"
+
+void
+go(void)
+{
+ TEST_PROV_GO();
+}
+EOF
+
+cat > deadlib.c <<EOF
+void
+go(void)
+{
+}
+EOF
+
+
+cat > main.c <<EOF
+#include <dlfcn.h>
+#include <unistd.h>
+#include <stdio.h>
+
+int
+main(int argc, char **argv)
+{
+ void *live, *dead;
+ void *go;
+
+ if ((live = dlopen("./livelib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) {
+ printf("dlopen of livelib.so failed: %s\n", dlerror());
+ return (1);
+ }
+
+ (void) dlclose(live);
+
+ if ((dead = dlopen("./deadlib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) {
+ printf("dlopen of deadlib.so failed: %s\n", dlerror());
+ return (1);
+ }
+
+ if ((live = dlopen("./livelib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) {
+ printf("dlopen of livelib.so failed: %s\n", dlerror());
+ return (1);
+ }
+
+ if ((go = dlsym(live, "go")) == NULL) {
+ printf("failed to lookup 'go' in livelib.so\n");
+ return (1);
+ }
+
+ ((void (*)(void))go)();
+
+ return (0);
+}
+EOF
+
+/usr/bin/make > /dev/null
+if [ $? -ne 0 ]; then
+ print -u2 "failed to build"
+ exit 1
+fi
+
+script() {
+ $dtrace -w -c ./main -Zqs /dev/stdin <<EOF
+ test_prov*:::
+ {
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh.out
new file mode 100644
index 000000000000..2164eabcf423
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh.out
@@ -0,0 +1,2 @@
+livelib.so:go:go
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
new file mode 100644
index 000000000000..a750b59e14e6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
@@ -0,0 +1,170 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This test verifies that performing a dlclose(3dl) on a library doesn't
+# cause existing pid provider probes to become invalid.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > Makefile <<EOF
+all: main livelib.so deadlib.so
+
+main: main.o prov.o
+ cc -o main main.o
+
+main.o: main.c
+ cc -c main.c
+
+
+livelib.so: livelib.o prov.o
+ cc -z defs -G -o livelib.so livelib.o prov.o -lc
+
+livelib.o: livelib.c prov.h
+ cc -c livelib.c
+
+prov.o: livelib.o prov.d
+ $dtrace -G -s prov.d livelib.o
+
+prov.h: prov.d
+ $dtrace -h -s prov.d
+
+
+deadlib.so: deadlib.o
+ cc -z defs -G -o deadlib.so deadlib.o -lc
+
+deadlib.o: deadlib.c
+ cc -c deadlib.c
+
+clean:
+ rm -f main.o livelib.o prov.o prov.h deadlib.o
+
+clobber: clean
+ rm -f main livelib.so deadlib.so
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+cat > livelib.c <<EOF
+#include "prov.h"
+
+void
+go(void)
+{
+ TEST_PROV_GO();
+}
+EOF
+
+cat > deadlib.c <<EOF
+void
+go(void)
+{
+}
+EOF
+
+
+cat > main.c <<EOF
+#include <dlfcn.h>
+#include <unistd.h>
+#include <stdio.h>
+
+static void
+foo(void)
+{
+ (void) close(-1);
+}
+
+int
+main(int argc, char **argv)
+{
+ void *live;
+
+ if ((live = dlopen("./livelib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) {
+ printf("dlopen of livelib.so failed: %s\n", dlerror());
+ return (1);
+ }
+
+ (void) dlclose(live);
+
+ foo();
+
+ return (0);
+}
+EOF
+
+/usr/bin/make > /dev/null
+if [ $? -ne 0 ]; then
+ print -u2 "failed to build"
+ exit 1
+fi
+
+script() {
+ $dtrace -c ./main -s /dev/stdin <<EOF
+ pid\$target:a.out:foo:entry
+ {
+ gotit = 1;
+ exit(0);
+ }
+
+ tick-1s
+ /i++ == 5/
+ {
+ printf("test timed out");
+ exit(1);
+ }
+
+ END
+ /!gotit/
+ {
+ printf("program ended without hitting probe");
+ exit(1);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
new file mode 100644
index 000000000000..96b05d5cde2d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
@@ -0,0 +1,106 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# Make sure temporary symbols generated due to DTrace probes in static
+# functions are removed in the final link step.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <sys/types.h>
+#include "prov.h"
+
+static void
+foo(void)
+{
+ TEST_PROV_GO();
+}
+
+int
+main(int argc, char **argv)
+{
+ foo();
+
+ return (0);
+}
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+nm test.o | grep \$dtrace > /dev/null
+if [ $? -ne 0 ]; then
+ print -u2 "no temporary symbols in the object file"
+ exit 1
+fi
+
+nm test | grep \$dtrace > /dev/null
+if [ $? -eq 0 ]; then
+ print -u2 "failed to eliminate temporary symbols"
+ exit 1
+fi
+
+cd /
+/bin/rm -rf $DIR
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
new file mode 100644
index 000000000000..d0ac1864877e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
@@ -0,0 +1,96 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <sys/types.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ if (TEST_PROV_GO_ENABLED()) {
+ TEST_PROV_GO();
+ }
+}
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -c ./test -qs /dev/stdin <<EOF
+ test_prov\$target:::
+ {
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh.out
new file mode 100644
index 000000000000..b856cc59f44c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh.out
@@ -0,0 +1,2 @@
+test:main:go
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
new file mode 100644
index 000000000000..d40036d8c576
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
@@ -0,0 +1,113 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+#
+# This test is primarily intended to verify a fix for SPARC, but there's no
+# harm in running it on other platforms. Here, we verify that is-enabled
+# probes don't interfere with return values from previously invoked functions.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <stdio.h>
+#include "prov.h"
+
+int
+foo(void)
+{
+ return (24);
+}
+
+int
+main(int argc, char **argv)
+{
+ int a = foo();
+ if (TEST_PROV_GO_ENABLED()) {
+ TEST_PROV_GO();
+ }
+ (void) printf("%d %d %d\n", a, a, a);
+
+ return (0);
+}
+EOF
+
+cc -c -xO2 test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ ./test
+
+ $dtrace -c ./test -qs /dev/stdin <<EOF
+ test_prov\$target:::
+ {
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out
new file mode 100644
index 000000000000..563d68fd312b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out
@@ -0,0 +1,3 @@
+24 24 24
+24 24 24
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
new file mode 100644
index 000000000000..51afe961a843
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
@@ -0,0 +1,118 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+#include <sys/sdt.h>
+
+int
+main(int argc, char **argv)
+{
+ DTRACE_PROBE(test_prov, entry);
+ DTRACE_PROBE(test_prov, __entry);
+ DTRACE_PROBE(test_prov, foo__entry);
+ DTRACE_PROBE(test_prov, carpentry);
+ DTRACE_PROBE(test_prov, miniatureturn);
+ DTRACE_PROBE(test_prov, foo__return);
+ DTRACE_PROBE(test_prov, __return);
+ /*
+ * Unfortunately, a "return" probe is not currently possible due to
+ * the conflict with a reserved word.
+ */
+ DTRACE_PROBE(test_prov, done);
+}
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe entry();
+ probe __entry();
+ probe foo__entry();
+ probe carpentry();
+ probe miniatureturn();
+ probe foo__return();
+ probe __return();
+ probe done();
+};
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -wqZFs /dev/stdin <<EOF
+ BEGIN
+ {
+ system("$DIR/test");
+ printf("\n");
+ }
+
+ test_prov*:::done
+ /progenyof(\$pid)/
+ {
+ exit(0);
+ }
+
+ test_prov*:::
+ /progenyof(\$pid)/
+ {
+ printf("\n");
+ }
+EOF
+}
+
+script | cut -c5-
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh.out
new file mode 100644
index 000000000000..3bf2890748ef
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh.out
@@ -0,0 +1,10 @@
+FUNCTION
+| :BEGIN
+ -> main
+ -> main
+ -> main
+ | main:carpentry
+ | main:miniatureturn
+ <- main
+ <- main
+ | main:done
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
new file mode 100644
index 000000000000..3ee9e9f228d5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
@@ -0,0 +1,105 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ TEST_PROV_GO();
+ if (fork() == 0) {
+ TEST_PROV_GO();
+ return (0);
+ }
+
+ (void) wait(NULL);
+ TEST_PROV_GO();
+
+ return (0);
+}
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script() {
+ $dtrace -c ./test -Zqs /dev/stdin <<EOF
+ test_prov*:::
+ {
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh.out
new file mode 100644
index 000000000000..c656c3375762
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh.out
@@ -0,0 +1,4 @@
+test:main:go
+test:main:go
+test:main:go
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c
new file mode 100644
index 000000000000..ade7f83b3d53
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <unistd.h>
+
+#include "forker.h"
+
+int
+main(int argc, char **argv)
+{
+ int i;
+
+ for (i = 0; i < 10000; i++) {
+ FORKER_FIRE();
+ if (fork() == 0)
+ exit(0);
+
+ (void) wait(NULL);
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.ksh
new file mode 100644
index 000000000000..d35fc4db70df
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.ksh
@@ -0,0 +1,55 @@
+#!/usr/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+#
+# Test that we don't deadlock between forking and enabling/disabling USDT
+# probes. This test has succeeded if it completes at all.
+#
+
+./tst.forker.exe &
+id=$!
+
+while kill -0 $id >/dev/null 2>&1; do
+ $dtrace -p $id -s /dev/stdin <<-EOF
+ forker*:::fire
+ /i++ == 4/
+ {
+ exit(0);
+ }
+ EOF
+done
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh
new file mode 100644
index 000000000000..8affb3583f8d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh
@@ -0,0 +1,96 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <sys/types.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ if (TEST_PROV_GO_ENABLED()) {
+ TEST_PROV_GO();
+ }
+}
+EOF
+
+cc -xarch=generic -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -xarch=generic -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -c ./test -qs /dev/stdin <<EOF
+ test_prov\$target:::
+ {
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh
new file mode 100644
index 000000000000..0c2801872e3f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh
@@ -0,0 +1,100 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <sys/types.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ if (TEST_PROV_GO_ENABLED()) {
+ TEST_PROV_GO();
+ }
+}
+EOF
+
+cc -xarch=generic64 -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -xarch=generic64 -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -c ./test -qs /dev/stdin <<EOF
+ test_prov\$target:::
+ {
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+ }
+EOF
+}
+
+if [ `isainfo -b` -ne '64']; then
+ script
+ status=$?
+else
+ status=0
+fi
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
new file mode 100644
index 000000000000..37ad97c3b0f1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
@@ -0,0 +1,85 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe zero();
+ probe one(uintptr_t);
+ probe u_nder(char *);
+ probe d__ash(int **);
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <sys/types.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ TEST_PROV_ZERO();
+ TEST_PROV_ONE(1);
+ TEST_PROV_U_NDER("hi there");
+ TEST_PROV_D_ASH(argv);
+}
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+cd /
+/bin/rm -rf $DIR
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh
new file mode 100644
index 000000000000..6f809fdc7c89
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh
@@ -0,0 +1,61 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+# Make sure <unistd.h> defines _DTRACE_VERSION
+
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+#include <unistd.h>
+
+int
+main(int argc, char **argv)
+{
+#ifdef _DTRACE_VERSION
+ return (0);
+#else
+ return (1);
+#endif
+}
+EOF
+
+cc -xarch=generic -o test test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+
+./test
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
new file mode 100644
index 000000000000..a1ef9d89c30b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
@@ -0,0 +1,82 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+#include <sys/sdt.h>
+
+int
+main(int argc, char **argv)
+{
+ DTRACE_PROBE(test_prov, zero);
+ DTRACE_PROBE1(test_prov, one, 1);
+ DTRACE_PROBE2(test_prov, two, 2, 3);
+ DTRACE_PROBE3(test_prov, three, 4, 5, 7);
+ DTRACE_PROBE4(test_prov, four, 7, 8, 9, 10);
+ DTRACE_PROBE5(test_prov, five, 11, 12, 13, 14, 15);
+}
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe zero();
+ probe one(uintptr_t);
+ probe two(uintptr_t, uintptr_t);
+ probe three(uintptr_t, uintptr_t, uintptr_t);
+ probe four(uintptr_t, uintptr_t, uintptr_t, uintptr_t);
+ probe five(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
+};
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+cd /
+/bin/rm -rf $DIR
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
new file mode 100644
index 000000000000..ffc5107b1bfa
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
@@ -0,0 +1,84 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+ppriv -s A=basic $$
+
+cat > test.c <<EOF
+#include <sys/sdt.h>
+
+int
+main(int argc, char **argv)
+{
+ DTRACE_PROBE(test_prov, zero);
+ DTRACE_PROBE1(test_prov, one, 1);
+ DTRACE_PROBE2(test_prov, two, 2, 3);
+ DTRACE_PROBE3(test_prov, three, 4, 5, 7);
+ DTRACE_PROBE4(test_prov, four, 7, 8, 9, 10);
+ DTRACE_PROBE5(test_prov, five, 11, 12, 13, 14, 15);
+}
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe zero();
+ probe one(uintptr_t);
+ probe two(uintptr_t, uintptr_t);
+ probe three(uintptr_t, uintptr_t, uintptr_t);
+ probe four(uintptr_t, uintptr_t, uintptr_t, uintptr_t);
+ probe five(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
+};
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+cd /
+/bin/rm -rf $DIR
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
new file mode 100644
index 000000000000..3f545a7bd48e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
@@ -0,0 +1,99 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <sys/types.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ TEST_PROV_GO();
+ TEST_PROV_GO();
+ TEST_PROV_GO();
+ TEST_PROV_GO();
+
+ return (0);
+}
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script() {
+ $dtrace -c ./test -qs /dev/stdin <<EOF
+ test_prov\$target:::
+ {
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh.out
new file mode 100644
index 000000000000..5e826192fed1
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh.out
@@ -0,0 +1,5 @@
+test:main:go
+test:main:go
+test:main:go
+test:main:go
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh
new file mode 100644
index 000000000000..f766f6d1d1a5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh
@@ -0,0 +1,90 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+# Fake up a scenario where _DTRACE_VERSION is not defined by having our own
+# <unistd.h>. This tests that dtrace -h will produce a header file which can
+# be used on a system where DTrace is not present.
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+touch unistd.h
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ TEST_PROV_GO();
+
+ if (TEST_PROV_GO_ENABLED()) {
+ TEST_PROV_GO();
+ }
+
+ return (0);
+}
+EOF
+
+cc -I. -xarch=generic -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+cc -xarch=generic -o test test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+./test
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
new file mode 100644
index 000000000000..338dcdf03e6f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
@@ -0,0 +1,128 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+#include <unistd.h>
+#include <sys/sdt.h>
+
+int
+main(int argc, char **argv)
+{
+ DTRACE_PROBE(test_prov, probe1);
+}
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe probe1();
+};
+EOF
+
+gcc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+gcc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -Zwqs /dev/stdin <<EOF
+
+ BEGIN
+ {
+ spec = speculation();
+ speculate(spec);
+ printf("this is speculative!\n");
+ }
+
+ test_prov*:::
+ {
+ probeid = id;
+ }
+
+ tick-1sec
+ /probeid == 0/
+ {
+ printf("launching test\n");
+ system("./test");
+ }
+
+ tick-1sec
+ /probeid != 0/
+ {
+ printf("attempting re-enabling\n");
+ system("dtrace -e -x errtags -i %d", probeid);
+ attempts++;
+ }
+
+ tick-1sec
+ /attempts > 10/
+ {
+ exit(0);
+ }
+EOF
+}
+
+script 2>&1 | tee test.out
+
+#
+# It should be true that our probe was not reaped after the provider was made
+# defunct: the speculative tracing action prevents reaping of any ECB in the
+# enabling.
+#
+status=0
+
+if grep D_PDESC_INVAL test.out 2> /dev/null 1>&2 ; then
+ status=1
+else
+ grep D_PROC_GRAB test.out 2> /dev/null 1>&2
+ status=$?
+fi
+
+cd /
+/usr/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
new file mode 100644
index 000000000000..a2e5edee3814
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
@@ -0,0 +1,124 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+#include <unistd.h>
+#include <sys/sdt.h>
+
+int
+main(int argc, char **argv)
+{
+ DTRACE_PROBE(test_prov, probe1);
+}
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe probe1();
+};
+EOF
+
+gcc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+gcc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -Zwqs /dev/stdin <<EOF
+ test_prov*:::
+ {
+ probeid = id;
+ }
+
+ tick-1sec
+ /probeid == 0/
+ {
+ printf("launching test\n");
+ system("./test");
+ }
+
+ tick-1sec
+ /probeid != 0/
+ {
+ printf("attempting re-enabling\n");
+ system("dtrace -e -x errtags -i %d", probeid);
+ attempts++;
+ }
+
+ tick-1sec
+ /attempts > 10/
+ {
+ exit(0);
+ }
+EOF
+}
+
+$dtrace -x bufpolicy=ring -ZwqP test_prov\* > /dev/null 2>&1 &
+background=$!
+echo launched ring buffered enabling as pid $background
+script 2>&1 | tee test.out
+
+#
+# It should be true that our probe was not reaped after the provider was made
+# defunct: the active ring buffer in the earlier enabling prevents reaping of
+# any of the earlier enabling's ECBs.
+#
+status=0
+
+if grep D_PDESC_INVAL test.out 2> /dev/null 1>&2 ; then
+ status=1
+else
+ grep D_PROC_GRAB test.out 2> /dev/null 1>&2
+ status=$?
+fi
+
+kill $background
+cd /
+/usr/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
new file mode 100644
index 000000000000..9def3c002b9a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
@@ -0,0 +1,82 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <sys/types.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ if (TEST_PROV_GO_ENABLED())
+ return (2);
+
+ return (0);
+}
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+cd /
+/bin/rm -rf $DIR
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
new file mode 100644
index 000000000000..f18c585ef6c8
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
@@ -0,0 +1,115 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+#include <unistd.h>
+#include <sys/sdt.h>
+
+int
+main(int argc, char **argv)
+{
+ DTRACE_PROBE(test_prov, probe1);
+}
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe probe1();
+};
+EOF
+
+gcc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+gcc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -Zwqs /dev/stdin <<EOF
+ test_prov*:::
+ {
+ probeid = id;
+ }
+
+ tick-1sec
+ /probeid == 0/
+ {
+ printf("launching test\n");
+ system("./test");
+ }
+
+ tick-1sec
+ /probeid != 0/
+ {
+ printf("attempting re-enabling\n");
+ system("dtrace -e -x errtags -i %d", probeid);
+ attempts++;
+ }
+
+ tick-1sec
+ /attempts > 10/
+ {
+ exit(0);
+ }
+EOF
+}
+
+script 2>&1 | tee test.out
+
+#
+# It should be true that our probe was reaped over the course of the enabling,
+# causing the embedded DTrace invocation to fail on an invalid probe (that is,
+# D_PDESC_INVAL) instead of an inability to grab the underlying process
+# (D_PROC_GRAB).
+#
+grep D_PDESC_INVAL test.out 2> /dev/null 1>&2
+status=$?
+
+cd /
+/usr/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
new file mode 100644
index 000000000000..4ea33f76d83c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
@@ -0,0 +1,98 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+#include <sys/sdt.h>
+
+int
+main(int argc, char **argv)
+{
+ DTRACE_PROBE(test_prov, zero);
+}
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe zero();
+};
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -wZs /dev/stdin <<EOF
+ BEGIN
+ {
+ system("$DIR/test");
+ }
+
+ test_prov*:::
+ {
+ seen = 1;
+ }
+
+ proc:::exit
+ /progenyof(\$pid) && execname == "test"/
+ {
+ exit(seen ? 0 : 2);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
new file mode 100644
index 000000000000..0cddf0db810e
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
@@ -0,0 +1,98 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+#include <unistd.h>
+#include <sys/sdt.h>
+
+static void
+foo(void)
+{
+ DTRACE_PROBE(test_prov, probe1);
+ DTRACE_PROBE(test_prov, probe2);
+}
+
+int
+main(int argc, char **argv)
+{
+ DTRACE_PROBE(test_prov, probe1);
+ DTRACE_PROBE(test_prov, probe2);
+ foo();
+}
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe probe1();
+ probe probe2();
+};
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -c ./test -qs /dev/stdin <<EOF
+ test_prov\$target:::
+ {
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh.out
new file mode 100644
index 000000000000..a559d97a87d0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh.out
@@ -0,0 +1,5 @@
+test:main:probe1
+test:main:probe2
+test:foo:probe1
+test:foo:probe2
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
new file mode 100644
index 000000000000..8385b27cdfe4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
@@ -0,0 +1,108 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+# Rebuilding an object file containing DOF changes slightly when the object
+# files containing the probes have already been modified. This tests that
+# case by generating the DOF object, removing it, and building it again.
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+#include <unistd.h>
+#include <sys/sdt.h>
+
+static void
+foo(void)
+{
+ DTRACE_PROBE(test_prov, probe1);
+ DTRACE_PROBE(test_prov, probe2);
+}
+
+int
+main(int argc, char **argv)
+{
+ DTRACE_PROBE(test_prov, probe1);
+ DTRACE_PROBE(test_prov, probe2);
+ foo();
+}
+EOF
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe probe1();
+ probe probe2();
+};
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create initial DOF"
+ exit 1
+fi
+rm -f prov.o
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create final DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -c ./test -qs /dev/stdin <<EOF
+ test_prov\$target:::
+ {
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh.out
new file mode 100644
index 000000000000..a559d97a87d0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh.out
@@ -0,0 +1,5 @@
+test:main:probe1
+test:main:probe2
+test:foo:probe1
+test:foo:probe2
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
new file mode 100644
index 000000000000..89ceb4a94858
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
@@ -0,0 +1,96 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > prov.d <<EOF
+provider test_prov {
+ probe go();
+};
+EOF
+
+$dtrace -h -s prov.d
+if [ $? -ne 0 ]; then
+ print -u2 "failed to generate header file"
+ exit 1
+fi
+
+cat > test.c <<EOF
+#include <sys/types.h>
+#include "prov.h"
+
+int
+main(int argc, char **argv)
+{
+ TEST_PROV_GO();
+
+ return (0);
+}
+EOF
+
+cc -c test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+script() {
+ $dtrace -c 'ppriv -e -s A=basic ./test' -Zqs /dev/stdin <<EOF
+ test_prov\$target:::
+ {
+ printf("%s:%s:%s\n", probemod, probefunc, probename);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh.out
new file mode 100644
index 000000000000..b856cc59f44c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh.out
@@ -0,0 +1,2 @@
+test:main:go
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c
new file mode 100644
index 000000000000..edd3dd157d42
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+void grow1(int);
+
+void
+grow(int frame)
+{
+ /*
+ * Create a ridiculously large stack - enough to push us over
+ * the default setting of 'dtrace_ustackdepth_max' (2048).
+ */
+ if (frame >= 2048)
+ for (;;)
+ getpid();
+
+ grow1(++frame);
+}
+
+void
+grow1(int frame)
+{
+ grow(++frame);
+}
+
+int
+main(int argc, char *argv[])
+{
+ grow(1);
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.d
new file mode 100644
index 000000000000..66fda5ba2818
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.d
@@ -0,0 +1,45 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+syscall::getpid:entry
+/pid == $1/
+{
+ @[ustackdepth] = count();
+}
+
+ERROR
+/arg4 == DTRACEFLT_BADSTACK/
+{
+ exit(0);
+}
+
+profile:::tick-1s
+/++n == 10/
+{
+ exit(1)
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.depth.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.depth.ksh
new file mode 100644
index 000000000000..26cff421aa59
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.depth.ksh
@@ -0,0 +1,110 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+file=out.$$
+dtrace=$1
+
+rm -f $file
+
+$dtrace -o $file -c date -s /dev/stdin <<EOF
+
+ #pragma D option quiet
+ #pragma D option bufsize=1M
+ #pragma D option bufpolicy=fill
+
+ pid\$target:::entry,
+ pid\$target:::return,
+ pid\$target:a.out::,
+ syscall:::return,
+ profile:::profile-997
+ /pid == \$target/
+ {
+ printf("START %s:%s:%s:%s\n",
+ probeprov, probemod, probefunc, probename);
+ trace(ustackdepth);
+ ustack(100);
+ trace("END\n");
+ }
+
+ tick-1sec
+ /n++ == 10/
+ {
+ trace("test timed out...");
+ exit(1);
+ }
+EOF
+
+status=$?
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+ exit $status
+fi
+
+perl /dev/stdin $file <<EOF
+ while (<>) {
+ chomp;
+
+ last if /^\$/;
+
+ die "expected START at \$.\n" unless /^START/;
+
+ \$_ = <>;
+ chomp;
+ die "expected depth (\$_) at \$.\n" unless /^(\d+)\$/;
+ \$depth = \$1;
+
+ for (\$i = 0; \$i < \$depth; \$i++) {
+ \$_ = <>;
+ chomp;
+ die "unexpected END at \$.\n" if /^END/;
+ }
+
+ \$_ = <>;
+ chomp;
+ die "expected END at \$.\n" unless /^END\$/;
+ }
+EOF
+
+status=$?
+
+count=`wc -l $file | cut -f1 -do`
+if [ "$count" -lt 1000 ]; then
+ echo $tst: output was too short
+ status=1
+fi
+
+
+if [ "$status" -eq 0 ]; then
+ rm -f $file
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c
new file mode 100644
index 000000000000..bdeb16d9d73c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <unistd.h>
+
+volatile long long count = 0;
+
+int
+baz(int a)
+{
+ (void) getpid();
+ while (count != -1) {
+ count++;
+ a++;
+ }
+
+ return (a + 1);
+}
+
+int
+bar(int a)
+{
+ return (baz(a + 1) - 1);
+}
+
+int
+foo(int a, int b)
+{
+ return (bar(a) - b);
+}
+
+int
+main(int argc, char **argv)
+{
+ return (foo(argc, (int)argv) == 0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh
new file mode 100644
index 000000000000..1a7e0e12365b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh
@@ -0,0 +1,139 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+file=out.$$
+dtrace=$1
+
+rm -f $file
+
+dir=`dirname $tst`
+
+$dtrace -o $file -c $dir/tst.spin.exe -s /dev/stdin <<EOF
+
+ #pragma D option quiet
+ #pragma D option destructive
+ #pragma D option evaltime=main
+
+ /*
+ * Toss out the first 100 samples to wait for the program to enter
+ * its steady state.
+ */
+
+ profile-1999
+ /pid == \$target && n++ > 100/
+ {
+ @total = count();
+ @stacks[ustack(4)] = count();
+ }
+
+ tick-1s
+ {
+ secs++;
+ }
+
+ tick-1s
+ /secs > 5/
+ {
+ done = 1;
+ }
+
+ tick-1s
+ /secs > 10/
+ {
+ trace("test timed out");
+ exit(1);
+ }
+
+ profile-1999
+ /pid == \$target && done/
+ {
+ raise(SIGINT);
+ exit(0);
+ }
+
+ END
+ {
+ printa("TOTAL %@u\n", @total);
+ printa("START%kEND\n", @stacks);
+ }
+EOF
+
+status=$?
+if [ "$status" -ne 0 ]; then
+ echo $tst: dtrace failed
+ exit $status
+fi
+
+perl /dev/stdin $file <<EOF
+ \$_ = <>;
+ chomp;
+ die "output problem\n" unless /^TOTAL (\d+)/;
+ \$count = \$1;
+ die "too few samples (\$count)\n" unless \$count >= 1000;
+
+ while (<>) {
+ chomp;
+
+ last if /^$/;
+
+ die "expected START at \$.\n" unless /^START/;
+
+
+ \$_ = <>;
+ chomp;
+ die "expected END at \$.\n" unless /\`baz\+/;
+
+ \$_ = <>;
+ chomp;
+ die "expected END at \$.\n" unless /\`bar\+/;
+
+ \$_ = <>;
+ chomp;
+ die "expected END at \$.\n" unless /\`foo\+/;
+
+ \$_ = <>;
+ chomp;
+ die "expected END at \$.\n" unless /\`main\+/;
+
+ \$_ = <>;
+ chomp;
+ die "expected END at \$.\n" unless /^END\$/;
+ }
+
+EOF
+
+status=$?
+if [ "$status" -eq 0 ]; then
+ rm -f $file
+fi
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.gid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.gid.d
new file mode 100644
index 000000000000..23fcf38947d7
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.gid.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+/curpsinfo->pr_gid == gid/
+{
+ exit(0);
+}
+
+BEGIN
+{
+ printf("%d != %d\n", curpsinfo->pr_gid, gid);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.nullassign.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.nullassign.d
new file mode 100644
index 000000000000..accc763fe94d
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.nullassign.d
@@ -0,0 +1,94 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+{
+ die = "Die";
+ tap = ", SystemTap, ";
+ the = "The";
+}
+
+BEGIN
+{
+ phrase = strjoin(die, tap);
+ phrase = strjoin(phrase, die);
+ expected = "Die, SystemTap, Die";
+}
+
+BEGIN
+/phrase != expected/
+{
+ printf("global: expected '%s', found '%s'\n", expected, phrase);
+ exit(1);
+}
+
+BEGIN
+{
+ this->phrase = strjoin(the, tap);
+}
+
+BEGIN
+{
+ this->phrase = strjoin(this->phrase, the);
+ expected = "The, SystemTap, The";
+}
+
+BEGIN
+/this->phrase != expected/
+{
+ printf("clause-local: expected '%s', found '%s'\n",
+ expected, this->phrase);
+ exit(2);
+}
+
+BEGIN
+{
+ phrase = NULL;
+ this->phrase = NULL;
+}
+
+BEGIN
+/phrase != NULL/
+{
+ printf("expected global to be NULL\n");
+ exit(3);
+}
+
+BEGIN
+/this->phrase != NULL/
+{
+ printf("expected clause-local to be NULL\n");
+ exit(4);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ppid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ppid.d
new file mode 100644
index 000000000000..5f0da5fdcbf0
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ppid.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+/curpsinfo->pr_ppid == ppid/
+{
+ exit(0);
+}
+
+BEGIN
+{
+ printf("%d != %d\n", curpsinfo->pr_ppid, ppid);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh
new file mode 100644
index 000000000000..c09825ec21bc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh
@@ -0,0 +1,65 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This test is a bit naughty; it's assuming that ld.so.1 has an implementation
+# of calloc(3C), and that it's implemented in terms of the ld.so.1
+# implementation of malloc(3C). If you're reading this comment because
+# those assumptions have become false, please accept my apologies...
+#
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -qs /dev/stdin -c "/bin/echo" <<EOF
+pid\$target:ld.so.1:calloc:entry
+{
+ self->calloc = 1;
+}
+
+pid\$target:ld.so.1:malloc:entry
+/self->calloc/
+{
+ @[umod(ucaller), ufunc(ucaller)] = count();
+}
+
+pid\$target:ld.so.1:calloc:return
+/self->calloc/
+{
+ self->calloc = 0;
+}
+
+END
+{
+ printa("%A %A\n", @);
+}
+EOF
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh.out
new file mode 100644
index 000000000000..86c72a4e1631
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh.out
@@ -0,0 +1,3 @@
+
+ld.so.1 ld.so.1`calloc
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.uid.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.uid.d
new file mode 100644
index 000000000000..bf1c9dc56695
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.uid.d
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+BEGIN
+/curpsinfo->pr_uid == uid/
+{
+ exit(0);
+}
+
+BEGIN
+{
+ printf("%d != %d\n", curpsinfo->pr_uid, uid);
+ exit(1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.walltimestamp.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.walltimestamp.d
new file mode 100644
index 000000000000..e17bb946dba5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.walltimestamp.d
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+uint64_t now;
+
+BEGIN
+{
+ now = 18252813184; /* Jan 1, 2004 00:00:00 */
+}
+
+BEGIN
+/walltimestamp < timestamp/
+{
+ printf("%d < %d", walltimestamp, timestamp);
+ exit(1);
+}
+
+BEGIN
+/walltimestamp < now/
+{
+ printf("%d (%Y) is before %Y", walltimestamp, walltimestamp, now);
+ exit(2);
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/version/tst.1.0.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/version/tst.1.0.d
new file mode 100644
index 000000000000..0ab2af787b10
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/version/tst.1.0.d
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option version=1.0
+
+/*
+ * The following identifiers were added as D built-ins as of version 1.1.
+ * Using these identifiers as user-specified variables should be illegal in
+ * that and any later versions, but legal in earlier versions.
+ */
+int strstr;
+int strchr;
+int strrchr;
+int strtok;
+int substr;
+int index;
+int freopen;
+
+BEGIN
+{
+ exit(0);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/arrays/tst.uregsarray.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/arrays/tst.uregsarray.d
new file mode 100644
index 000000000000..5543c0a575e6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/arrays/tst.uregsarray.d
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Positive test to make sure that we can invoke x86
+ * ureg[] aliases.
+ *
+ * SECTION: User Process Tracing/uregs Array
+ *
+ * NOTES: This test does no verification - the value of the output
+ * is not deterministic.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("R_GS = 0x%x\n", uregs[R_GS]);
+ printf("R_ES = 0x%x\n", uregs[R_ES]);
+ printf("R_DS = 0x%x\n", uregs[R_DS]);
+ printf("R_EDI = 0x%x\n", uregs[R_EDI]);
+ printf("R_ESI = 0x%x\n", uregs[R_ESI]);
+ printf("R_EBP = 0x%x\n", uregs[R_EBP]);
+ printf("R_EBX = 0x%x\n", uregs[R_EBX]);
+ printf("R_EDX = 0x%x\n", uregs[R_EDX]);
+ printf("R_ECX = 0x%x\n", uregs[R_ECX]);
+ printf("R_EAX = 0x%x\n", uregs[R_EAX]);
+ printf("R_TRAPNO = 0x%x\n", uregs[R_TRAPNO]);
+ printf("R_ERR = 0x%x\n", uregs[R_ERR]);
+ printf("R_EIP = 0x%x\n", uregs[R_EIP]);
+ printf("R_CS = 0x%x\n", uregs[R_CS]);
+ printf("R_EFL = 0x%x\n", uregs[R_EFL]);
+ printf("R_UESP = 0x%x\n", uregs[R_UESP]);
+ printf("R_SS = 0x%x\n", uregs[R_SS]);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d
new file mode 100644
index 000000000000..f14c8afc8cad
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * ASSERTION:
+ * On IA/32, there is a single 32-bit address space that is partitioned
+ * between user-level and kernel-level. copyin()/copyinstr() and
+ * copyout()/copyoutstr() must check that addresses specified as
+ * user-level addresses are actually at user-level. This test attempts
+ * to perform an illegal copyin() from a kernel address. It asserts that
+ * the fault type is DTRACEFLT_BADADDR and that the bad address is set to
+ * the kernel address from which the copyin() was attempted.
+ *
+ * SECTION: Actions and Subroutines/copyin();
+ * Actions and Subroutines/copyin();
+ * User Process Tracing/copyin() and copyinstr()
+ */
+
+BEGIN
+{
+ dtrace_zero = copyin((uintptr_t)&`dtrace_zero, sizeof (int));
+ exit(1);
+}
+
+ERROR
+{
+ exit(arg4 == DTRACEFLT_BADADDR &&
+ arg5 == (uint64_t)&`dtrace_zero ? 0 : 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyinstr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyinstr.d
new file mode 100644
index 000000000000..ac049936ee64
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyinstr.d
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * On IA/32, there is a single 32-bit address space that is partitioned
+ * between user-level and kernel-level. copyin()/copyinstr() and
+ * copyout()/copyoutstr() must check that addresses specified as
+ * user-level addresses are actually at user-level. This test attempts
+ * to perform an illegal copyinstr() from a kernel address. It asserts
+ * that the fault type is DTRACEFLT_BADADDR and that the bad address is
+ * set to the kernel address from which the copyinstr() was attempted.
+ *
+ * SECTION: Actions and Subroutines/copyinstr();
+ * User Process Tracing/copyin() and copyinstr()
+ */
+
+BEGIN
+{
+ os = copyinstr((uintptr_t)&`utsname);
+ exit(1);
+}
+
+ERROR
+{
+ exit(arg4 == DTRACEFLT_BADADDR && arg5 == (uint64_t)&`utsname ? 0 : 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyout.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyout.d
new file mode 100644
index 000000000000..8909cd3af2e6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyout.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * On IA/32, there is a single 32-bit address space that is partitioned
+ * between user-level and kernel-level. copyin()/copyinstr() and
+ * copyout()/copyoutstr() must check that addresses specified as
+ * user-level addresses are actually at user-level. This test attempts
+ * to perform an illegal copyout() to a kernel address. It asserts that
+ * the fault type is DTRACEFLT_BADADDR and that the bad address is set to
+ * the kernel address to which the copyout() was attempted.
+ *
+ * SECTION: Actions and Subroutines/copyout()
+ *
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ this->a = (uint32_t *)alloca(4);
+ *this->a = -1;
+ copyout(this->a, (uintptr_t)&`clock, 4);
+ exit(1);
+}
+
+ERROR
+{
+ exit(arg4 == DTRACEFLT_BADADDR && arg5 == (uint64_t)&`clock ? 0 : 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d
new file mode 100644
index 000000000000..d7166cd25674
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * On IA/32, there is a single 32-bit address space that is partitioned
+ * between user-level and kernel-level. copyin()/copyinstr() and
+ * copyout()/copyoutstr() must check that addresses specified as
+ * user-level addresses are actually at user-level. This test attempts
+ * to perform an illegal copyoutstr() to a kernel address. It asserts
+ * that the fault type is DTRACEFLT_BADADDR and that the bad address is
+ * set to the kernel address to which the copyoutstr() was attempted.
+ *
+ * SECTION: Actions and Subroutines/copyoutstr()
+ *
+ */
+
+#pragma D option destructive
+
+BEGIN
+{
+ this->str = alloca(10);
+ bcopy("kablammo!", this->str, 10);
+ copyoutstr(this->str, (uintptr_t)&`clock, 10);
+ exit(1);
+}
+
+ERROR
+{
+ exit(arg4 == DTRACEFLT_BADADDR && arg5 == (uint64_t)&`clock ? 0 : 1);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d
new file mode 100644
index 000000000000..50753b8a1899
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Make sure that DTrace doesn't explode on an invalid instruction.
+ */
+
+pid$1:a.out:badfunc:entry
+{
+}
+
+BEGIN
+{
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s
new file mode 100644
index 000000000000..27f7f991635b
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s
@@ -0,0 +1,41 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(badfunc)
+ .byte 0xff
+ .byte 0xff
+ SET_SIZE(badfunc)
+
+ ENTRY(main)
+1: jmp 1b
+ SET_SIZE(main)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.d
new file mode 100644
index 000000000000..cfcf0a715d1a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * SECTION:
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option destructive
+
+pid$1:a.out:waiting:entry
+{
+ this->a = (char *)alloca(1);
+ *this->a = 1;
+ copyout(this->a, arg0, 1);
+}
+
+pid$1:a.out:main:,
+pid$1:a.out:other:
+{
+}
+
+pid$1:a.out:bad:entry
+{
+ exit(1);
+}
+
+syscall::rexit:entry
+/pid == $1/
+{
+ exit(0);
+}
+
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.s b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.s
new file mode 100644
index 000000000000..82a58920814f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.s
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(waiting)
+ pushl %ebp
+ movl %esp, %ebp
+ movl 8(%ebp), %eax
+ movl (%eax), %eax
+ popl %ebp
+ ret
+ SET_SIZE(waiting)
+
+ ENTRY(main)
+ pushl %ebp
+ movl %esp, %ebp
+ subl $0x4, %esp
+ movl $0x0, -4(%ebp)
+
+1:
+ leal -4(%ebp), %eax
+ pushl %eax
+ call waiting
+ addl $0x4, %esp
+
+ testl %eax, %eax
+ jz 1b
+
+ addl $0x4, %esp
+
+ xorl %eax, %eax
+ testl %eax, %eax
+ jz other
+
+ ALTENTRY(bad)
+ movl 0x0, %eax
+ SET_SIZE(bad)
+ SET_SIZE(main)
+
+ ENTRY(other)
+ xorl %eax, %eax
+ popl %ebp
+ ret
+ SET_SIZE(other)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.d
new file mode 100644
index 000000000000..c484c3f0c721
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * SECTION:
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option destructive
+
+pid$1:a.out:waiting:entry
+{
+ this->a = (char *)alloca(1);
+ *this->a = 1;
+ copyout(this->a, arg0, 1);
+}
+
+pid$1:a.out:main:,
+pid$1:a.out:inner:
+{
+}
+
+syscall::rexit:entry
+/pid == $1/
+{
+ exit(0);
+}
+
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.s b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.s
new file mode 100644
index 000000000000..134a5aff06d5
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.s
@@ -0,0 +1,68 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(waiting)
+ pushl %ebp
+ movl %esp, %ebp
+ movl 8(%ebp), %eax
+ movl (%eax), %eax
+ popl %ebp
+ ret
+ SET_SIZE(waiting)
+
+ ENTRY(main)
+ pushl %ebp
+ movl %esp, %ebp
+ subl $0x4, %esp
+ movl $0x0, -4(%ebp)
+1:
+ leal -4(%ebp), %eax
+ pushl %eax
+ call waiting
+ addl $0x4, %esp
+
+ testl %eax, %eax
+ jz 1b
+
+ addl $0x4, %esp
+
+ ALTENTRY(inner)
+ nop
+ nop
+ nop
+ SET_SIZE(inner)
+
+ xorl %eax, %eax
+ popl %ebp
+ ret
+ SET_SIZE(main)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.d
new file mode 100644
index 000000000000..358466fe5456
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.d
@@ -0,0 +1,76 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Validated the emulation of various flavors of the return
+ * instruction.
+ */
+
+#pragma D option destructive
+
+pid$1:a.out:waiting:entry
+{
+ this->a = (char *)alloca(1);
+ *this->a = 1;
+ copyout(this->a, arg0, 1);
+}
+
+pid$1:a.out:ret*:
+{
+ printf("%%sp = %x", uregs[R_SP]);
+}
+
+pid$1:a.out:ret*:return
+{
+}
+
+pid$1:a.out:done:entry
+{
+ exit(0);
+}
+
+pid$1:a.out:main:return
+{
+ printf("%%eax = %x", uregs[R_EAX]);
+}
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.s b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.s
new file mode 100644
index 000000000000..bccdb1a36b34
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.s
@@ -0,0 +1,114 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(ret1)
+ ret
+ SET_SIZE(ret1)
+
+ ENTRY(ret2)
+ repz
+ ret
+ SET_SIZE(ret2)
+
+ ENTRY(ret3)
+ ret $0
+ SET_SIZE(ret3)
+
+ ENTRY(ret4)
+ repz
+ ret $0
+ SET_SIZE(ret4)
+
+ ENTRY(ret5)
+ pushl (%esp)
+ ret $4
+ SET_SIZE(ret5)
+
+ ENTRY(ret6)
+ pushl (%esp)
+ repz
+ ret $4
+ SET_SIZE(ret6)
+
+ ENTRY(waiting)
+ pushl %ebp
+ movl %esp, %ebp
+ movl 8(%ebp), %eax
+ movl (%eax), %eax
+ movl %ebp, %esp
+ popl %ebp
+ ret
+ SET_SIZE(waiting)
+
+ ENTRY(main)
+ pushl %ebp
+ movl %esp, %ebp
+ subl $0x4, %esp
+ movl $0x0, -4(%ebp)
+
+1:
+ leal -4(%ebp), %eax
+ pushl %eax
+ call waiting
+ addl $0x4, %esp
+
+ testl %eax, %eax
+ jz 1b
+
+ movl %esp, %esi
+
+ call ret1
+ call ret2
+ call ret3
+ call ret4
+ call ret5
+ call ret6
+
+ cmpl %esp, %esi
+ jne 1f
+
+ ALTENTRY(done)
+ nop
+ SET_SIZE(done)
+
+ movl $0, %eax
+ movl %ebp, %esp
+ popl %ebp
+ ret
+
+1:
+ movl $1, %eax
+ movl %ebp, %esp
+ popl %ebp
+ ret
+ SET_SIZE(main)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh
new file mode 100644
index 000000000000..5477f5c9f6c3
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh
@@ -0,0 +1,50 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+# Make sure we can match against 2-byte rets
+
+./tst.retlist.exe&
+PID=$!
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+match=`$dtrace -l -n pid$PID:a.out:simple: -n pid$PID:a.out:complex: | wc -l`
+
+kill $PID
+
+if [ "$match" -ne 12 ]; then
+ echo wrong number of matched probes: $match
+ exit 1
+fi
+
+exit 0
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.s b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.s
new file mode 100644
index 000000000000..e85e9f5c8291
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.s
@@ -0,0 +1,51 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(simple)
+ repz
+ ret
+ SET_SIZE(simple)
+
+ ENTRY(complex)
+ pushl %ebp
+ movl %esp, %ebp
+ movl 8(%ebp), %eax
+ movl (%eax), %eax
+ popl %ebp
+ repz
+ ret
+ SET_SIZE(complex)
+
+ ENTRY(main)
+1: jmp 1b
+ SET_SIZE(main)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/annotated_helper.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/annotated_helper.d
new file mode 100644
index 000000000000..3b977097c683
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/annotated_helper.d
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+dtrace:helper:ustack:
+{
+ "@it's annotated"
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/helper_helper.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/helper_helper.d
new file mode 100644
index 000000000000..8abc47d006dc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/helper_helper.d
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+dtrace:helper:ustack:
+{
+ "<it's working>"
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.c
new file mode 100644
index 000000000000..8cdf8abad5af
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.c
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+int
+baz(void)
+{
+ return (8);
+}
+
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ baz();
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d
new file mode 100644
index 000000000000..dd795bece03f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d
@@ -0,0 +1,35 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+pid$1:a.out:baz:entry
+{
+ ustack(1, 1024);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d.out
new file mode 100644
index 000000000000..806d6a2b43dc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d.out
@@ -0,0 +1,4 @@
+
+ tst.annotated.exe`baz
+ [ it's annotated ]
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.d
new file mode 100644
index 000000000000..78218bd72aea
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+syscall::getpid:entry
+/pid == $1/
+{
+ @[ustackdepth] = count();
+}
+
+ERROR
+/arg4 == DTRACEFLT_BADSTACK/
+{
+ exit(0);
+}
+
+profile:::tick-1s
+/++n == 10/
+{
+ exit(1)
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s
new file mode 100644
index 000000000000..3bf7c0bf4313
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .long 0
+
+ ENTRY(main)
+ pushl %ebp
+ movl %esp, %ebp
+ movl %esp, (%ebp)
+loop:
+ call getpid
+ jmp loop
+ leave
+ ret
+ SET_SIZE(main)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.c
new file mode 100644
index 000000000000..69ab6a85a417
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.c
@@ -0,0 +1,82 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <strings.h>
+
+int
+baz(void)
+{
+ return (8);
+}
+
+static int
+foo(void)
+{
+ /*
+ * In order to assure that our helper is properly employed to identify
+ * the frame, we're going to trampoline through data.
+ */
+ uint8_t instr[] = {
+ 0x55, /* pushl %ebp */
+ 0x8b, 0xec, /* movl %esp, %ebp */
+ 0xe8, 0x0, 0x0, 0x0, 0x0, /* call baz */
+ 0x8b, 0xe5, /* movl %ebp, %esp */
+ 0x5d, /* popl %ebp */
+ 0xc3 /* ret */
+ };
+ uint8_t *fp = malloc(sizeof (instr));
+
+ /*
+ * Do our little relocation dance.
+ */
+ *((int *)&instr[4]) = (uintptr_t)baz - (uintptr_t)&fp[8];
+
+ /*
+ * Copy the code to the heap (it's a pain to build in ON with an
+ * executable stack).
+ */
+ bcopy(instr, fp, sizeof (instr));
+
+ (*(int (*)(void))fp)();
+
+ free(fp);
+
+ return (0);
+}
+
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ foo();
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.d
new file mode 100644
index 000000000000..ce2b9b30f14f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * SECTION:
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+pid$1:a.out:baz:entry
+{
+ ustack(2, 1024);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.d.out
new file mode 100644
index 000000000000..29646288e7ac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.d.out
@@ -0,0 +1,4 @@
+
+ tst.helper.exe`baz
+ <it's working>
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.basic.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.basic.ksh
new file mode 100755
index 000000000000..3a5ce6f0d064
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.basic.ksh
@@ -0,0 +1,77 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# ASSERTION: Make sure that we can map in and read the Xen trace buffers.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+#
+# Do not fail the test in a domU
+#
+if [ ! -c /dev/xen/privcmd ]; then
+ exit 0
+fi
+
+dtrace=$1
+
+script()
+{
+ $dtrace -qs /dev/stdin <<EOF
+ xdt:sched::on-cpu
+ /arg0 == 0/
+ {
+ self->on++;
+ }
+
+ xdt:sched::off-cpu
+ /arg0 == 0 && self->on/
+ {
+ self->off++;
+ }
+
+ xdt:sched::off-cpu
+ /self->on > 50 && self->off > 50/
+ {
+ exit(0);
+ }
+
+ profile:::tick-1sec
+ /n++ > 10/
+ {
+ exit(1);
+ }
+EOF
+}
+
+script
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.hvmenable.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.hvmenable.ksh
new file mode 100755
index 000000000000..3719c2026545
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.hvmenable.ksh
@@ -0,0 +1,64 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+#
+# ASSERTION: HVM probes should enable successfully.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+#
+# Do not fail the test in a domU
+#
+if [ ! -c /dev/xen/privcmd ]; then
+ exit 0
+fi
+
+dtrace=$1
+
+script()
+{
+ $dtrace -qs /dev/stdin <<EOF
+ dtrace:::BEGIN
+ {
+ exit(0);
+ }
+
+ xdt:hvm::vmentry,
+ xdt:hvm::vmexit
+ {}
+EOF
+}
+
+script
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.memenable.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.memenable.ksh
new file mode 100755
index 000000000000..25d39cbfbc86
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.memenable.ksh
@@ -0,0 +1,65 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+#
+# ASSERTION: Mem probes should enable successfully.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+#
+# Do not fail the test in a domU
+#
+if [ ! -c /dev/xen/privcmd ]; then
+ exit 0
+fi
+
+dtrace=$1
+
+script()
+{
+ $dtrace -qs /dev/stdin <<EOF
+ dtrace:::BEGIN
+ {
+ exit(0);
+ }
+
+ xdt:mem::page-grant-map,
+ xdt:mem::page-grant-unmap,
+ xdt:mem::page-grant-transfer
+ {}
+EOF
+}
+
+script
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh
new file mode 100755
index 000000000000..5b14fc989138
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh
@@ -0,0 +1,121 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# ASSERTION: Sched probe arguments should be valid.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+#
+# do not fail test in a domU
+#
+if [ ! -c /dev/xen/privcmd ]; then
+ exit 0
+fi
+
+dtrace=$1
+outf=/tmp/sched.args.$$
+
+script()
+{
+ $dtrace -c '/usr/bin/sleep 10' -o $outf -qs /dev/stdin <<EOF
+ xdt:sched::off-cpu,
+ xdt:sched::on-cpu,
+ xdt:sched::block,
+ xdt:sched::sleep,
+ xdt:sched::wake,
+ xdt:sched::yield
+ {
+ /* print domid vcpu pcpu probename */
+ printf("%d %d %d %s\n", arg0, arg1, \`xdt_curpcpu, probename);
+ }
+EOF
+}
+
+validate()
+{
+ /usr/bin/nawk '
+ BEGIN {
+ while (("/usr/sbin/xm vcpu-list" | getline)) {
+ if ($1 != "Name") {
+ domid = $2
+ vcpu = $3
+
+ vcpumap[domid, vcpu] = 1
+
+ split($7, affinity, ",")
+ for (i in affinity) {
+ if (split(affinity[i], p, "-") > 1) {
+ for (pcpu = p[1]; pcpu <= p[2];\
+ pcpu++) {
+ cpumap[domid, vcpu,
+ pcpu] = 1
+ }
+ } else {
+ cpumap[domid, vcpu,
+ affinity[i]] = 1
+ }
+ }
+ }
+ }
+ }
+
+ /^$/ { next }
+
+ /wake/ {
+ if (vcpumap[$1, $2]) {
+ next
+ } else {
+ print "error: " $0
+ exit 1
+ }
+ }
+
+ {
+ if (cpumap[$1, $2, "any"] || cpumap[$1, $2, $3]) {
+ next
+ } else {
+ print "error: " $0
+ exit 1
+ }
+ }
+ ' $outf
+}
+
+script
+status=$?
+
+if [ $status == 0 ]; then
+ validate
+ status=$?
+fi
+
+rm $outf
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedenable.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedenable.ksh
new file mode 100755
index 000000000000..54c3352ea525
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedenable.ksh
@@ -0,0 +1,74 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+#
+# ASSERTION: Sched probes should enable successfully.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+#
+# do not fail test in a domU
+#
+if [ ! -c /dev/xen/privcmd ]; then
+ exit 0
+fi
+
+dtrace=$1
+
+script()
+{
+ $dtrace -qs /dev/stdin <<EOF
+ dtrace:::BEGIN
+ {
+ exit(0);
+ }
+
+ xdt:sched::off-cpu,
+ xdt:sched::on-cpu,
+ xdt:sched::idle-off-cpu,
+ xdt:sched::idle-on-cpu,
+ xdt:sched::block,
+ xdt:sched::sleep,
+ xdt:sched::wake,
+ xdt:sched::yield,
+ xdt:sched::shutdown-poweroff,
+ xdt:sched::shutdown-reboot,
+ xdt:sched::shutdown-suspend,
+ xdt:sched::shutdown-crash
+ {}
+EOF
+}
+
+script
+status=$?
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/arrays/tst.uregsarray.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/arrays/tst.uregsarray.d
new file mode 100644
index 000000000000..3ef38983ad52
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/arrays/tst.uregsarray.d
@@ -0,0 +1,85 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+
+/*
+ * ASSERTION:
+ * Positive test to make sure that we can invoke sparc
+ * ureg[] aliases.
+ *
+ * SECTION: User Process Tracing/uregs Array
+ *
+ * NOTES: This test does no verification - the value of the output
+ * is not deterministic.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("R_G0 = 0x%x\n", uregs[R_G0]);
+ printf("R_G1 = 0x%x\n", uregs[R_G1]);
+ printf("R_G2 = 0x%x\n", uregs[R_G2]);
+ printf("R_G3 = 0x%x\n", uregs[R_G3]);
+ printf("R_G4 = 0x%x\n", uregs[R_G4]);
+ printf("R_G5 = 0x%x\n", uregs[R_G5]);
+ printf("R_G6 = 0x%x\n", uregs[R_G6]);
+ printf("R_G7 = 0x%x\n", uregs[R_G7]);
+ printf("R_O0 = 0x%x\n", uregs[R_O0]);
+ printf("R_O1 = 0x%x\n", uregs[R_O1]);
+ printf("R_O2 = 0x%x\n", uregs[R_O2]);
+ printf("R_O3 = 0x%x\n", uregs[R_O3]);
+ printf("R_O4 = 0x%x\n", uregs[R_O4]);
+ printf("R_O5 = 0x%x\n", uregs[R_O5]);
+ printf("R_O6 = 0x%x\n", uregs[R_O6]);
+ printf("R_O7 = 0x%x\n", uregs[R_O7]);
+ printf("R_L0 = 0x%x\n", uregs[R_L0]);
+ printf("R_L1 = 0x%x\n", uregs[R_L1]);
+ printf("R_L2 = 0x%x\n", uregs[R_L2]);
+ printf("R_L3 = 0x%x\n", uregs[R_L3]);
+ printf("R_L4 = 0x%x\n", uregs[R_L4]);
+ printf("R_L5 = 0x%x\n", uregs[R_L5]);
+ printf("R_L6 = 0x%x\n", uregs[R_L6]);
+ printf("R_L7 = 0x%x\n", uregs[R_L7]);
+ printf("R_I0 = 0x%x\n", uregs[R_I0]);
+ printf("R_I1 = 0x%x\n", uregs[R_I1]);
+ printf("R_I2 = 0x%x\n", uregs[R_I2]);
+ printf("R_I3 = 0x%x\n", uregs[R_I3]);
+ printf("R_I4 = 0x%x\n", uregs[R_I4]);
+ printf("R_I5 = 0x%x\n", uregs[R_I5]);
+ printf("R_I6 = 0x%x\n", uregs[R_I6]);
+ printf("R_I7 = 0x%x\n", uregs[R_I7]);
+ printf("R_CCR = 0x%x\n", uregs[R_CCR]);
+ printf("R_PC = 0x%x\n", uregs[R_PC]);
+ printf("R_NPC = 0x%x\n", uregs[R_NPC]);
+ printf("R_Y = 0x%x\n", uregs[R_Y]);
+ printf("R_ASI = 0x%x\n", uregs[R_ASI]);
+ printf("R_FPRS = 0x%x\n", uregs[R_FPRS]);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.d
new file mode 100644
index 000000000000..3e4662740816
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.d
@@ -0,0 +1,40 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: On SPARC, you can't trace misaligned offsets
+ *
+ * SECTION: User Process Tracing/pid Provider
+ *
+ * NOTES:
+ *
+ */
+
+pid$1:a.out:main:7
+{
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.exe b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.exe
new file mode 100644
index 000000000000..595db1de33da
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.exe
@@ -0,0 +1,29 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#ident "%Z%%M% %I% %E% SMI"
+
+sleep 1000000
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.d
new file mode 100644
index 000000000000..cf1dc02ec47c
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.d
@@ -0,0 +1,70 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION: Trace all instructions in the function 'test' to verify that
+ * the branches are emulated correctly.
+ */
+
+#pragma D option destructive
+#pragma D option quiet
+
+pid$1:a.out:waiting:entry
+{
+ this->a = (char *)alloca(1);
+ *this->a = 1;
+ copyout(this->a, arg0, 1);
+}
+
+pid$1:a.out:test:
+{
+ printf("%s:%s\n", probefunc, probename);
+}
+
+syscall::rexit:entry
+/pid == $1/
+{
+ exit(0);
+}
+
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.d.out
new file mode 100644
index 000000000000..8559271e4aac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.d.out
@@ -0,0 +1,23 @@
+test:entry
+test:0
+test:4
+test:8
+test:c
+test:10
+test:14
+test:18
+test:1c
+test:20
+test:24
+test:28
+test:2c
+test:30
+test:34
+test:38
+test:3c
+test:40
+test:44
+test:48
+test:4c
+test:return
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.s b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.s
new file mode 100644
index 000000000000..dfa7d27074f2
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.s
@@ -0,0 +1,81 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .word 0
+
+ ENTRY(waiting)
+ retl
+ ldub [%o0], %o0
+ SET_SIZE(waiting)
+
+ ENTRY(test)
+ mov 1, %g1
+
+ brz %g1, 1f
+ nop
+ brlez %g1, 1f
+ nop
+ brlz %g0, 1f
+ nop
+ brlz %g1, 1f
+ nop
+ brnz %g0, 1f
+ sub %g0, 2, %g1
+ brgz %g1, 1f
+ nop
+ brgz %g0, 1f
+ nop
+ brgez %g1, 1f
+ nop
+
+ mov %g1, %o0
+
+1:
+ retl
+ nop
+ SET_SIZE(test)
+
+ ENTRY(main)
+ save %sp, -SA(MINFRAME + 4), %sp
+ stb %g0, [%fp - 4]
+1:
+ call waiting
+ sub %fp, 4, %o0
+ tst %o0
+ bz 1b
+ nop
+
+ call test
+ nop
+
+ ret
+ restore %g0, %g0, %o0
+ SET_SIZE(main)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.d
new file mode 100644
index 000000000000..cfcf0a715d1a
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.d
@@ -0,0 +1,78 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * SECTION:
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option destructive
+
+pid$1:a.out:waiting:entry
+{
+ this->a = (char *)alloca(1);
+ *this->a = 1;
+ copyout(this->a, arg0, 1);
+}
+
+pid$1:a.out:main:,
+pid$1:a.out:other:
+{
+}
+
+pid$1:a.out:bad:entry
+{
+ exit(1);
+}
+
+syscall::rexit:entry
+/pid == $1/
+{
+ exit(0);
+}
+
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.s b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.s
new file mode 100644
index 000000000000..3e6531f32190
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.s
@@ -0,0 +1,63 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .word 0
+
+ ENTRY(waiting)
+ retl
+ ldub [%o0], %o0
+ SET_SIZE(waiting)
+
+ ENTRY(main)
+ save %sp, -SA(MINFRAME + 4), %sp
+ stb %g0, [%fp - 4]
+1:
+ call waiting
+ sub %fp, 4, %o0
+ tst %o0
+ bz 1b
+ nop
+
+ restore
+
+ tst %g0
+ be other
+ nop
+
+ ALTENTRY(bad)
+ illtrap
+ SET_SIZE(bad)
+ SET_SIZE(main)
+
+ ENTRY(other)
+ retl
+ clr %o0
+ SET_SIZE(other)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.d
new file mode 100644
index 000000000000..c484c3f0c721
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.d
@@ -0,0 +1,73 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * SECTION:
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option destructive
+
+pid$1:a.out:waiting:entry
+{
+ this->a = (char *)alloca(1);
+ *this->a = 1;
+ copyout(this->a, arg0, 1);
+}
+
+pid$1:a.out:main:,
+pid$1:a.out:inner:
+{
+}
+
+syscall::rexit:entry
+/pid == $1/
+{
+ exit(0);
+}
+
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.s b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.s
new file mode 100644
index 000000000000..612f0b926142
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.s
@@ -0,0 +1,59 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .word 0
+
+ ENTRY(waiting)
+ retl
+ ldub [%o0], %o0
+ SET_SIZE(waiting)
+
+ ENTRY(main)
+ save %sp, -SA(MINFRAME + 4), %sp
+ stb %g0, [%fp - 4]
+1:
+ call waiting
+ sub %fp, 4, %o0
+ tst %o0
+ bz 1b
+ nop
+
+ restore
+
+ ALTENTRY(inner)
+ nop
+ nop
+ nop
+ SET_SIZE(inner)
+
+ retl
+ clr %o0
+ SET_SIZE(main)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh
new file mode 100644
index 000000000000..c3651ecf7eb4
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh
@@ -0,0 +1,132 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# ASSERTION: Make sure USDT probes work as tail-calls on SPARC.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.s <<EOF
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .word 0
+
+ ENTRY(test)
+ save %sp, -SA(MINFRAME + 4), %sp
+ mov 9, %i0
+ mov 19, %i1
+ mov 2006, %i2
+ call __dtrace_test___fire
+ restore
+ SET_SIZE(test)
+
+ ENTRY(main)
+ save %sp, -SA(MINFRAME + 4), %sp
+
+1:
+ call test
+ nop
+
+ ba 1b
+ nop
+
+ ret
+ restore %g0, %g0, %o0
+ SET_SIZE(main)
+EOF
+
+cat > prov.d <<EOF
+provider test {
+ probe fire(int, int, int);
+};
+EOF
+
+/usr/bin/as -xregsym=no -P -D_ASM -o test.o test.s
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.s"
+ exit 1
+fi
+
+$dtrace -G -32 -s prov.d test.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to create DOF"
+ exit 1
+fi
+
+cc -o test test.o prov.o
+if [ $? -ne 0 ]; then
+ print -u2 "failed to link final executable"
+ exit 1
+fi
+
+$dtrace -c ./test -s /dev/stdin <<EOF
+test\$target:::fire
+/arg0 == 9 && arg1 == 19 && arg2 == 2006/
+{
+ printf("%d/%d/%d", arg0, arg1, arg2);
+ exit(0);
+}
+
+test\$target:::fire
+{
+ printf("%d/%d/%d", arg0, arg1, arg2);
+ exit(1);
+}
+
+BEGIN
+{
+ /*
+ * Let's just do this for 5 seconds.
+ */
+ timeout = timestamp + 5000000000;
+}
+
+profile:::tick-4
+/timestamp > timeout/
+{
+ trace("test timed out");
+ exit(1);
+}
+EOF
+
+status=$?
+
+cd /
+/bin/rm -rf $DIR
+
+exit $status
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/annotated_helper.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/annotated_helper.d
new file mode 100644
index 000000000000..3577f86f8ee6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/annotated_helper.d
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ident "%Z%%M% %I% %E% SMI"
+
+dtrace:helper:ustack:
+{
+ "@it's annotated"
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/helper_helper.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/helper_helper.d
new file mode 100644
index 000000000000..8abc47d006dc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/helper_helper.d
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+dtrace:helper:ustack:
+{
+ "<it's working>"
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.c
new file mode 100644
index 000000000000..8cdf8abad5af
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.c
@@ -0,0 +1,43 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+int
+baz(void)
+{
+ return (8);
+}
+
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ baz();
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d
new file mode 100644
index 000000000000..dd795bece03f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d
@@ -0,0 +1,35 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#pragma D option quiet
+
+pid$1:a.out:baz:entry
+{
+ ustack(1, 1024);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d.out
new file mode 100644
index 000000000000..806d6a2b43dc
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d.out
@@ -0,0 +1,4 @@
+
+ tst.annotated.exe`baz
+ [ it's annotated ]
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.d
new file mode 100644
index 000000000000..78218bd72aea
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.d
@@ -0,0 +1,46 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+syscall::getpid:entry
+/pid == $1/
+{
+ @[ustackdepth] = count();
+}
+
+ERROR
+/arg4 == DTRACEFLT_BADSTACK/
+{
+ exit(0);
+}
+
+profile:::tick-1s
+/++n == 10/
+{
+ exit(1)
+}
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.s b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.s
new file mode 100644
index 000000000000..a5076c969d92
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.s
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/asm_linkage.h>
+
+ DGDEF(__fsr_init_value)
+ .word 0
+
+ ENTRY(main)
+ save %sp, -SA(MINFRAME), %sp
+ mov %sp, %fp
+loop:
+ call getpid
+ nop
+ ba loop
+ nop
+ ret
+ restore
+ SET_SIZE(main)
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.c
new file mode 100644
index 000000000000..fa4802acd5d6
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.c
@@ -0,0 +1,81 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <strings.h>
+
+int
+baz(void)
+{
+ return (8);
+}
+
+static int
+foo(void)
+{
+ /*
+ * In order to assure that our helper is properly employed to identify
+ * the frame, we're going to trampoline through data.
+ */
+ uint32_t instr[] = {
+ 0x9de3bfa0, /* save %sp, -0x60, %sp */
+ 0x40000000, /* call baz */
+ 0x01000000, /* nop */
+ 0x81c7e008, /* ret */
+ 0x81e80000 /* restore */
+ };
+ uint32_t *fp = malloc(sizeof (instr));
+
+ /*
+ * Do our little relocation dance.
+ */
+ instr[1] |= ((uintptr_t)baz - (uintptr_t)&fp[1]) >> 2;
+
+ /*
+ * Copy the code to the heap (it's a pain to build in ON with an
+ * executable stack).
+ */
+ bcopy(instr, fp, sizeof (instr));
+
+ (*(int (*)(void))fp)();
+
+ free(fp);
+
+ return (0);
+}
+
+int
+main(int argc, char **argv)
+{
+ for (;;) {
+ foo();
+ }
+
+ return (0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d
new file mode 100644
index 000000000000..ce2b9b30f14f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d
@@ -0,0 +1,44 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ *
+ * SECTION:
+ *
+ * NOTES:
+ *
+ */
+
+#pragma D option quiet
+
+pid$1:a.out:baz:entry
+{
+ ustack(2, 1024);
+ exit(0);
+}
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d.out
new file mode 100644
index 000000000000..29646288e7ac
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d.out
@@ -0,0 +1,4 @@
+
+ tst.helper.exe`baz
+ <it's working>
+
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.trapstat.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.trapstat.ksh
new file mode 100644
index 000000000000..84af8006768f
--- /dev/null
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.trapstat.ksh
@@ -0,0 +1,87 @@
+#/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+
+#
+# This script verifies that user-land stacks can be walked safely
+# when the trapstat(1M) utility is running. An arbitrary program, w(1),
+# is started once a second to ensure stacks can be walked at all stages
+# of the process lifecycle.
+#
+
+script()
+{
+ $dtrace -o $dtraceout -s /dev/stdin <<EOF
+ fbt:::
+ {
+ @[ustackdepth] = count();
+ }
+EOF
+}
+
+run_commands()
+{
+ cnt=0
+
+ while [ $cnt -lt 10 ]; do
+ w > /dev/null
+ sleep 1
+ cnt=$(($cnt+1))
+ done
+}
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+dtraceout=/tmp/dtrace.out.$$
+script 2>/dev/null &
+timeout=15
+
+#
+# Sleep while the above script fires into life. To guard against dtrace dying
+# and us sleeping forever we allow 15 secs for this to happen. This should be
+# enough for even the slowest systems.
+#
+while [ ! -f $dtraceout ]; do
+ sleep 1
+ timeout=$(($timeout-1))
+ if [ $timeout -eq 0 ]; then
+ echo "dtrace failed to start. Exiting."
+ exit 1
+ fi
+done
+
+run_commands &
+trapstat -t 1 10
+status=$?
+
+rm $dtraceout
+
+exit $status