From 144cd58d16b601d52d00c5a37c8e0226aa1ce55a Mon Sep 17 00:00:00 2001 From: John Birrell Date: Wed, 27 Aug 2008 04:41:15 +0000 Subject: [PATCH] MFC DTrace support. Note that this defaults the 'make buildkernel' to build with CTF data so that the release kernel and modules are DTrace-able. --- Makefile | 3 + Makefile.inc1 | 41 +- cddl/Makefile.inc | 12 +- cddl/compat/opensolaris/include/alloca.h | 70 + cddl/compat/opensolaris/include/dtrace.h | 74 + cddl/compat/opensolaris/include/fcntl.h | 74 + cddl/compat/opensolaris/include/libproc.h | 92 + cddl/compat/opensolaris/include/stdio.h | 78 + cddl/compat/opensolaris/include/stdlib.h | 74 + cddl/compat/opensolaris/include/strings.h | 74 + cddl/compat/opensolaris/include/unistd.h | 78 + cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 670 + cddl/contrib/opensolaris/cmd/dtrace/dtrace.c | 1898 ++ .../opensolaris/cmd/dtrace/test/README | 32 + .../cmd/dtrace/test/cmd/baddof/baddof.c | 209 + .../cmd/dtrace/test/cmd/badioctl/badioctl.c | 145 + .../cmd/dtrace/test/cmd/chkargs/chkargs.c | 148 + .../cmd/dtrace/test/cmd/jdtrace/Getopt.java | 453 + .../cmd/dtrace/test/cmd/jdtrace/JDTrace.java | 1042 + .../cmd/dtrace/test/cmd/jdtrace/exception.lst | 77 + .../cmd/dtrace/test/cmd/jdtrace/jdtrace.c | 60 + .../cmd/jdtrace/manifest/jdtrace.jar-manifest | 3 + .../cmd/dtrace/test/cmd/scripts/dstyle.pl | 236 + .../cmd/dtrace/test/cmd/scripts/dtest.pl | 705 + .../test/tst/common/aggs/err.D_AGG_FUNC.bad.d | 45 + .../test/tst/common/aggs/err.D_AGG_MDIM.bad.d | 45 + .../test/tst/common/aggs/err.D_AGG_NULL.bad.d | 44 + .../tst/common/aggs/err.D_AGG_REDEF.redef.d | 45 + .../common/aggs/err.D_AGG_SCALAR.avgtoofew.d | 43 + .../common/aggs/err.D_AGG_SCALAR.maxnoarg.d | 41 + .../common/aggs/err.D_AGG_SCALAR.mintoofew.d | 42 + .../aggs/err.D_AGG_SCALAR.quantizetoofew.d | 41 + .../common/aggs/err.D_AGG_SCALAR.sumtoofew.d | 42 + .../tst/common/aggs/err.D_CLEAR_AGGARG.bad.d | 77 + .../tst/common/aggs/err.D_CLEAR_PROTO.bad.d | 77 + .../tst/common/aggs/err.D_FUNC_IDENT.bad.d | 45 + .../common/aggs/err.D_FUNC_UNDEF.badaggfunc.d | 43 + .../common/aggs/err.D_IDENT_UNDEF.badexpr.d | 41 + .../common/aggs/err.D_IDENT_UNDEF.badkey3.d | 42 + .../common/aggs/err.D_IDENT_UNDEF.noeffect.d | 41 + .../tst/common/aggs/err.D_KEY_TYPE.badkey1.d | 41 + .../tst/common/aggs/err.D_KEY_TYPE.badkey2.d | 42 + .../tst/common/aggs/err.D_KEY_TYPE.badkey4.d | 44 + .../aggs/err.D_LQUANT_BASETYPE.lqbad1.d | 44 + .../aggs/err.D_LQUANT_BASETYPE.lqshort.d | 44 + .../common/aggs/err.D_LQUANT_BASEVAL.bad.d | 43 + .../common/aggs/err.D_LQUANT_LIMTYPE.lqbad1.d | 45 + .../tst/common/aggs/err.D_LQUANT_LIMVAL.bad.d | 44 + .../tst/common/aggs/err.D_LQUANT_MATCHBASE.d | 33 + .../aggs/err.D_LQUANT_MATCHBASE.order.d | 33 + .../tst/common/aggs/err.D_LQUANT_MATCHLIM.d | 33 + .../common/aggs/err.D_LQUANT_MATCHLIM.order.d | 33 + .../tst/common/aggs/err.D_LQUANT_MATCHSTEP.d | 33 + .../aggs/err.D_LQUANT_MISMATCH.lqbadarg.d | 55 + .../aggs/err.D_LQUANT_STEPLARGE.lqtoofew.d | 42 + .../common/aggs/err.D_LQUANT_STEPSMALL.bad.d | 55 + .../aggs/err.D_LQUANT_STEPTYPE.lqbadinc.d | 56 + .../common/aggs/err.D_LQUANT_STEPVAL.bad.d | 56 + .../common/aggs/err.D_NORMALIZE_AGGARG.bad.d | 65 + .../common/aggs/err.D_NORMALIZE_PROTO.bad.d | 64 + .../common/aggs/err.D_NORMALIZE_SCALAR.bad.d | 64 + .../aggs/err.D_PROTO_ARG.lquantizetoofew.d | 42 + .../common/aggs/err.D_PROTO_LEN.avgnoarg.d | 44 + .../common/aggs/err.D_PROTO_LEN.avgtoomany.d | 44 + .../aggs/err.D_PROTO_LEN.counttoomany.d | 41 + .../aggs/err.D_PROTO_LEN.lquantizenoarg.d | 42 + .../aggs/err.D_PROTO_LEN.lquantizetoomany.d | 40 + .../common/aggs/err.D_PROTO_LEN.maxnoarg.d | 41 + .../common/aggs/err.D_PROTO_LEN.maxtoomany.d | 41 + .../common/aggs/err.D_PROTO_LEN.minnoarg.d | 41 + .../common/aggs/err.D_PROTO_LEN.mintoomany.d | 42 + .../aggs/err.D_PROTO_LEN.quantizenoarg.d | 42 + .../aggs/err.D_PROTO_LEN.quantizetoomany.d | 41 + .../common/aggs/err.D_PROTO_LEN.sumnoarg.d | 41 + .../common/aggs/err.D_PROTO_LEN.sumtoomany.d | 41 + .../tst/common/aggs/err.D_TRUNC_AGGARG.bad.d | 35 + .../common/aggs/err.D_TRUNC_PROTO.badmany.d | 34 + .../common/aggs/err.D_TRUNC_PROTO.badnone.d | 33 + .../tst/common/aggs/err.D_TRUNC_SCALAR.bad.d | 34 + .../test/tst/common/aggs/tst.allquant.d | 46 + .../test/tst/common/aggs/tst.allquant.d.out | 131 + .../cmd/dtrace/test/tst/common/aggs/tst.avg.d | 57 + .../dtrace/test/tst/common/aggs/tst.avg.d.out | 2 + .../dtrace/test/tst/common/aggs/tst.avg_neg.d | 46 + .../test/tst/common/aggs/tst.avg_neg.d.out | 2 + .../dtrace/test/tst/common/aggs/tst.clear.d | 75 + .../test/tst/common/aggs/tst.clear.d.out | 22 + .../test/tst/common/aggs/tst.clearavg.d | 60 + .../test/tst/common/aggs/tst.clearavg.d.out | 2 + .../test/tst/common/aggs/tst.clearavg2.d | 63 + .../test/tst/common/aggs/tst.clearavg2.d.out | 16 + .../tst/common/aggs/tst.cleardenormalize.d | 78 + .../common/aggs/tst.cleardenormalize.d.out | 22 + .../test/tst/common/aggs/tst.clearlquantize.d | 67 + .../tst/common/aggs/tst.clearlquantize.d.out | 94 + .../test/tst/common/aggs/tst.clearnormalize.d | 77 + .../tst/common/aggs/tst.clearnormalize.d.out | 22 + .../dtrace/test/tst/common/aggs/tst.count.d | 44 + .../test/tst/common/aggs/tst.count.d.out | 2 + .../dtrace/test/tst/common/aggs/tst.count2.d | 54 + .../test/tst/common/aggs/tst.count2.d.out | 2 + .../dtrace/test/tst/common/aggs/tst.count3.d | 56 + .../test/tst/common/aggs/tst.denormalize.d | 63 + .../tst/common/aggs/tst.denormalize.d.out | 7 + .../tst/common/aggs/tst.denormalizeonly.d | 61 + .../tst/common/aggs/tst.denormalizeonly.d.out | 6 + .../test/tst/common/aggs/tst.fmtnormalize.d | 61 + .../tst/common/aggs/tst.fmtnormalize.d.out | 7 + .../dtrace/test/tst/common/aggs/tst.forms.d | 53 + .../test/tst/common/aggs/tst.forms.d.out | 6 + .../dtrace/test/tst/common/aggs/tst.goodkey.d | 55 + .../dtrace/test/tst/common/aggs/tst.keysort.d | 108 + .../test/tst/common/aggs/tst.keysort.d.out | 160 + .../test/tst/common/aggs/tst.lquantize.d | 57 + .../test/tst/common/aggs/tst.lquantize.d.out | 61 + .../test/tst/common/aggs/tst.lquantnormal.d | 51 + .../tst/common/aggs/tst.lquantnormal.d.out | 16 + .../test/tst/common/aggs/tst.lquantrange.d | 40 + .../tst/common/aggs/tst.lquantrange.d.out | 23 + .../test/tst/common/aggs/tst.lquantround.d | 57 + .../tst/common/aggs/tst.lquantround.d.out | 9 + .../test/tst/common/aggs/tst.lquantzero.d | 96 + .../test/tst/common/aggs/tst.lquantzero.d.out | 910 + .../cmd/dtrace/test/tst/common/aggs/tst.max.d | 58 + .../dtrace/test/tst/common/aggs/tst.max.d.out | 3 + .../dtrace/test/tst/common/aggs/tst.max_neg.d | 46 + .../test/tst/common/aggs/tst.max_neg.d.out | 2 + .../cmd/dtrace/test/tst/common/aggs/tst.min.d | 57 + .../dtrace/test/tst/common/aggs/tst.min.d.out | 2 + .../dtrace/test/tst/common/aggs/tst.min_neg.d | 46 + .../test/tst/common/aggs/tst.min_neg.d.out | 2 + .../test/tst/common/aggs/tst.multiaggs1.d | 66 + .../test/tst/common/aggs/tst.multiaggs2.d | 62 + .../test/tst/common/aggs/tst.multiaggs2.d.out | 36 + .../test/tst/common/aggs/tst.multiaggs3.d | 74 + .../test/tst/common/aggs/tst.multiaggs3.d.out | 37 + .../test/tst/common/aggs/tst.multinormalize.d | 65 + .../tst/common/aggs/tst.multinormalize.d.out | 15 + .../test/tst/common/aggs/tst.neglquant.d | 150 + .../test/tst/common/aggs/tst.neglquant.d.out | 64 + .../test/tst/common/aggs/tst.negorder.d | 85 + .../test/tst/common/aggs/tst.negorder.d.out | 376 + .../test/tst/common/aggs/tst.negquant.d | 115 + .../test/tst/common/aggs/tst.negquant.d.out | 55 + .../test/tst/common/aggs/tst.negtrunc.d | 49 + .../test/tst/common/aggs/tst.negtrunc.d.out | 11 + .../test/tst/common/aggs/tst.negtruncquant.d | 52 + .../tst/common/aggs/tst.negtruncquant.d.out | 46 + .../test/tst/common/aggs/tst.normalize.d | 60 + .../test/tst/common/aggs/tst.normalize.d.out | 7 + .../dtrace/test/tst/common/aggs/tst.order.d | 78 + .../test/tst/common/aggs/tst.order.d.out | 33 + .../test/tst/common/aggs/tst.quantize.d | 57 + .../test/tst/common/aggs/tst.quantize.d.out | 61 + .../test/tst/common/aggs/tst.quantmany.d | 56 + .../test/tst/common/aggs/tst.quantmany.d.out | 1208 ++ .../test/tst/common/aggs/tst.quantround.d | 57 + .../test/tst/common/aggs/tst.quantround.d.out | 9 + .../test/tst/common/aggs/tst.quantzero.d | 63 + .../test/tst/common/aggs/tst.quantzero.d.out | 146 + .../test/tst/common/aggs/tst.signature.d | 54 + .../test/tst/common/aggs/tst.signedkeys.d | 120 + .../test/tst/common/aggs/tst.signedkeys.d.out | 44 + .../test/tst/common/aggs/tst.signedkeyspos.d | 115 + .../tst/common/aggs/tst.signedkeyspos.d.out | 61 + .../dtrace/test/tst/common/aggs/tst.stddev.d | 64 + .../test/tst/common/aggs/tst.stddev.d.out | 3 + .../dtrace/test/tst/common/aggs/tst.subr.d | 112 + .../cmd/dtrace/test/tst/common/aggs/tst.sum.d | 57 + .../dtrace/test/tst/common/aggs/tst.sum.d.out | 2 + .../dtrace/test/tst/common/aggs/tst.trunc.d | 49 + .../test/tst/common/aggs/tst.trunc.d.out | 11 + .../dtrace/test/tst/common/aggs/tst.trunc0.d | 57 + .../test/tst/common/aggs/tst.trunc0.d.out | 7 + .../test/tst/common/aggs/tst.truncquant.d | 52 + .../test/tst/common/aggs/tst.truncquant.d.out | 46 + .../test/tst/common/aggs/tst.valsortkeypos.d | 49 + .../tst/common/aggs/tst.valsortkeypos.d.out | 4 + .../common/arithmetic/err.D_DIV_ZERO.divby0.d | 43 + .../arithmetic/err.D_DIV_ZERO.divby0_1.d | 45 + .../arithmetic/err.D_DIV_ZERO.divby0_2.d | 46 + .../common/arithmetic/err.D_DIV_ZERO.modby0.d | 44 + .../common/arithmetic/err.D_SYNTAX.addmin.d | 47 + .../common/arithmetic/err.D_SYNTAX.divmin.d | 46 + .../common/arithmetic/err.D_SYNTAX.muladd.d | 46 + .../common/arithmetic/err.D_SYNTAX.muldiv.d | 46 + .../test/tst/common/arithmetic/tst.basics.d | 66 + .../test/tst/common/arithmetic/tst.complex.d | 57 + .../tst/common/arrays/err.D_ARR_BADREF.bad.d | 42 + .../common/arrays/err.D_DECL_ARRBIG.toobig.d | 45 + .../common/arrays/err.D_DECL_ARRNULL.bad.d | 42 + .../tst/common/arrays/err.D_DECL_ARRSUB.bad.d | 42 + .../arrays/err.D_DECL_PROTO_TYPE.badtuple.d | 44 + .../common/arrays/err.D_IDENT_UNDEF.badureg.d | 42 + .../test/tst/common/arrays/tst.basic1.d | 56 + .../test/tst/common/arrays/tst.basic2.d | 57 + .../test/tst/common/arrays/tst.basic3.d | 56 + .../test/tst/common/arrays/tst.basic4.d | 56 + .../test/tst/common/arrays/tst.basic5.d | 59 + .../test/tst/common/arrays/tst.basic6.d | 58 + .../test/tst/common/arrays/tst.uregsarray.d | 51 + .../assocs/err.D_OP_INCOMPAT.dupgtype.d | 47 + .../assocs/err.D_OP_INCOMPAT.dupttype.d | 47 + .../common/assocs/err.D_OP_INCOMPAT.this.d | 48 + .../common/assocs/err.D_PROTO_ARG.badsig.d | 46 + .../common/assocs/err.D_PROTO_LEN.toofew.d | 46 + .../common/assocs/err.D_PROTO_LEN.toomany.d | 46 + .../common/assocs/err.D_SYNTAX.errassign.d | 45 + .../test/tst/common/assocs/err.tupoflow.d | 41 + .../test/tst/common/assocs/tst.cpyarray.d | 65 + .../test/tst/common/assocs/tst.diffprofile.d | 62 + .../test/tst/common/assocs/tst.initialize.d | 47 + .../test/tst/common/assocs/tst.invalidref.d | 75 + .../dtrace/test/tst/common/assocs/tst.misc.d | 69 + .../tst/common/assocs/tst.orthogonality.d | 51 + .../dtrace/test/tst/common/assocs/tst.this.d | 49 + .../tst/common/assocs/tst.valassign.d.out | 2 + .../tst/common/begin/err.D_PDESC_ZERO.begin.d | 44 + .../tst/common/begin/err.D_PDESC_ZERO.tick.d | 45 + .../dtrace/test/tst/common/begin/tst.begin.d | 55 + .../test/tst/common/begin/tst.begin.d.out | 5 + .../test/tst/common/begin/tst.multibegin.d | 60 + .../tst/common/begin/tst.multibegin.d.out | 6 + .../err.D_ADDROF_BITFIELD.BitfieldAddress.d | 50 + .../err.D_DECL_BFCONST.NegBitField.d | 46 + .../err.D_DECL_BFCONST.ZeroBitField.d | 46 + .../err.D_DECL_BFSIZE.ExceedBaseType.d | 53 + .../err.D_DECL_BFSIZE.GreaterThan64.d | 46 + .../bitfields/err.D_DECL_BFTYPE.badtype.d | 47 + .../bitfields/err.D_OFFSETOF_BITFIELD.d | 53 + .../err.D_SIZEOF_BITFIELD.SizeofBitfield.d | 49 + .../common/bitfields/tst.BitFieldPromotion.d | 60 + .../tst/common/bitfields/tst.SizeofBitField.d | 109 + .../test/tst/common/buffering/err.end.d | 54 + .../test/tst/common/buffering/err.resize1.d | 46 + .../test/tst/common/buffering/err.resize2.d | 47 + .../test/tst/common/buffering/err.resize3.d | 62 + .../test/tst/common/buffering/err.zerobuf.d | 43 + .../test/tst/common/buffering/tst.alignring.d | 81 + .../test/tst/common/buffering/tst.cputime.ksh | 90 + .../tst/common/buffering/tst.dynvarsize.d | 67 + .../test/tst/common/buffering/tst.fill1.d | 115 + .../test/tst/common/buffering/tst.fill1.d.out | 9 + .../test/tst/common/buffering/tst.resize1.d | 51 + .../test/tst/common/buffering/tst.resize2.d | 52 + .../test/tst/common/buffering/tst.resize3.d | 73 + .../test/tst/common/buffering/tst.ring1.d | 75 + .../test/tst/common/buffering/tst.ring2.d | 53 + .../test/tst/common/buffering/tst.ring2.d.out | 6 + .../test/tst/common/buffering/tst.ring3.d | 78 + .../test/tst/common/buffering/tst.ring3.d.out | 5 + .../test/tst/common/buffering/tst.smallring.d | 57 + .../test/tst/common/buffering/tst.switch1.d | 69 + .../tst/common/buffering/tst.switch1.d.out | 11 + .../builtinvar/err.D_XLATE_NOCONV.cpuusage.d | 42 + .../builtinvar/err.D_XLATE_NOCONV.nice.d | 45 + .../builtinvar/err.D_XLATE_NOCONV.priority.d | 43 + .../builtinvar/err.D_XLATE_NOCONV.prsize.d | 42 + .../builtinvar/err.D_XLATE_NOCONV.rssize.d | 42 + .../test/tst/common/builtinvar/tst.arg0.d | 42 + .../tst/common/builtinvar/tst.arg0clause.d | 47 + .../test/tst/common/builtinvar/tst.arg1.d | 42 + .../test/tst/common/builtinvar/tst.arg1to8.d | 43 + .../tst/common/builtinvar/tst.arg1to8clause.d | 47 + .../test/tst/common/builtinvar/tst.caller.d | 42 + .../test/tst/common/builtinvar/tst.caller1.d | 46 + .../test/tst/common/builtinvar/tst.epid.d | 46 + .../test/tst/common/builtinvar/tst.epid1.d | 43 + .../test/tst/common/builtinvar/tst.errno.d | 47 + .../test/tst/common/builtinvar/tst.errno1.d | 43 + .../test/tst/common/builtinvar/tst.execname.d | 49 + .../tst/common/builtinvar/tst.hpriority.d | 42 + .../test/tst/common/builtinvar/tst.id.d | 46 + .../test/tst/common/builtinvar/tst.id1.d | 42 + .../test/tst/common/builtinvar/tst.ipl.d | 46 + .../test/tst/common/builtinvar/tst.ipl1.d | 42 + .../test/tst/common/builtinvar/tst.lwpsinfo.d | 55 + .../tst/common/builtinvar/tst.lwpsinfo1.d | 51 + .../test/tst/common/builtinvar/tst.pid.d | 46 + .../test/tst/common/builtinvar/tst.pid1.d | 42 + .../test/tst/common/builtinvar/tst.psinfo.d | 60 + .../test/tst/common/builtinvar/tst.psinfo1.d | 56 + .../test/tst/common/builtinvar/tst.tid.d | 46 + .../test/tst/common/builtinvar/tst.tid1.d | 43 + .../tst/common/builtinvar/tst.timestamp.d | 43 + .../tst/common/builtinvar/tst.vtimestamp.d | 43 + .../common/clauses/err.D_IDENT_UNDEF.aggfun.d | 40 + .../common/clauses/err.D_IDENT_UNDEF.aggtup.d | 40 + .../common/clauses/err.D_IDENT_UNDEF.arrtup.d | 40 + .../common/clauses/err.D_IDENT_UNDEF.body.d | 38 + .../common/clauses/err.D_IDENT_UNDEF.both.d | 41 + .../common/clauses/err.D_IDENT_UNDEF.pred.d | 39 + .../test/tst/common/clauses/tst.nopred.d | 38 + .../dtrace/test/tst/common/clauses/tst.pred.d | 39 + .../test/tst/common/clauses/tst.predfirst.d | 41 + .../test/tst/common/clauses/tst.predlast.d | 42 + .../decls/err.D_DECL_LOCASSC.NonLocalAssoc.d | 49 + .../decls/err.D_DECL_LONGINT.LongStruct.d | 52 + .../err.D_DECL_PARMCLASS.BadStorageClass.d | 51 + .../decls/err.D_DECL_PROTO_NAME.VoidName.d | 40 + .../common/decls/err.D_DECL_PROTO_TYPE.Dyn.d | 40 + .../err.D_DECL_PROTO_VARARGS.VarLenArgs.d | 50 + .../decls/err.D_DECL_PROTO_VOID.NonSoleVoid.d | 49 + .../decls/err.D_DECL_SIGNINT.UnsignedStruct.d | 52 + .../decls/err.D_DECL_VOIDATTR.ShortVoidDecl.d | 49 + .../dtrace/test/tst/common/decls/tst.arrays.d | 51 + .../dtrace/test/tst/common/decls/tst.basics.d | 67 + .../dtrace/test/tst/common/decls/tst.funcs.d | 49 + .../test/tst/common/decls/tst.pointers.d | 43 + .../test/tst/common/decls/tst.varargsfuncs.d | 45 + .../test/tst/common/docsExamples/badptr.d | 42 + .../test/tst/common/docsExamples/countdown.d | 53 + .../test/tst/common/docsExamples/counter.d | 52 + .../test/tst/common/docsExamples/errorpath.d | 47 + .../test/tst/common/docsExamples/hello.d | 42 + .../test/tst/common/docsExamples/kstat.d | 57 + .../test/tst/common/docsExamples/ksyms.d | 63 + .../tst/common/docsExamples/renormalize.d | 55 + .../test/tst/common/docsExamples/rtime.d | 50 + .../dtrace/test/tst/common/docsExamples/rw.d | 42 + .../test/tst/common/docsExamples/rwinfo.d | 74 + .../test/tst/common/docsExamples/rwtime.d | 50 + .../test/tst/common/docsExamples/specopen.d | 79 + .../test/tst/common/docsExamples/truss.d | 55 + .../test/tst/common/docsExamples/trussrw.d | 52 + .../test/tst/common/docsExamples/userfunc.d | 61 + .../common/drops/drp.DTRACEDROP_AGGREGATION.d | 44 + .../common/drops/drp.DTRACEDROP_DBLERROR.d | 42 + .../tst/common/drops/drp.DTRACEDROP_DYNAMIC.d | 43 + .../common/drops/drp.DTRACEDROP_PRINCIPAL.d | 43 + .../drops/drp.DTRACEDROP_PRINCIPAL.end.d | 43 + .../tst/common/drops/drp.DTRACEDROP_SPEC.d | 48 + .../common/drops/drp.DTRACEDROP_SPECUNAVAIL.d | 42 + .../drops/drp.DTRACEDROP_STKSTROVERFLOW.d | 53 + .../err.D_PDESC_ZERO.InvalidDescription1.d | 42 + .../tst/common/dtraceUtil/man.APIVersion.d | 37 + .../tst/common/dtraceUtil/man.AddSearchPath.d | 55 + .../tst/common/dtraceUtil/man.CoalesceTrace.d | 67 + .../tst/common/dtraceUtil/man.ELFGeneration.d | 48 + .../common/dtraceUtil/man.IncludedFilePath.d | 48 + .../dtraceUtil/man.ListProbesWithFunctions | 99 + .../common/dtraceUtil/man.ListProbesWithIDs | 77 + .../dtraceUtil/man.ListProbesWithModules | 91 + .../common/dtraceUtil/man.ListProbesWithNames | 128 + .../dtraceUtil/man.ListProbesWithProviders | 82 + .../common/dtraceUtil/man.ShowCompilerCode.d | 44 + .../tst/common/dtraceUtil/man.TraceFunctions | 115 + .../test/tst/common/dtraceUtil/man.TraceIDs | 70 + .../tst/common/dtraceUtil/man.TraceModule | 114 + .../test/tst/common/dtraceUtil/man.TraceNames | 129 + .../tst/common/dtraceUtil/man.TraceProvider | 83 + .../dtraceUtil/man.VerboseStabilityReport.d | 47 + .../common/dtraceUtil/tst.AddSearchPath.d.ksh | 82 + .../common/dtraceUtil/tst.BufsizeGiga.d.ksh | 45 + .../common/dtraceUtil/tst.BufsizeKilo.d.ksh | 45 + .../common/dtraceUtil/tst.BufsizeMega.d.ksh | 45 + .../common/dtraceUtil/tst.BufsizeTera.d.ksh | 45 + .../common/dtraceUtil/tst.DataModel32.d.ksh | 73 + .../common/dtraceUtil/tst.DataModel64.d.ksh | 74 + .../dtraceUtil/tst.DefineNameWithCPP.d.ksh | 68 + .../tst.DefineNameWithCPP.d.ksh.out | 2 + .../dtraceUtil/tst.DestructWithFunction.d.ksh | 56 + .../tst.DestructWithFunction.d.ksh.out | 1 + .../dtraceUtil/tst.DestructWithID.d.ksh | 54 + .../dtraceUtil/tst.DestructWithID.d.ksh.out | 1 + .../dtraceUtil/tst.DestructWithModule.d.ksh | 54 + .../tst.DestructWithModule.d.ksh.out | 1 + .../dtraceUtil/tst.DestructWithName.d.ksh | 54 + .../dtraceUtil/tst.DestructWithName.d.ksh.out | 1 + .../dtraceUtil/tst.DestructWithProvider.d.ksh | 54 + .../tst.DestructWithProvider.d.ksh.out | 1 + .../dtraceUtil/tst.DestructWithoutW.d.ksh | 55 + .../dtraceUtil/tst.ELFGenerationOut.d.ksh | 73 + .../dtraceUtil/tst.ELFGenerationWithO.d.ksh | 74 + .../common/dtraceUtil/tst.ExitStatus1.d.ksh | 56 + .../common/dtraceUtil/tst.ExitStatus2.d.ksh | 55 + .../dtraceUtil/tst.ExtraneousProbeIds.d.ksh | 53 + .../dtraceUtil/tst.InvalidFuncName1.d.ksh | 53 + .../dtraceUtil/tst.InvalidFuncName2.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidId1.d.ksh | 59 + .../common/dtraceUtil/tst.InvalidId2.d.ksh | 59 + .../common/dtraceUtil/tst.InvalidId3.d.ksh | 59 + .../dtraceUtil/tst.InvalidModule1.d.ksh | 59 + .../dtraceUtil/tst.InvalidModule2.d.ksh | 59 + .../dtraceUtil/tst.InvalidModule3.d.ksh | 59 + .../dtraceUtil/tst.InvalidModule4.d.ksh | 59 + .../tst.InvalidProbeIdentifier.d.ksh | 53 + .../dtraceUtil/tst.InvalidProvider1.d.ksh | 59 + .../dtraceUtil/tst.InvalidProvider2.d.ksh | 59 + .../dtraceUtil/tst.InvalidProvider3.d.ksh | 59 + .../dtraceUtil/tst.InvalidProvider4.d.ksh | 59 + .../dtraceUtil/tst.InvalidTraceFunc1.d.ksh | 53 + .../dtraceUtil/tst.InvalidTraceFunc2.d.ksh | 53 + .../dtraceUtil/tst.InvalidTraceFunc3.d.ksh | 53 + .../dtraceUtil/tst.InvalidTraceFunc4.d.ksh | 53 + .../dtraceUtil/tst.InvalidTraceFunc5.d.ksh | 53 + .../dtraceUtil/tst.InvalidTraceFunc6.d.ksh | 53 + .../dtraceUtil/tst.InvalidTraceFunc7.d.ksh | 53 + .../dtraceUtil/tst.InvalidTraceFunc8.d.ksh | 53 + .../dtraceUtil/tst.InvalidTraceFunc9.d.ksh | 53 + .../dtraceUtil/tst.InvalidTraceID1.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceID2.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceID3.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceID4.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceID5.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceID6.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceID7.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceModule1.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceModule2.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceModule3.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceModule4.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceModule5.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceModule6.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceModule7.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceModule8.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceName1.d.ksh | 57 + .../dtraceUtil/tst.InvalidTraceName2.d.ksh | 57 + .../dtraceUtil/tst.InvalidTraceName3.d.ksh | 57 + .../dtraceUtil/tst.InvalidTraceName4.d.ksh | 57 + .../dtraceUtil/tst.InvalidTraceName5.d.ksh | 57 + .../dtraceUtil/tst.InvalidTraceName6.d.ksh | 57 + .../dtraceUtil/tst.InvalidTraceName7.d.ksh | 57 + .../dtraceUtil/tst.InvalidTraceName8.d.ksh | 57 + .../dtraceUtil/tst.InvalidTraceName9.d.ksh | 57 + .../tst.InvalidTraceProvider1.d.ksh | 58 + .../tst.InvalidTraceProvider2.d.ksh | 58 + .../tst.InvalidTraceProvider3.d.ksh | 58 + .../tst.InvalidTraceProvider4.d.ksh | 58 + .../tst.InvalidTraceProvider5.d.ksh | 58 + .../tst.MultipleInvalidProbeId.d.ksh | 53 + .../tst.PreprocessorStatement.d.ksh | 70 + .../tst/common/dtraceUtil/tst.QuietMode.d.ksh | 65 + .../common/dtraceUtil/tst.QuietMode.d.ksh.out | 1 + .../common/dtraceUtil/tst.TestCompile.d.ksh | 67 + .../dtraceUtil/tst.TestCompile.d.ksh.out | 0 .../dtraceUtil/tst.UnDefineNameWithCPP.d.ksh | 71 + .../dtraceUtil/tst.ZeroFunctionProbes.d.ksh | 58 + .../tst.ZeroFunctionProbes.d.ksh.out | 1 + .../dtraceUtil/tst.ZeroModuleProbes.d.ksh | 57 + .../dtraceUtil/tst.ZeroModuleProbes.d.ksh.out | 1 + .../dtraceUtil/tst.ZeroNameProbes.d.ksh | 56 + .../dtraceUtil/tst.ZeroNameProbes.d.ksh.out | 1 + .../dtraceUtil/tst.ZeroProbeIdentfier.d.ksh | 53 + .../dtraceUtil/tst.ZeroProbesWithoutZ.d.ksh | 57 + .../dtraceUtil/tst.ZeroProviderProbes.d.ksh | 57 + .../tst.ZeroProviderProbes.d.ksh.out | 1 + .../common/end/err.D_IDENT_UNDEF.timespent.d | 49 + .../cmd/dtrace/test/tst/common/end/tst.end.d | 55 + .../test/tst/common/end/tst.endwithoutbegin.d | 48 + .../test/tst/common/end/tst.multibeginend.d | 77 + .../dtrace/test/tst/common/end/tst.multiend.d | 61 + .../enum/err.D_DECL_IDRED.EnumSameName.d | 57 + .../enum/err.D_UNKNOWN.RepeatIdentifiers.d | 52 + .../test/tst/common/enum/tst.EnumEquality.d | 56 + .../test/tst/common/enum/tst.EnumSameValue.d | 51 + .../test/tst/common/enum/tst.EnumValAssign.d | 57 + .../tst/common/error/tst.DTRACEFLT_BADADDR.d | 51 + .../tst/common/error/tst.DTRACEFLT_DIVZERO.d | 54 + .../tst/common/error/tst.DTRACEFLT_UNKNOWN.d | 53 + .../dtrace/test/tst/common/error/tst.error.d | 49 + .../test/tst/common/error/tst.errorend.d | 54 + .../tst/common/exit/err.D_PROTO_LEN.noarg.d | 42 + .../test/tst/common/exit/err.exitarg1.d | 42 + .../dtrace/test/tst/common/exit/tst.basic1.d | 42 + .../fbtprovider/err.D_PDESC_ZERO.notreturn.d | 56 + .../test/tst/common/fbtprovider/tst.basic.d | 49 + .../common/fbtprovider/tst.functionentry.d | 48 + .../fbtprovider/tst.functionreturnvalue.d | 43 + .../tst/common/fbtprovider/tst.ioctlargs.d | 50 + .../test/tst/common/fbtprovider/tst.offset.d | 53 + .../tst/common/fbtprovider/tst.offsetzero.d | 50 + .../test/tst/common/fbtprovider/tst.return.d | 52 + .../test/tst/common/fbtprovider/tst.return0.d | 44 + .../tst/common/fbtprovider/tst.tailcall.d | 55 + .../funcs/err.D_FUNC_UNDEF.progenyofbad1.d | 44 + .../tst/common/funcs/err.D_OP_VFPTR.badop.d | 47 + .../funcs/err.D_PROTO_ARG.chillbadarg.d | 43 + .../funcs/err.D_PROTO_ARG.copyoutbadarg.d | 43 + .../common/funcs/err.D_PROTO_ARG.mobadarg.d | 41 + .../funcs/err.D_PROTO_ARG.raisebadarg.d | 43 + .../funcs/err.D_PROTO_LEN.allocanoarg.d | 45 + .../funcs/err.D_PROTO_LEN.badbreakpoint.d | 43 + .../funcs/err.D_PROTO_LEN.chilltoofew.d | 43 + .../funcs/err.D_PROTO_LEN.chilltoomany.d | 42 + .../funcs/err.D_PROTO_LEN.copyoutstrbadarg.d | 43 + .../funcs/err.D_PROTO_LEN.copyoutstrtoofew.d | 43 + .../funcs/err.D_PROTO_LEN.copyouttoofew.d | 43 + .../funcs/err.D_PROTO_LEN.copyouttoomany.d | 44 + .../common/funcs/err.D_PROTO_LEN.motoofew.d | 41 + .../common/funcs/err.D_PROTO_LEN.motoomany.d | 41 + .../common/funcs/err.D_PROTO_LEN.mtabadarg.d | 42 + .../common/funcs/err.D_PROTO_LEN.mtatoofew.d | 43 + .../common/funcs/err.D_PROTO_LEN.mtatoomany.d | 42 + .../funcs/err.D_PROTO_LEN.panicbadarg.d | 43 + .../funcs/err.D_PROTO_LEN.progenyofbad2.d | 44 + .../common/funcs/err.D_PROTO_LEN.stopbadarg.d | 43 + .../funcs/err.D_STRINGOF_TYPE.badstringof.d | 43 + .../tst/common/funcs/err.D_VAR_UNDEF.badvar.d | 43 + .../test/tst/common/funcs/err.badalloca.d | 56 + .../test/tst/common/funcs/err.badalloca2.d | 49 + .../test/tst/common/funcs/err.badbcopy.d | 55 + .../test/tst/common/funcs/err.badbcopy1.d | 54 + .../test/tst/common/funcs/err.badbcopy2.d | 53 + .../test/tst/common/funcs/err.badbcopy3.d | 50 + .../test/tst/common/funcs/err.badbcopy4.d | 53 + .../test/tst/common/funcs/err.badbcopy5.d | 55 + .../test/tst/common/funcs/err.badbcopy6.d | 40 + .../test/tst/common/funcs/err.badchill.d | 39 + .../test/tst/common/funcs/err.chillbadarg.ksh | 69 + .../test/tst/common/funcs/err.copyout.d | 49 + .../tst/common/funcs/err.copyoutbadaddr.ksh | 71 + .../common/funcs/err.copyoutstrbadaddr.ksh | 70 + .../tst/common/funcs/err.inet_ntoa6badaddr.d | 45 + .../tst/common/funcs/err.inet_ntoabadaddr.d | 45 + .../tst/common/funcs/err.inet_ntopbadaddr.d | 45 + .../tst/common/funcs/err.inet_ntopbadarg.d | 47 + .../test/tst/common/funcs/tst.badfreopen.ksh | 102 + .../test/tst/common/funcs/tst.basename.d | 87 + .../test/tst/common/funcs/tst.basename.d.out | 163 + .../dtrace/test/tst/common/funcs/tst.bcopy.d | 61 + .../test/tst/common/funcs/tst.chill.ksh | 77 + .../test/tst/common/funcs/tst.cleanpath.d | 70 + .../test/tst/common/funcs/tst.cleanpath.d.out | 22 + .../dtrace/test/tst/common/funcs/tst.copyin.d | 54 + .../test/tst/common/funcs/tst.copyinto.d | 56 + .../test/tst/common/funcs/tst.ddi_pathname.d | 64 + .../test/tst/common/funcs/tst.default.d | 64 + .../test/tst/common/funcs/tst.freopen.ksh | 111 + .../test/tst/common/funcs/tst.ftruncate.ksh | 64 + .../tst/common/funcs/tst.ftruncate.ksh.out | 11 + .../dtrace/test/tst/common/funcs/tst.hton.d | 99 + .../dtrace/test/tst/common/funcs/tst.index.d | 226 + .../test/tst/common/funcs/tst.index.d.out | 1126 ++ .../test/tst/common/funcs/tst.inet_ntoa.d | 58 + .../test/tst/common/funcs/tst.inet_ntoa.d.out | 5 + .../test/tst/common/funcs/tst.inet_ntoa6.d | 95 + .../tst/common/funcs/tst.inet_ntoa6.d.out | 8 + .../test/tst/common/funcs/tst.inet_ntop.d | 138 + .../test/tst/common/funcs/tst.inet_ntop.d.out | 13 + .../test/tst/common/funcs/tst.lltostr.d | 41 + .../test/tst/common/funcs/tst.lltostr.d.out | 8 + .../test/tst/common/funcs/tst.mutex_owned.d | 62 + .../test/tst/common/funcs/tst.mutex_owner.d | 63 + .../common/funcs/tst.mutex_type_adaptive.d | 71 + .../test/tst/common/funcs/tst.progenyof.d | 64 + .../dtrace/test/tst/common/funcs/tst.rand.d | 54 + .../dtrace/test/tst/common/funcs/tst.strchr.d | 71 + .../test/tst/common/funcs/tst.strchr.d.out | 6 + .../test/tst/common/funcs/tst.strjoin.d | 38 + .../test/tst/common/funcs/tst.strjoin.d.out | 5 + .../dtrace/test/tst/common/funcs/tst.strstr.d | 89 + .../test/tst/common/funcs/tst.strstr.d.out | 10 + .../dtrace/test/tst/common/funcs/tst.strtok.d | 146 + .../test/tst/common/funcs/tst.strtok.d.out | 5 + .../test/tst/common/funcs/tst.strtok_null.d | 43 + .../dtrace/test/tst/common/funcs/tst.substr.d | 231 + .../test/tst/common/funcs/tst.substr.d.out | 254 + .../test/tst/common/funcs/tst.substrminate.d | 52 + .../tst/common/funcs/tst.substrminate.d.out | 3 + .../dtrace/test/tst/common/funcs/tst.system.d | 45 + .../test/tst/common/funcs/tst.system.d.out | 8 + .../tst/common/grammar/err.D_ADDROF_LVAL.d | 41 + .../tst/common/grammar/err.D_EMPTY.empty.d | 34 + .../test/tst/common/grammar/tst.clauses.d | 48 + .../test/tst/common/grammar/tst.stmts.d | 59 + .../common/inline/err.D_DECL_IDRED.redef1.d | 42 + .../common/inline/err.D_DECL_IDRED.redef2.d | 41 + .../common/inline/err.D_IDENT_UNDEF.recur.d | 41 + .../common/inline/err.D_OP_INCOMPAT.baddef1.d | 41 + .../common/inline/err.D_OP_INCOMPAT.baddef2.d | 41 + .../inline/err.D_OP_INCOMPAT.badxlate.d | 41 + .../tst/common/inline/tst.InlineDataAssign.d | 68 + .../tst/common/inline/tst.InlineExpression.d | 80 + .../test/tst/common/inline/tst.InlineKinds.d | 64 + .../tst/common/inline/tst.InlineKinds.d.out | 7 + .../tst/common/inline/tst.InlineTypedef.d | 52 + .../common/inline/tst.InlineWritableAssign.d | 66 + .../cmd/dtrace/test/tst/common/io/tst.fds.c | 100 + .../cmd/dtrace/test/tst/common/io/tst.fds.d | 54 + .../dtrace/test/tst/common/io/tst.fds.d.out | 36 + .../java_api/manifest/test.jar-manifest | 2 + .../tst/common/java_api/src/TestAbort.java | 158 + .../tst/common/java_api/src/TestBean.java | 706 + .../tst/common/java_api/src/TestClose.java | 90 + .../tst/common/java_api/src/TestDrop.java | 169 + .../tst/common/java_api/src/TestEnable.java | 151 + .../java_api/src/TestFunctionLookup.java | 116 + .../common/java_api/src/TestMaxConsumers.java | 97 + .../java_api/src/TestMultiAggPrinta.java | 144 + .../common/java_api/src/TestProbeData.java | 110 + .../java_api/src/TestProbeDescription.java | 55 + .../common/java_api/src/TestStateMachine.java | 627 + .../tst/common/java_api/src/TestStopLock.java | 67 + .../test/tst/common/java_api/tst.Abort.ksh | 39 + .../tst/common/java_api/tst.Abort.ksh.out | 1 + .../test/tst/common/java_api/tst.Bean.ksh | 41 + .../test/tst/common/java_api/tst.Bean.ksh.out | 722 + .../test/tst/common/java_api/tst.Close.ksh | 38 + .../tst/common/java_api/tst.Close.ksh.out | 1 + .../test/tst/common/java_api/tst.Drop.ksh | 38 + .../test/tst/common/java_api/tst.Drop.ksh.out | 1 + .../test/tst/common/java_api/tst.Enable.ksh | 40 + .../tst/common/java_api/tst.Enable.ksh.out | 6 + .../tst/common/java_api/tst.FunctionLookup.c | 51 + .../common/java_api/tst.FunctionLookup.ksh | 39 + .../java_api/tst.FunctionLookup.ksh.out | 3 + .../tst/common/java_api/tst.MaxConsumers.ksh | 47 + .../common/java_api/tst.MaxConsumers.ksh.out | 17 + .../common/java_api/tst.MultiAggPrinta.ksh | 38 + .../java_api/tst.MultiAggPrinta.ksh.out | 78 + .../test/tst/common/java_api/tst.ProbeData.c | 93 + .../tst/common/java_api/tst.ProbeData.ksh | 38 + .../tst/common/java_api/tst.ProbeData.ksh.out | 50 + .../common/java_api/tst.ProbeDescription.ksh | 45 + .../java_api/tst.ProbeDescription.ksh.out | 8 + .../tst/common/java_api/tst.StateMachine.ksh | 40 + .../common/java_api/tst.StateMachine.ksh.out | 70 + .../test/tst/common/java_api/tst.StopLock.ksh | 39 + .../tst/common/java_api/tst.StopLock.ksh.out | 1 + .../test/tst/common/java_api/tst.printa.d | 78 + .../test/tst/common/java_api/tst.printa.d.out | 47 + .../test/tst/common/lexer/err.D_CHR_NL.char.d | 43 + .../tst/common/lexer/err.D_CHR_NULL.char.d | 42 + .../lexer/err.D_INT_DIGIT.InvalidDigit.d | 39 + .../tst/common/lexer/err.D_INT_OFLOW.BigInt.d | 39 + .../tst/common/lexer/err.D_STR_NL.string.d | 44 + .../tst/common/lexer/err.D_SYNTAX.brace1.d | 39 + .../tst/common/lexer/err.D_SYNTAX.brace2.d | 37 + .../tst/common/lexer/err.D_SYNTAX.brack1.d | 38 + .../tst/common/lexer/err.D_SYNTAX.brack2.d | 38 + .../tst/common/lexer/err.D_SYNTAX.brack3.d | 39 + .../tst/common/lexer/err.D_SYNTAX.paren1.d | 38 + .../tst/common/lexer/err.D_SYNTAX.paren2.d | 38 + .../tst/common/lexer/err.D_SYNTAX.paren3.d | 39 + .../tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh | 54 + .../test/tst/common/mdb/tst.dtracedcmd.ksh | 85 + .../dtrace/test/tst/common/mib/tst.icmp.ksh | 79 + .../dtrace/test/tst/common/mib/tst.tcp.ksh | 155 + .../dtrace/test/tst/common/mib/tst.udp.ksh | 74 + .../tst/common/misc/err.D_PRAGMA_OPTSET.d | 34 + .../dtrace/test/tst/common/misc/tst.badopt.d | 41 + .../dtrace/test/tst/common/misc/tst.boolopt.d | 50 + .../test/tst/common/misc/tst.boolopt.d.out | 2 + .../dtrace/test/tst/common/misc/tst.dynopt.d | 61 + .../test/tst/common/misc/tst.dynopt.d.out | 31 + .../test/tst/common/misc/tst.enablerace.ksh | 89 + .../dtrace/test/tst/common/misc/tst.haslam.d | 63 + .../test/tst/common/misc/tst.include.ksh | 135 + .../dtrace/test/tst/common/misc/tst.roch.d | 93 + .../test/tst/common/misc/tst.schrock.ksh | 79 + .../common/multiaggs/err.D_PRINTA_AGGKEY.d | 38 + .../common/multiaggs/err.D_PRINTA_AGGPROTO.d | 38 + .../test/tst/common/multiaggs/tst.many.d | 311 + .../test/tst/common/multiaggs/tst.many.d.out | 265 + .../test/tst/common/multiaggs/tst.same.d | 37 + .../test/tst/common/multiaggs/tst.same.d.out | 3 + .../test/tst/common/multiaggs/tst.sort.d | 46 + .../test/tst/common/multiaggs/tst.sort.d.out | 201 + .../test/tst/common/multiaggs/tst.sortpos.d | 60 + .../tst/common/multiaggs/tst.sortpos.d.out | 1021 + .../tst/common/multiaggs/tst.tuplecompat.d | 37 + .../common/multiaggs/tst.tuplecompat.d.out | 2 + .../test/tst/common/multiaggs/tst.zero.d | 51 + .../test/tst/common/multiaggs/tst.zero.d.out | 55 + .../test/tst/common/multiaggs/tst.zero2.d | 50 + .../test/tst/common/multiaggs/tst.zero2.d.out | 72 + .../test/tst/common/multiaggs/tst.zero3.d | 45 + .../test/tst/common/multiaggs/tst.zero3.d.out | 3 + .../cmd/dtrace/test/tst/common/nfs/tst.call.c | 120 + .../cmd/dtrace/test/tst/common/nfs/tst.call.d | 70 + .../dtrace/test/tst/common/nfs/tst.call3.c | 441 + .../dtrace/test/tst/common/nfs/tst.call3.d | 91 + .../err.D_OFFSETOF_BITFIELD.bitfield.d | 50 + .../offsetof/err.D_OFFSETOF_TYPE.badtype.d | 44 + .../offsetof/err.D_OFFSETOF_TYPE.notsou.d | 44 + .../offsetof/err.D_UNKNOWN.OffsetofNULL.d | 49 + .../common/offsetof/err.D_UNKNOWN.badmemb.d | 44 + .../tst/common/offsetof/tst.OffsetofAlias.d | 59 + .../tst/common/offsetof/tst.OffsetofArith.d | 73 + .../tst/common/offsetof/tst.OffsetofUnion.d | 59 + .../test/tst/common/offsetof/tst.struct.d | 50 + .../test/tst/common/offsetof/tst.struct.d.out | 2 + .../test/tst/common/offsetof/tst.union.d | 50 + .../test/tst/common/offsetof/tst.union.d.out | 2 + .../test/tst/common/operators/tst.ternary.d | 48 + .../tst/common/operators/tst.ternary.d.out | 4 + .../tst/common/pid/err.D_PDESC_ZERO.badlib.d | 38 + .../common/pid/err.D_PDESC_ZERO.badlib.exe | 29 + .../common/pid/err.D_PDESC_ZERO.badproc1.d | 38 + .../common/pid/err.D_PROC_BADPID.badproc2.d | 38 + .../common/pid/err.D_PROC_CREATEFAIL.many.d | 36 + .../common/pid/err.D_PROC_CREATEFAIL.many.exe | 29 + .../tst/common/pid/err.D_PROC_FUNC.badfunc.d | 40 + .../common/pid/err.D_PROC_FUNC.badfunc.exe | 29 + .../tst/common/pid/err.D_PROC_LIB.libdash.d | 38 + .../tst/common/pid/err.D_PROC_LIB.libdash.exe | 29 + .../tst/common/pid/err.D_PROC_NAME.alldash.d | 38 + .../common/pid/err.D_PROC_NAME.alldash.exe | 29 + .../tst/common/pid/err.D_PROC_NAME.badname.d | 38 + .../common/pid/err.D_PROC_NAME.badname.exe | 29 + .../tst/common/pid/err.D_PROC_NAME.globdash.d | 38 + .../common/pid/err.D_PROC_NAME.globdash.exe | 29 + .../tst/common/pid/err.D_PROC_OFF.toobig.d | 40 + .../tst/common/pid/err.D_PROC_OFF.toobig.exe | 29 + .../test/tst/common/pid/tst.addprobes.ksh | 61 + .../dtrace/test/tst/common/pid/tst.args1.c | 52 + .../dtrace/test/tst/common/pid/tst.args1.d | 75 + .../dtrace/test/tst/common/pid/tst.coverage.d | 51 + .../test/tst/common/pid/tst.coverage.exe | 29 + .../test/tst/common/pid/tst.emptystack.d | 64 + .../test/tst/common/pid/tst.emptystack.d.out | 3 + .../test/tst/common/pid/tst.emptystack.exe | 29 + .../dtrace/test/tst/common/pid/tst.float.c | 46 + .../dtrace/test/tst/common/pid/tst.float.d | 51 + .../cmd/dtrace/test/tst/common/pid/tst.fork.c | 63 + .../cmd/dtrace/test/tst/common/pid/tst.fork.d | 86 + .../cmd/dtrace/test/tst/common/pid/tst.gcc.c | 63 + .../cmd/dtrace/test/tst/common/pid/tst.gcc.d | 52 + .../dtrace/test/tst/common/pid/tst.main.ksh | 59 + .../test/tst/common/pid/tst.manypids.ksh | 70 + .../test/tst/common/pid/tst.newprobes.ksh | 62 + .../test/tst/common/pid/tst.newprobes.ksh.out | 7 + .../test/tst/common/pid/tst.probemod.ksh | 56 + .../test/tst/common/pid/tst.provregex1.ksh | 93 + .../test/tst/common/pid/tst.provregex2.ksh | 131 + .../tst/common/pid/tst.provregex2.ksh.out | 3 + .../test/tst/common/pid/tst.provregex3.ksh | 102 + .../tst/common/pid/tst.provregex3.ksh.out | 3 + .../test/tst/common/pid/tst.provregex4.ksh | 154 + .../tst/common/pid/tst.provregex4.ksh.out | 3 + .../cmd/dtrace/test/tst/common/pid/tst.ret1.c | 64 + .../cmd/dtrace/test/tst/common/pid/tst.ret1.d | 73 + .../cmd/dtrace/test/tst/common/pid/tst.ret2.c | 58 + .../cmd/dtrace/test/tst/common/pid/tst.ret2.d | 73 + .../dtrace/test/tst/common/pid/tst.vfork.c | 65 + .../dtrace/test/tst/common/pid/tst.vfork.d | 61 + .../dtrace/test/tst/common/pid/tst.weak1.c | 58 + .../dtrace/test/tst/common/pid/tst.weak1.d | 83 + .../dtrace/test/tst/common/pid/tst.weak2.c | 58 + .../dtrace/test/tst/common/pid/tst.weak2.d | 83 + .../test/tst/common/plockstat/tst.available.d | 39 + .../tst/common/plockstat/tst.available.exe | 29 + .../test/tst/common/plockstat/tst.libmap.d | 39 + .../test/tst/common/plockstat/tst.libmap.exe | 29 + .../test/tst/common/pointers/err.BadAlign.d | 50 + .../pointers/err.D_ADDROF_VAR.ArrayVar.d | 47 + .../pointers/err.D_ADDROF_VAR.DynamicVar.d | 50 + .../common/pointers/err.D_ADDROF_VAR.agg.d | 42 + .../pointers/err.D_DEREF_NONPTR.noptr.d | 46 + .../err.D_DEREF_VOID.VoidPointerDeref.d | 52 + .../err.D_OP_ARRFUN.ArrayAssignment.d | 61 + .../err.D_OP_INCOMPAT.VoidPointerArith.d | 46 + .../pointers/err.D_OP_LVAL.AddressChange.d | 50 + .../pointers/err.D_OP_PTR.NonPointerAccess.d | 59 + .../common/pointers/err.D_OP_PTR.badpointer.d | 50 + .../pointers/err.D_OP_SOU.BadPointerAccess.d | 51 + .../common/pointers/err.D_OP_SOU.badpointer.d | 44 + .../tst/common/pointers/err.InvalidAddress1.d | 52 + .../tst/common/pointers/err.InvalidAddress2.d | 52 + .../tst/common/pointers/err.InvalidAddress3.d | 50 + .../tst/common/pointers/err.InvalidAddress4.d | 52 + .../tst/common/pointers/err.InvalidAddress5.d | 75 + .../tst/common/pointers/tst.ArrayPointer1.d | 174 + .../tst/common/pointers/tst.ArrayPointer2.d | 71 + .../tst/common/pointers/tst.ArrayPointer3.d | 72 + .../test/tst/common/pointers/tst.GlobalVar.d | 59 + .../common/pointers/tst.IntegerArithmetic1.d | 72 + .../common/pointers/tst.PointerArithmetic1.d | 58 + .../common/pointers/tst.PointerArithmetic2.d | 72 + .../common/pointers/tst.PointerArithmetic3.d | 61 + .../common/pointers/tst.PointerAssignment.d | 71 + .../tst/common/pointers/tst.ValidPointer1.d | 49 + .../tst/common/pointers/tst.ValidPointer2.d | 49 + .../test/tst/common/pointers/tst.VoidCast.d | 59 + .../test/tst/common/pointers/tst.basic1.d | 47 + .../test/tst/common/pointers/tst.basic2.d | 47 + .../test/tst/common/pragma/err.D_PRAGERR.d | 42 + .../common/pragma/err.D_PRAGMA_DEPEND.main.d | 38 + .../tst/common/pragma/err.D_PRAGMA_INVAL.d | 45 + .../tst/common/pragma/err.D_PRAGMA_MALFORM.d | 42 + .../pragma/err.D_PRAGMA_UNUSED.UnusedPragma.d | 50 + .../test/tst/common/pragma/err.circlibdep.ksh | 58 + .../tst/common/pragma/err.invalidlibdep.ksh | 57 + .../test/tst/common/pragma/tst.libchain.ksh | 58 + .../test/tst/common/pragma/tst.libdep.ksh | 66 + .../pragma/tst.libdepfullyconnected.ksh | 100 + .../err.D_PRED_SCALAR.NonScalarPred.d | 44 + .../common/predicates/err.D_SYNTAX.invalid.d | 50 + .../common/predicates/err.D_SYNTAX.operr.d | 50 + .../tst/common/predicates/tst.argsnotcached.d | 55 + .../test/tst/common/predicates/tst.basics.d | 57 + .../tst/common/predicates/tst.basics.d.out | 1 + .../test/tst/common/predicates/tst.complex.d | 126 + .../tst/common/predicates/tst.complex.d.out | 83 + .../tst/common/predicates/tst.predcache.ksh | 197 + .../err.D_IDENT_UNDEF.afterprobe.d | 51 + .../err.D_PRAGCTL_INVAL.tabdefine.d | 47 + .../preprocessor/err.D_SYNTAX.withoutpound.d | 47 + .../tst/common/preprocessor/err.defincomp.d | 47 + .../preprocessor/err.ifdefelsenotendif.d | 50 + .../tst/common/preprocessor/err.ifdefincomp.d | 48 + .../common/preprocessor/err.ifdefnotendif.d | 47 + .../tst/common/preprocessor/err.incompelse.d | 47 + .../tst/common/preprocessor/err.mulelse.d | 55 + .../test/tst/common/preprocessor/tst.ifdef.d | 51 + .../tst/common/preprocessor/tst.ifdef.d.out | 2 + .../test/tst/common/preprocessor/tst.ifndef.d | 55 + .../tst/common/preprocessor/tst.ifndef.d.out | 2 + .../tst/common/preprocessor/tst.ifnotdef.d | 51 + .../common/preprocessor/tst.ifnotdef.d.out | 2 + .../tst/common/preprocessor/tst.logicaland.d | 50 + .../common/preprocessor/tst.logicaland.d.out | 2 + .../common/preprocessor/tst.logicalandor.d | 50 + .../preprocessor/tst.logicalandor.d.out | 2 + .../tst/common/preprocessor/tst.logicalor.d | 50 + .../common/preprocessor/tst.logicalor.d.out | 2 + .../test/tst/common/preprocessor/tst.muland.d | 50 + .../tst/common/preprocessor/tst.muland.d.out | 2 + .../test/tst/common/preprocessor/tst.mulor.d | 50 + .../tst/common/preprocessor/tst.mulor.d.out | 2 + .../tst/common/preprocessor/tst.precondi.d | 48 + .../common/preprocessor/tst.precondi.d.out | 2 + .../preprocessor/tst.predicatedeclare.d | 49 + .../test/tst/common/preprocessor/tst.preexp.d | 48 + .../tst/common/preprocessor/tst.preexp.d.out | 2 + .../tst/common/preprocessor/tst.preexpelse.d | 51 + .../common/preprocessor/tst.preexpelse.d.out | 2 + .../tst/common/preprocessor/tst.preexpif.d | 50 + .../common/preprocessor/tst.preexpif.d.out | 2 + .../common/preprocessor/tst.preexpifelse.d | 52 + .../preprocessor/tst.preexpifelse.d.out | 2 + .../tst/common/preprocessor/tst.withinprobe.d | 50 + .../printa/err.D_PRINTA_AGGARG.badagg.d | 40 + .../printa/err.D_PRINTA_AGGARG.badfmt.d | 40 + .../printa/err.D_PRINTA_AGGARG.badval.d | 41 + .../common/printa/err.D_PRINTA_PROTO.bad.d | 40 + .../printa/err.D_PRINTF_ARG_TYPE.jstack.d | 36 + .../printa/err.D_PRINTF_ARG_TYPE.stack.d | 36 + .../printa/err.D_PRINTF_ARG_TYPE.ustack.d | 36 + .../test/tst/common/printa/tst.basics.d | 58 + .../test/tst/common/printa/tst.basics.d.out | 18 + .../dtrace/test/tst/common/printa/tst.def.d | 44 + .../test/tst/common/printa/tst.def.d.out | 3 + .../test/tst/common/printa/tst.dynwidth.d | 43 + .../test/tst/common/printa/tst.dynwidth.d.out | 5 + .../dtrace/test/tst/common/printa/tst.fmt.d | 43 + .../test/tst/common/printa/tst.fmt.d.out | 1 + .../dtrace/test/tst/common/printa/tst.many.d | 76 + .../test/tst/common/printa/tst.manyval.d | 44 + .../test/tst/common/printa/tst.manyval.d.out | 2 + .../dtrace/test/tst/common/printa/tst.stack.d | 40 + .../dtrace/test/tst/common/printa/tst.tuple.d | 55 + .../test/tst/common/printa/tst.tuple.d.out | 8 + .../tst/common/printa/tst.walltimestamp.ksh | 62 + .../common/printa/tst.walltimestamp.ksh.out | 2 + .../printf/err.D_PRINTF_AGG_CONV.aggfmt.d | 40 + .../printf/err.D_PRINTF_ARG_EXTRA.toomany.d | 40 + .../printf/err.D_PRINTF_ARG_EXTRA.widths.d | 47 + .../printf/err.D_PRINTF_ARG_FMT.badfmt.d | 40 + .../printf/err.D_PRINTF_ARG_PROTO.novalue.d | 40 + .../printf/err.D_PRINTF_ARG_TYPE.aggarg.d | 42 + .../printf/err.D_PRINTF_ARG_TYPE.recursive.d | 46 + .../printf/err.D_PRINTF_DYN_PROTO.noprec.d | 40 + .../printf/err.D_PRINTF_DYN_PROTO.nowidth.d | 40 + .../printf/err.D_PRINTF_DYN_TYPE.badprec.d | 40 + .../printf/err.D_PRINTF_DYN_TYPE.badwidth.d | 40 + .../common/printf/err.D_PROTO_LEN.toofew.d | 40 + .../tst/common/printf/err.D_SYNTAX.badconv1.d | 40 + .../tst/common/printf/err.D_SYNTAX.badconv2.d | 40 + .../tst/common/printf/err.D_SYNTAX.badconv3.d | 40 + .../test/tst/common/printf/tst.basics.d | 73 + .../test/tst/common/printf/tst.basics.d.out | 26 + .../dtrace/test/tst/common/printf/tst.flags.d | 49 + .../test/tst/common/printf/tst.flags.d.out | 7 + .../dtrace/test/tst/common/printf/tst.hello.d | 44 + .../test/tst/common/printf/tst.hello.d.out | 1 + .../dtrace/test/tst/common/printf/tst.ints.d | 87 + .../test/tst/common/printf/tst.ints.d.out | 45 + .../dtrace/test/tst/common/printf/tst.precs.d | 58 + .../test/tst/common/printf/tst.precs.d.out | 14 + .../test/tst/common/printf/tst.print-f.d | 51 + .../test/tst/common/printf/tst.print-f.d.out | 4 + .../test/tst/common/printf/tst.printT.ksh | 56 + .../test/tst/common/printf/tst.printT.ksh.out | 3 + .../test/tst/common/printf/tst.printY.ksh | 56 + .../test/tst/common/printf/tst.printY.ksh.out | 3 + .../test/tst/common/printf/tst.printcont.d | 60 + .../tst/common/printf/tst.printcont.d.out | 16 + .../test/tst/common/printf/tst.printeE.d | 54 + .../test/tst/common/printf/tst.printeE.d.out | 6 + .../test/tst/common/printf/tst.printgG.d | 54 + .../test/tst/common/printf/tst.printgG.d.out | 6 + .../test/tst/common/printf/tst.rawfmt.d | 43 + .../test/tst/common/printf/tst.rawfmt.d.out | 1 + .../dtrace/test/tst/common/printf/tst.str.d | 43 + .../test/tst/common/printf/tst.str.d.out | 1 + .../dtrace/test/tst/common/printf/tst.sym.d | 43 + .../test/tst/common/printf/tst.sym.d.out | 1 + .../dtrace/test/tst/common/printf/tst.uints.d | 47 + .../test/tst/common/printf/tst.uints.d.out | 6 + .../test/tst/common/printf/tst.widths.d | 59 + .../test/tst/common/printf/tst.widths.d.out | 14 + .../test/tst/common/printf/tst.widths1.d | 52 + .../dtrace/test/tst/common/printf/tst.wp.d | 66 + .../test/tst/common/printf/tst.wp.d.out | 22 + .../test/tst/common/privs/tst.func_access.ksh | 82 + .../test/tst/common/privs/tst.op_access.ksh | 70 + .../tst/common/privs/tst.unpriv_funcs.ksh | 79 + .../common/probes/err.D_PDESC_ZERO.probeqtn.d | 51 + .../probes/err.D_PDESC_ZERO.probestar.d | 45 + .../common/probes/err.D_PDESC_ZERO.tickstar.d | 51 + .../tst/common/probes/err.D_SYNTAX.assign.d | 48 + .../tst/common/probes/err.D_SYNTAX.declare.d | 46 + .../common/probes/err.D_SYNTAX.declarein.d | 46 + .../tst/common/probes/err.D_SYNTAX.lbraces.d | 43 + .../common/probes/err.D_SYNTAX.probespec.d | 45 + .../tst/common/probes/err.D_SYNTAX.rbraces.d | 43 + .../tst/common/probes/err.D_SYNTAX.recdec.d | 46 + .../test/tst/common/probes/tst.basic1.d | 44 + .../dtrace/test/tst/common/probes/tst.check.d | 51 + .../test/tst/common/probes/tst.declare.d | 45 + .../test/tst/common/probes/tst.declareafter.d | 45 + .../test/tst/common/probes/tst.emptyprobe.d | 47 + .../test/tst/common/probes/tst.pragma.d | 44 + .../tst/common/probes/tst.pragmaaftertab.d | 44 + .../test/tst/common/probes/tst.pragmainside.d | 44 + .../tst/common/probes/tst.pragmaoutside.d | 44 + .../test/tst/common/probes/tst.probestar.d | 50 + .../test/tst/common/proc/tst.create.ksh | 67 + .../test/tst/common/proc/tst.discard.ksh | 74 + .../dtrace/test/tst/common/proc/tst.exec.ksh | 73 + .../tst/common/proc/tst.execfail.ENOENT.ksh | 84 + .../test/tst/common/proc/tst.execfail.ksh | 86 + .../test/tst/common/proc/tst.exitcore.ksh | 92 + .../test/tst/common/proc/tst.exitexit.ksh | 67 + .../test/tst/common/proc/tst.exitkilled.ksh | 75 + .../test/tst/common/proc/tst.signal.ksh | 84 + .../dtrace/test/tst/common/proc/tst.sigwait.c | 78 + .../dtrace/test/tst/common/proc/tst.sigwait.d | 41 + .../test/tst/common/proc/tst.startexit.ksh | 89 + .../profile-n/err.D_PDESC_ZERO.profile.d | 45 + .../common/profile-n/err.D_PDESC_ZEROonens.d | 44 + .../profile-n/err.D_PDESC_ZEROonensec.d | 44 + .../common/profile-n/err.D_PDESC_ZEROoneus.d | 44 + .../profile-n/err.D_PDESC_ZEROoneusec.d | 44 + .../test/tst/common/profile-n/tst.argtest.d | 53 + .../tst/common/profile-n/tst.argtest.d.out | 2 + .../test/tst/common/profile-n/tst.basic.d | 45 + .../test/tst/common/profile-n/tst.basic.d.out | 2 + .../test/tst/common/profile-n/tst.func.ksh | 74 + .../test/tst/common/profile-n/tst.mod.ksh | 70 + .../test/tst/common/profile-n/tst.profilehz.d | 45 + .../tst/common/profile-n/tst.profilehz.d.out | 1 + .../test/tst/common/profile-n/tst.profilems.d | 45 + .../tst/common/profile-n/tst.profilems.d.out | 1 + .../tst/common/profile-n/tst.profilemsec.d | 45 + .../common/profile-n/tst.profilemsec.d.out | 1 + .../tst/common/profile-n/tst.profilenhz.d | 45 + .../tst/common/profile-n/tst.profilenhz.d.out | 1 + .../test/tst/common/profile-n/tst.profilens.d | 45 + .../tst/common/profile-n/tst.profilens.d.out | 1 + .../tst/common/profile-n/tst.profilensec.d | 45 + .../common/profile-n/tst.profilensec.d.out | 1 + .../test/tst/common/profile-n/tst.profiles.d | 45 + .../tst/common/profile-n/tst.profiles.d.out | 1 + .../tst/common/profile-n/tst.profilesec.d | 45 + .../tst/common/profile-n/tst.profilesec.d.out | 1 + .../test/tst/common/profile-n/tst.profileus.d | 45 + .../tst/common/profile-n/tst.profileus.d.out | 1 + .../tst/common/profile-n/tst.profileusec.d | 45 + .../common/profile-n/tst.profileusec.d.out | 1 + .../test/tst/common/profile-n/tst.sym.ksh | 70 + .../test/tst/common/profile-n/tst.ufunc.ksh | 71 + .../test/tst/common/profile-n/tst.ufuncsort.c | 78 + .../tst/common/profile-n/tst.ufuncsort.ksh | 66 + .../common/profile-n/tst.ufuncsort.ksh.out | 6 + .../test/tst/common/profile-n/tst.umod.ksh | 69 + .../test/tst/common/profile-n/tst.usym.ksh | 70 + .../providers/err.D_PDESC_INVAL.wrongdec4.d | 50 + .../providers/err.D_PDESC_ZERO.nonprofile.d | 50 + .../providers/err.D_PDESC_ZERO.wrongdec1.d | 49 + .../providers/err.D_PDESC_ZERO.wrongdec2.d | 49 + .../providers/err.D_PDESC_ZERO.wrongdec3.d | 49 + .../test/tst/common/providers/tst.basics.d | 57 + .../tst/common/providers/tst.basics.d.out | 1 + .../test/tst/common/providers/tst.beginexit.d | 43 + .../test/tst/common/providers/tst.beginprof.d | 47 + .../tst/common/providers/tst.beginprof.d.out | 1 + .../test/tst/common/providers/tst.probattrs.d | 52 + .../tst/common/providers/tst.probattrs.d.out | 1 + .../test/tst/common/providers/tst.probefunc.d | 52 + .../tst/common/providers/tst.probefunc.d.out | 1 + .../test/tst/common/providers/tst.probemod.d | 52 + .../tst/common/providers/tst.probemod.d.out | 1 + .../test/tst/common/providers/tst.probename.d | 52 + .../tst/common/providers/tst.probename.d.out | 1 + .../test/tst/common/providers/tst.probprov.d | 52 + .../tst/common/providers/tst.probprov.d.out | 1 + .../test/tst/common/providers/tst.profend.d | 57 + .../tst/common/providers/tst.profend.d.out | 2 + .../test/tst/common/providers/tst.profexit.d | 52 + .../tst/common/providers/tst.profexit.d.out | 1 + .../test/tst/common/providers/tst.trace.d | 56 + .../test/tst/common/providers/tst.trace.d.out | 1 + .../test/tst/common/providers/tst.twoprof.d | 58 + .../tst/common/providers/tst.twoprof.d.out | 1 + .../dtrace/test/tst/common/raise/tst.raise1.c | 47 + .../dtrace/test/tst/common/raise/tst.raise1.d | 67 + .../dtrace/test/tst/common/raise/tst.raise2.c | 53 + .../dtrace/test/tst/common/raise/tst.raise2.d | 67 + .../dtrace/test/tst/common/raise/tst.raise3.c | 53 + .../dtrace/test/tst/common/raise/tst.raise3.d | 67 + .../test/tst/common/rates/tst.aggrate.d | 68 + .../test/tst/common/rates/tst.aggrate.d.out | 101 + .../test/tst/common/rates/tst.statusrate.d | 72 + .../test/tst/common/rates/tst.switchrate.d | 62 + .../tst/common/rates/tst.switchrate.d.out | 101 + .../test/tst/common/safety/tst.basename.d | 54 + .../test/tst/common/safety/tst.caller.d | 54 + .../test/tst/common/safety/tst.cleanpath.d | 54 + .../test/tst/common/safety/tst.copyin.d | 83 + .../test/tst/common/safety/tst.copyin2.d | 67 + .../test/tst/common/safety/tst.ddi_pathname.d | 54 + .../test/tst/common/safety/tst.dirname.d | 54 + .../dtrace/test/tst/common/safety/tst.errno.d | 49 + .../test/tst/common/safety/tst.execname.d | 49 + .../dtrace/test/tst/common/safety/tst.gid.d | 49 + .../dtrace/test/tst/common/safety/tst.hton.d | 78 + .../dtrace/test/tst/common/safety/tst.index.d | 67 + .../test/tst/common/safety/tst.msgdsize.d | 64 + .../test/tst/common/safety/tst.msgsize.d | 64 + .../dtrace/test/tst/common/safety/tst.null.d | 78 + .../dtrace/test/tst/common/safety/tst.pid.d | 49 + .../dtrace/test/tst/common/safety/tst.ppid.d | 49 + .../test/tst/common/safety/tst.progenyof.d | 57 + .../test/tst/common/safety/tst.random.d | 73 + .../dtrace/test/tst/common/safety/tst.rw.d | 64 + .../test/tst/common/safety/tst.shortstr.d | 77 + .../dtrace/test/tst/common/safety/tst.stack.d | 52 + .../test/tst/common/safety/tst.stackdepth.d | 53 + .../test/tst/common/safety/tst.stddev.d | 52 + .../test/tst/common/safety/tst.strchr.d | 66 + .../test/tst/common/safety/tst.strjoin.d | 54 + .../test/tst/common/safety/tst.strstr.d | 54 + .../test/tst/common/safety/tst.strtok.d | 54 + .../test/tst/common/safety/tst.substr.d | 54 + .../test/tst/common/safety/tst.ucaller.d | 49 + .../dtrace/test/tst/common/safety/tst.uid.d | 49 + .../test/tst/common/safety/tst.unalign.d | 60 + .../dtrace/test/tst/common/safety/tst.uregs.d | 52 + .../test/tst/common/safety/tst.ustack.d | 52 + .../test/tst/common/safety/tst.ustackdepth.d | 53 + .../test/tst/common/safety/tst.vahole.d | 69 + .../tst/common/safety/tst.violentdeath.ksh | 51 + .../test/tst/common/safety/tst.zonename.d | 49 + .../scalars/err.D_ARR_LOCAL.thisarray.d | 46 + .../scalars/err.D_DECL_CLASS.selfthis.d | 41 + .../scalars/err.D_DECL_CLASS.thisself.d | 42 + .../common/scalars/err.D_DECL_IDRED.errval.d | 44 + .../scalars/err.D_OP_INCOMPAT.dec.err.d | 42 + .../scalars/err.D_OP_INCOMPAT.dupgtype.d | 41 + .../scalars/err.D_OP_INCOMPAT.dupltype.d | 41 + .../scalars/err.D_OP_INCOMPAT.dupttype.d | 42 + .../tst/common/scalars/err.D_SYNTAX.declare.d | 41 + .../test/tst/common/scalars/tst.basicvar.d | 57 + .../tst/common/scalars/tst.basicvar.d.out | 2 + .../test/tst/common/scalars/tst.localvar.d | 54 + .../dtrace/test/tst/common/scalars/tst.misc.d | 50 + .../dtrace/test/tst/common/scalars/tst.self.d | 42 + .../test/tst/common/scalars/tst.selfarray.d | 48 + .../test/tst/common/scalars/tst.selfarray2.d | 64 + .../test/tst/common/scalars/tst.selfthis.d | 45 + .../dtrace/test/tst/common/scalars/tst.this.d | 43 + .../test/tst/common/scalars/tst.thisself.d | 44 + .../test/tst/common/sched/tst.enqueue.d | 48 + .../dtrace/test/tst/common/sched/tst.oncpu.d | 54 + .../test/tst/common/sched/tst.stackdepth.d | 41 + .../scripting/err.D_MACRO_UNDEF.invalidargs.d | 43 + .../common/scripting/err.D_OP_LVAL.rdonly.d | 43 + .../scripting/err.D_OP_WRITE.usepidmacro.d | 43 + .../common/scripting/err.D_SYNTAX.concat.d | 45 + .../tst/common/scripting/err.D_SYNTAX.desc.d | 49 + .../tst/common/scripting/err.D_SYNTAX.inval.d | 43 + .../tst/common/scripting/err.D_SYNTAX.pid.d | 43 + .../scripting/tst.D_MACRO_UNUSED.overflow.ksh | 80 + .../test/tst/common/scripting/tst.arg0.d | 43 + .../tst/common/scripting/tst.arguments.ksh | 90 + .../test/tst/common/scripting/tst.assign.d | 43 + .../test/tst/common/scripting/tst.basic.d | 42 + .../test/tst/common/scripting/tst.egid.d | 43 + .../test/tst/common/scripting/tst.egid.ksh | 97 + .../test/tst/common/scripting/tst.euid.d | 44 + .../test/tst/common/scripting/tst.euid.ksh | 86 + .../test/tst/common/scripting/tst.gid.d | 43 + .../test/tst/common/scripting/tst.gid.ksh | 86 + .../test/tst/common/scripting/tst.pgid.d | 43 + .../test/tst/common/scripting/tst.pid.d | 43 + .../test/tst/common/scripting/tst.ppid.d | 43 + .../test/tst/common/scripting/tst.ppid.ksh | 86 + .../test/tst/common/scripting/tst.projid.d | 43 + .../test/tst/common/scripting/tst.projid.ksh | 86 + .../test/tst/common/scripting/tst.quite.d | 42 + .../test/tst/common/scripting/tst.sid.d | 43 + .../test/tst/common/scripting/tst.sid.ksh | 86 + .../tst/common/scripting/tst.stringmacro.ksh | 78 + .../test/tst/common/scripting/tst.taskid.d | 43 + .../test/tst/common/scripting/tst.taskid.ksh | 86 + .../test/tst/common/scripting/tst.trace.d | 43 + .../test/tst/common/scripting/tst.uid.d | 43 + .../test/tst/common/scripting/tst.uid.ksh | 86 + .../sizeof/err.D_IDENT_BADREF.SizeofAssoc.d | 51 + .../sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d | 42 + .../tst/common/sizeof/err.D_SIZEOF_TYPE.d | 41 + .../sizeof/err.D_SYNTAX.SizeofBadType.d | 42 + .../test/tst/common/sizeof/tst.SizeofArray.d | 61 + .../tst/common/sizeof/tst.SizeofDataTypes.d | 122 + .../tst/common/sizeof/tst.SizeofExpression.d | 64 + .../test/tst/common/sizeof/tst.SizeofNULL.d | 48 + .../tst/common/sizeof/tst.SizeofStrConst.d | 42 + .../common/sizeof/tst.SizeofStrConst.d.out | 2 + .../tst/common/sizeof/tst.SizeofString1.d | 51 + .../tst/common/sizeof/tst.SizeofString1.d.out | 3 + .../tst/common/sizeof/tst.SizeofString2.d | 44 + .../tst/common/sizeof/tst.SizeofString2.d.out | 2 + .../bug.1001148.SpecSizeVariations.d | 87 + .../speculation/err.BufSizeVariations1.d | 88 + .../speculation/err.BufSizeVariations2.d | 88 + .../err.D_ACT_SPEC.SpeculateWithBreakPoint.d | 69 + .../err.D_ACT_SPEC.SpeculateWithChill.d | 69 + .../err.D_ACT_SPEC.SpeculateWithCopyOut.d | 69 + .../err.D_ACT_SPEC.SpeculateWithCopyOutStr.d | 68 + .../err.D_ACT_SPEC.SpeculateWithPanic.d | 69 + .../err.D_ACT_SPEC.SpeculateWithRaise.d | 68 + .../err.D_ACT_SPEC.SpeculateWithStop.d | 68 + .../speculation/err.D_AGG_COMM.AggAftCommit.d | 40 + .../err.D_AGG_SPEC.SpeculateWithAvg.d | 67 + .../err.D_AGG_SPEC.SpeculateWithCount.d | 67 + .../err.D_AGG_SPEC.SpeculateWithLquant.d | 72 + .../err.D_AGG_SPEC.SpeculateWithMax.d | 62 + .../err.D_AGG_SPEC.SpeculateWithMin.d | 62 + .../err.D_AGG_SPEC.SpeculateWithQuant.d | 67 + .../err.D_AGG_SPEC.SpeculateWithSum.d | 62 + .../err.D_COMM_COMM.CommitAftCommit.d | 82 + .../err.D_COMM_COMM.DisjointCommit.d | 102 + .../err.D_COMM_DREC.CommitAftDataRec.d | 51 + .../err.D_DREC_COMM.DataRecAftCommit.d | 73 + .../err.D_DREC_COMM.ExitAfterCommit.d | 61 + .../speculation/err.D_EXIT_SPEC.ExitAftSpec.d | 70 + .../err.D_PRAGMA_MALFORM.NspecExpr.d | 77 + .../err.D_PRAGMA_OPTSET.HugeNspecValue.d | 76 + .../err.D_PRAGMA_OPTSET.InvalidSpecSize.d | 53 + .../err.D_PRAGMA_OPTSET.NegSpecSize.d | 78 + .../speculation/err.D_PROTO_LEN.SpecNoId.d | 61 + .../err.D_SPEC_COMM.SpecAftCommit.d | 72 + .../err.D_SPEC_DREC.SpecAftDataRec.d | 70 + .../speculation/err.D_SPEC_SPEC.SpecAftSpec.d | 66 + .../common/speculation/err.NegativeBufSize.d | 88 + .../common/speculation/err.NegativeNspec.d | 48 + .../common/speculation/err.NegativeSpecSize.d | 47 + .../speculation/err.SpecSizeVariations1.d | 78 + .../speculation/err.SpecSizeVariations2.d | 78 + .../speculation/tst.CommitAfterDiscard.d | 86 + .../common/speculation/tst.CommitWithZero.d | 66 + .../speculation/tst.DataRecAftDiscard.d | 77 + .../common/speculation/tst.DiscardAftCommit.d | 85 + .../speculation/tst.DiscardAftDataRec.d | 50 + .../speculation/tst.DiscardAftDiscard.d | 85 + .../common/speculation/tst.DiscardWithZero.d | 67 + .../common/speculation/tst.ExitAftDiscard.d | 56 + .../tst/common/speculation/tst.NoSpecBuffer.d | 64 + .../speculation/tst.SpecSizeVariations1.d | 78 + .../speculation/tst.SpecSizeVariations2.d | 78 + .../speculation/tst.SpecSizeVariations3.d | 78 + .../speculation/tst.SpeculateWithRandom.d | 59 + .../speculation/tst.SpeculationCommit.d | 75 + .../speculation/tst.SpeculationDiscard.d | 74 + .../common/speculation/tst.SpeculationID.d | 50 + .../speculation/tst.SpeculationWithZero.d | 65 + .../common/speculation/tst.TwoSpecBuffers.d | 77 + .../tst/common/speculation/tst.negcommit.d | 37 + .../test/tst/common/speculation/tst.negspec.d | 37 + .../tst/common/speculation/tst.zerosize.d | 53 + .../stability/err.D_ATTR_MIN.MinAttributes.d | 50 + .../tst/common/stack/err.D_STACK_PROTO.bad.d | 43 + .../test/tst/common/stack/err.D_STACK_SIZE.d | 40 + .../common/stack/err.D_USTACK_FRAMES.bad.d | 44 + .../tst/common/stack/err.D_USTACK_PROTO.bad.d | 44 + .../common/stack/err.D_USTACK_STRSIZE.bad.d | 44 + .../test/tst/common/stack/tst.default.d | 41 + .../test/tst/common/stackdepth/tst.default.d | 41 + .../dtrace/test/tst/common/stop/tst.stop1.c | 37 + .../dtrace/test/tst/common/stop/tst.stop1.d | 78 + .../dtrace/test/tst/common/stop/tst.stop2.c | 37 + .../dtrace/test/tst/common/stop/tst.stop2.d | 78 + .../test/tst/common/strlen/tst.strlen1.d | 46 + .../struct/err.D_ADDROF_VAR.StructPointer.d | 59 + .../err.D_DECL_COMBO.StructWithoutColon.d | 74 + .../err.D_DECL_COMBO.StructWithoutColon1.d | 68 + .../struct/err.D_DECL_INCOMPLETE.circular.d | 66 + .../struct/err.D_DECL_INCOMPLETE.order.d | 69 + .../struct/err.D_DECL_INCOMPLETE.order2.d | 108 + .../struct/err.D_DECL_INCOMPLETE.recursive.d | 59 + .../struct/err.D_DECL_INCOMPLETE.simple.d | 59 + .../common/struct/err.D_DECL_VOIDOBJ.baddec.d | 46 + .../struct/err.D_PROTO_ARG.DupStructAssoc.d | 80 + .../test/tst/common/struct/tst.StructAssoc.d | 71 + .../tst/common/struct/tst.StructDataTypes.d | 133 + .../test/tst/common/struct/tst.StructInside.d | 124 + .../test/tst/common/struct/tst.clauselocal.d | 52 + .../tst/common/struct/tst.clauselocal.d.out | 2 + .../dtrace/test/tst/common/syscall/tst.args.c | 41 + .../dtrace/test/tst/common/syscall/tst.args.d | 46 + .../test/tst/common/syscall/tst.openret.ksh | 75 + .../test/tst/common/sysevent/tst.post.c | 45 + .../test/tst/common/sysevent/tst.post.d | 88 + .../test/tst/common/sysevent/tst.post_chan.c | 51 + .../test/tst/common/sysevent/tst.post_chan.d | 87 + .../tst/common/tick-n/err.D_PDESC_ZERO.tick.d | 45 + .../tst/common/tick-n/err.D_PDESC_ZEROonens.d | 44 + .../common/tick-n/err.D_PDESC_ZEROonensec.d | 44 + .../tst/common/tick-n/err.D_PDESC_ZEROoneus.d | 44 + .../common/tick-n/err.D_PDESC_ZEROoneusec.d | 44 + .../test/tst/common/tick-n/tst.tickarg0.d | 45 + .../test/tst/common/tick-n/tst.tickms.d | 45 + .../test/tst/common/tick-n/tst.tickms.d.out | 2 + .../test/tst/common/tick-n/tst.tickmsec.d | 45 + .../test/tst/common/tick-n/tst.tickmsec.d.out | 2 + .../test/tst/common/tick-n/tst.tickns.d | 45 + .../test/tst/common/tick-n/tst.tickns.d.out | 2 + .../test/tst/common/tick-n/tst.ticknsec.d | 45 + .../test/tst/common/tick-n/tst.ticknsec.d.out | 2 + .../dtrace/test/tst/common/tick-n/tst.ticks.d | 45 + .../test/tst/common/tick-n/tst.ticks.d.out | 2 + .../test/tst/common/tick-n/tst.ticksec.d | 49 + .../test/tst/common/tick-n/tst.ticksec.d.out | 2 + .../test/tst/common/tick-n/tst.tickus.d | 45 + .../test/tst/common/tick-n/tst.tickus.d.out | 2 + .../test/tst/common/tick-n/tst.tickusec.d | 45 + .../test/tst/common/tick-n/tst.tickusec.d.out | 2 + .../tst/common/trace/err.D_PROTO_LEN.bad.d | 41 + .../tst/common/trace/err.D_TRACE_VOID.bad.d | 39 + .../dtrace/test/tst/common/trace/tst.misc.d | 68 + .../test/tst/common/trace/tst.qstring.d | 48 + .../test/tst/common/trace/tst.qstring.d.out | 3 + .../dtrace/test/tst/common/trace/tst.string.d | 43 + .../common/tracemem/err.D_PROTO_ARG.badsize.d | 39 + .../common/tracemem/err.D_PROTO_LEN.toofew.d | 40 + .../common/tracemem/err.D_PROTO_LEN.toomany.d | 39 + .../tracemem/err.D_TRACEMEM_ADDR.badaddr.d | 39 + .../tracemem/err.D_TRACEMEM_SIZE.negsize.d | 39 + .../tracemem/err.D_TRACEMEM_SIZE.zerosize.d | 39 + .../test/tst/common/tracemem/tst.rootvp.d | 59 + .../err.D_DECL_TYPERED.BadTransDecl.d | 64 + .../err.D_OP_INCOMPLETE.NonExistentInput1.d | 54 + .../translators/err.D_SYNTAX.BadTransDecl1.d | 60 + .../translators/err.D_SYNTAX.BadTransDecl3.d | 59 + .../translators/err.D_SYNTAX.BadTransDecl4.d | 65 + .../err.D_TYPE_MEMBER.NonExistentInput2.d | 60 + .../err.D_XLATE_INCOMPAT.BadInputType1.d | 60 + .../err.D_XLATE_MEMB.NonExistentOutput2.d | 60 + .../err.D_XLATE_NONE.BadTransDecl6.d | 72 + .../err.D_XLATE_REDECL.RepeatTransDecl.d | 67 + .../err.D_XLATE_SOU.BadTransDecl8.d | 58 + .../translators/err.D_XLATE_SOU.BadTransInt.d | 52 + .../err.D_XLATE_SOU.NonExistentOutput1.d | 55 + .../translators/man.TestTransStability.d | 61 + .../translators/tst.CircularTransDecl.d | 100 + .../common/translators/tst.EmptyTransDecl.d | 79 + .../tst/common/translators/tst.ForwardTag.d | 60 + .../common/translators/tst.InputAliasTrans.d | 60 + .../common/translators/tst.InputIntTrans.d | 60 + .../common/translators/tst.OutputAliasTrans.d | 63 + .../translators/tst.PartialDereferencing.d | 85 + .../translators/tst.PartialOutputTransDefn.d | 60 + .../common/translators/tst.ProcModelTrans.d | 53 + .../translators/tst.RepeatDeclaration.d | 71 + .../translators/tst.SimultaneousTranslators.d | 71 + .../translators/tst.StructureAssignment.d | 85 + .../common/translators/tst.TransNonPointer.d | 84 + .../translators/tst.TransOutputPointer.d | 80 + .../tst/common/translators/tst.TransPointer.d | 63 + .../common/translators/tst.TranslateSelf.d | 76 + .../common/translators/tst.UnionInputTrans.d | 61 + .../common/translators/tst.UnionOutputTrans.d | 61 + .../typedef/err.D_DECL_IDRED.DupTypeDef.d | 51 + .../typedef/err.D_SYNTAX.BadExistingTypedef.d | 45 + .../typedef/err.D_SYNTAX.TypedefInClause.d | 43 + .../tst/common/typedef/tst.ChainTypedef.d | 48 + .../common/typedef/tst.TypedefDataAssign.d | 118 + .../common/types/err.D_CAST_INVAL.badcast.d | 45 + .../common/types/err.D_CG_DYN.ResultDynType.d | 47 + .../common/types/err.D_CHR_OFLOW.charconst.d | 46 + .../common/types/err.D_DECL_BADCLASS.bad.d | 43 + .../types/err.D_DECL_CHARATTR.badtype3.d | 44 + .../common/types/err.D_DECL_COMBO.badtype4.d | 44 + .../common/types/err.D_DECL_COMBO.badtype5.d | 44 + .../common/types/err.D_DECL_ENCONST.badeval.d | 39 + .../common/types/err.D_DECL_ENOFLOW.enoflow.d | 38 + .../common/types/err.D_DECL_ENOFLOW.enuflow.d | 39 + .../common/types/err.D_DECL_SCOPE.scopeop.d | 46 + .../common/types/err.D_DECL_USELESS.baddec.d | 43 + .../tst/common/types/err.D_OP_ACT.badcond.d | 46 + .../common/types/err.D_OP_ARITH.badoperand.d | 44 + .../types/err.D_OP_INCOMPAT.badassign.d | 44 + .../tst/common/types/err.D_OP_INT.badbitop.d | 43 + .../tst/common/types/err.D_OP_INT.badshift.d | 43 + .../common/types/err.D_OP_SCALAR.badcond.d | 44 + .../common/types/err.D_OP_SCALAR.badincop.d | 44 + .../common/types/err.D_OP_SCALAR.badlogop.d | 43 + .../common/types/err.D_PROTO_LEN.badcond1.d | 45 + .../tst/common/types/err.D_SYNTAX.badenum.d | 40 + .../tst/common/types/err.D_SYNTAX.badid.d | 46 + .../tst/common/types/err.D_SYNTAX.badstruct.d | 38 + .../tst/common/types/err.D_UNKNOWN.badtype1.d | 44 + .../tst/common/types/err.D_UNKNOWN.badtype2.d | 44 + .../tst/common/types/err.D_UNKNOWN.dupenum.d | 39 + .../common/types/err.D_UNKNOWN.dupstruct.d | 39 + .../types/err.D_XLATE_REDECL.ResultDynType.d | 48 + .../test/tst/common/types/tst.assignops.d | 82 + .../test/tst/common/types/tst.badshiftops.d | 49 + .../dtrace/test/tst/common/types/tst.basics.d | 59 + .../test/tst/common/types/tst.basics.d.out | 16 + .../dtrace/test/tst/common/types/tst.bitops.d | 62 + .../test/tst/common/types/tst.charconstants.d | 68 + .../test/tst/common/types/tst.complex.d | 74 + .../test/tst/common/types/tst.condexpr.d | 61 + .../test/tst/common/types/tst.constants.d | 52 + .../dtrace/test/tst/common/types/tst.conv.d | 109 + .../dtrace/test/tst/common/types/tst.enum.d | 51 + .../test/tst/common/types/tst.intincop.d | 70 + .../dtrace/test/tst/common/types/tst.intops.d | 70 + .../test/tst/common/types/tst.inttypes.d | 52 + .../test/tst/common/types/tst.ptrincop.d | 72 + .../dtrace/test/tst/common/types/tst.ptrops.d | 71 + .../test/tst/common/types/tst.relenum.d | 73 + .../test/tst/common/types/tst.relstring.d | 70 + .../test/tst/common/types/tst.shiftops.d | 62 + .../tst/common/types/tst.stringconstants.d | 51 + .../dtrace/test/tst/common/types/tst.struct.d | 84 + .../test/tst/common/types/tst.typedef.d | 85 + .../test/tst/common/types/tst.unaryop.d | 50 + .../union/err.D_ADDROF_VAR.UnionPointer.d | 60 + .../err.D_DECL_COMBO.UnionWithoutColon.d | 69 + .../err.D_DECL_COMBO.UnionWithoutColon1.d | 68 + .../union/err.D_DECL_INCOMPLETE.circular.d | 65 + .../union/err.D_DECL_INCOMPLETE.order.d | 69 + .../union/err.D_DECL_INCOMPLETE.recursive.d | 59 + .../union/err.D_DECL_INCOMPLETE.simple.d | 58 + .../union/err.D_PROTO_ARG.DupUnionAssoc.d | 80 + .../test/tst/common/union/tst.UnionAssoc.d | 71 + .../tst/common/union/tst.UnionDataTypes.d | 132 + .../test/tst/common/union/tst.UnionInside.d | 85 + .../cmd/dtrace/test/tst/common/usdt/argmap.d | 31 + .../cmd/dtrace/test/tst/common/usdt/args.d | 31 + .../cmd/dtrace/test/tst/common/usdt/forker.d | 31 + .../test/tst/common/usdt/tst.andpid.ksh | 46 + .../dtrace/test/tst/common/usdt/tst.argmap.c | 39 + .../dtrace/test/tst/common/usdt/tst.argmap.d | 65 + .../dtrace/test/tst/common/usdt/tst.args.c | 39 + .../dtrace/test/tst/common/usdt/tst.args.d | 60 + .../test/tst/common/usdt/tst.badguess.ksh | 84 + .../test/tst/common/usdt/tst.dlclose1.ksh | 159 + .../test/tst/common/usdt/tst.dlclose1.ksh.out | 3 + .../test/tst/common/usdt/tst.dlclose2.ksh | 160 + .../test/tst/common/usdt/tst.dlclose2.ksh.out | 2 + .../test/tst/common/usdt/tst.dlclose3.ksh | 170 + .../test/tst/common/usdt/tst.eliminate.ksh | 106 + .../test/tst/common/usdt/tst.enabled.ksh | 96 + .../test/tst/common/usdt/tst.enabled.ksh.out | 2 + .../test/tst/common/usdt/tst.enabled2.ksh | 113 + .../test/tst/common/usdt/tst.enabled2.ksh.out | 3 + .../test/tst/common/usdt/tst.entryreturn.ksh | 118 + .../tst/common/usdt/tst.entryreturn.ksh.out | 10 + .../dtrace/test/tst/common/usdt/tst.fork.ksh | 105 + .../test/tst/common/usdt/tst.fork.ksh.out | 4 + .../dtrace/test/tst/common/usdt/tst.forker.c | 47 + .../test/tst/common/usdt/tst.forker.ksh | 55 + .../test/tst/common/usdt/tst.guess32.ksh | 96 + .../test/tst/common/usdt/tst.guess64.ksh | 100 + .../test/tst/common/usdt/tst.header.ksh | 85 + .../test/tst/common/usdt/tst.include.ksh | 61 + .../test/tst/common/usdt/tst.linkpriv.ksh | 82 + .../test/tst/common/usdt/tst.linkunpriv.ksh | 84 + .../test/tst/common/usdt/tst.multiple.ksh | 99 + .../test/tst/common/usdt/tst.multiple.ksh.out | 5 + .../test/tst/common/usdt/tst.nodtrace.ksh | 90 + .../test/tst/common/usdt/tst.onlyenabled.ksh | 82 + .../test/tst/common/usdt/tst.reeval.ksh | 98 + .../test/tst/common/usdt/tst.static.ksh | 98 + .../test/tst/common/usdt/tst.static.ksh.out | 5 + .../test/tst/common/usdt/tst.static2.ksh | 108 + .../test/tst/common/usdt/tst.static2.ksh.out | 5 + .../dtrace/test/tst/common/usdt/tst.user.ksh | 96 + .../test/tst/common/usdt/tst.user.ksh.out | 2 + .../test/tst/common/ustack/tst.bigstack.c | 61 + .../test/tst/common/ustack/tst.bigstack.d | 45 + .../test/tst/common/ustack/tst.depth.ksh | 110 + .../dtrace/test/tst/common/ustack/tst.spin.c | 61 + .../test/tst/common/ustack/tst.spin.ksh | 139 + .../cmd/dtrace/test/tst/common/vars/tst.gid.d | 41 + .../test/tst/common/vars/tst.nullassign.d | 94 + .../dtrace/test/tst/common/vars/tst.ppid.d | 41 + .../test/tst/common/vars/tst.ucaller.ksh | 65 + .../test/tst/common/vars/tst.ucaller.ksh.out | 3 + .../cmd/dtrace/test/tst/common/vars/tst.uid.d | 41 + .../test/tst/common/vars/tst.walltimestamp.d | 55 + .../dtrace/test/tst/common/version/tst.1.0.d | 48 + .../test/tst/i386/arrays/tst.uregsarray.d | 63 + .../test/tst/i386/funcs/tst.badcopyin.d | 53 + .../test/tst/i386/funcs/tst.badcopyinstr.d | 52 + .../test/tst/i386/funcs/tst.badcopyout.d | 56 + .../test/tst/i386/funcs/tst.badcopyoutstr.d | 56 + .../dtrace/test/tst/i386/pid/tst.badinstr.d | 40 + .../dtrace/test/tst/i386/pid/tst.badinstr.s | 41 + .../cmd/dtrace/test/tst/i386/pid/tst.branch.d | 78 + .../cmd/dtrace/test/tst/i386/pid/tst.branch.s | 73 + .../dtrace/test/tst/i386/pid/tst.embedded.d | 73 + .../dtrace/test/tst/i386/pid/tst.embedded.s | 68 + .../cmd/dtrace/test/tst/i386/pid/tst.ret.d | 76 + .../cmd/dtrace/test/tst/i386/pid/tst.ret.s | 114 + .../dtrace/test/tst/i386/pid/tst.retlist.ksh | 50 + .../dtrace/test/tst/i386/pid/tst.retlist.s | 51 + .../test/tst/i386/ustack/annotated_helper.d | 32 + .../test/tst/i386/ustack/helper_helper.d | 32 + .../test/tst/i386/ustack/tst.annotated.c | 43 + .../test/tst/i386/ustack/tst.annotated.d | 35 + .../test/tst/i386/ustack/tst.annotated.d.out | 4 + .../test/tst/i386/ustack/tst.circstack.d | 46 + .../test/tst/i386/ustack/tst.circstack.s | 43 + .../dtrace/test/tst/i386/ustack/tst.helper.c | 82 + .../dtrace/test/tst/i386/ustack/tst.helper.d | 44 + .../test/tst/i386/ustack/tst.helper.d.out | 4 + .../cmd/dtrace/test/tst/i86xpv/Makefile | 29 + .../dtrace/test/tst/i86xpv/xdt/tst.basic.ksh | 79 + .../test/tst/i86xpv/xdt/tst.hvmenable.ksh | 64 + .../test/tst/i86xpv/xdt/tst.memenable.ksh | 65 + .../test/tst/i86xpv/xdt/tst.schedargs.ksh | 123 + .../test/tst/i86xpv/xdt/tst.schedenable.ksh | 74 + .../test/tst/sparc/arrays/tst.uregsarray.d | 85 + .../sparc/pid/err.D_PROC_ALIGN.misaligned.d | 40 + .../sparc/pid/err.D_PROC_ALIGN.misaligned.exe | 29 + .../cmd/dtrace/test/tst/sparc/pid/tst.br.d | 70 + .../dtrace/test/tst/sparc/pid/tst.br.d.out | 23 + .../cmd/dtrace/test/tst/sparc/pid/tst.br.s | 81 + .../dtrace/test/tst/sparc/pid/tst.branch.d | 78 + .../dtrace/test/tst/sparc/pid/tst.branch.s | 63 + .../dtrace/test/tst/sparc/pid/tst.embedded.d | 73 + .../dtrace/test/tst/sparc/pid/tst.embedded.s | 59 + .../test/tst/sparc/usdt/tst.tailcall.ksh | 132 + .../test/tst/sparc/ustack/annotated_helper.d | 32 + .../test/tst/sparc/ustack/helper_helper.d | 32 + .../test/tst/sparc/ustack/tst.annotated.c | 43 + .../test/tst/sparc/ustack/tst.annotated.d | 35 + .../test/tst/sparc/ustack/tst.annotated.d.out | 4 + .../test/tst/sparc/ustack/tst.circstack.d | 46 + .../test/tst/sparc/ustack/tst.circstack.s | 44 + .../dtrace/test/tst/sparc/ustack/tst.helper.c | 81 + .../dtrace/test/tst/sparc/ustack/tst.helper.d | 44 + .../test/tst/sparc/ustack/tst.helper.d.out | 4 + .../test/tst/sparc/ustack/tst.trapstat.ksh | 87 + .../opensolaris/cmd/mdb/tools/common/die.c | 87 + .../opensolaris/cmd/mdb/tools/common/util.h | 51 + .../cmd/sgs/include/_string_table.h | 126 + .../opensolaris/cmd/sgs/include/alist.h | 280 + .../opensolaris/cmd/sgs/include/debug.h | 1017 + .../contrib/opensolaris/cmd/sgs/include/sgs.h | 296 + .../cmd/sgs/include/string_table.h | 63 + .../opensolaris/cmd/sgs/messages/sgs.ident | 62 + .../cmd/sgs/tools/common/findprime.c | 56 + .../opensolaris/cmd/sgs/tools/common/sgsmsg.c | 1210 ++ .../cmd/sgs/tools/common/string_table.c | 685 + cddl/contrib/opensolaris/common/avl/avl.c | 969 + .../opensolaris/common/ctf/ctf_create.c | 1366 ++ .../contrib/opensolaris/common/ctf/ctf_decl.c | 184 + .../opensolaris/common/ctf/ctf_error.c | 97 + .../contrib/opensolaris/common/ctf/ctf_hash.c | 178 + .../contrib/opensolaris/common/ctf/ctf_impl.h | 336 + .../opensolaris/common/ctf/ctf_labels.c | 153 + .../opensolaris/common/ctf/ctf_lookup.c | 313 + .../contrib/opensolaris/common/ctf/ctf_open.c | 954 + .../opensolaris/common/ctf/ctf_types.c | 845 + .../contrib/opensolaris/common/ctf/ctf_util.c | 152 + cddl/contrib/opensolaris/head/nlist.h | 54 + cddl/contrib/opensolaris/head/note.h | 55 + cddl/contrib/opensolaris/head/storclass.h | 79 + cddl/contrib/opensolaris/head/syms.h | 230 + .../opensolaris/lib/libctf/common/ctf_lib.c | 500 + .../opensolaris/lib/libctf/common/ctf_subr.c | 83 + .../opensolaris/lib/libctf/common/libctf.h | 60 + .../opensolaris/lib/libdtrace/common/drti.c | 206 + .../lib/libdtrace/common/dt_aggregate.c | 1886 ++ .../opensolaris/lib/libdtrace/common/dt_as.c | 501 + .../opensolaris/lib/libdtrace/common/dt_as.h | 64 + .../opensolaris/lib/libdtrace/common/dt_buf.c | 177 + .../opensolaris/lib/libdtrace/common/dt_buf.h | 69 + .../opensolaris/lib/libdtrace/common/dt_cc.c | 2349 +++ .../opensolaris/lib/libdtrace/common/dt_cg.c | 2006 ++ .../lib/libdtrace/common/dt_consume.c | 2646 +++ .../lib/libdtrace/common/dt_decl.c | 1127 ++ .../lib/libdtrace/common/dt_decl.h | 126 + .../opensolaris/lib/libdtrace/common/dt_dis.c | 511 + .../opensolaris/lib/libdtrace/common/dt_dof.c | 969 + .../opensolaris/lib/libdtrace/common/dt_dof.h | 66 + .../lib/libdtrace/common/dt_error.c | 235 + .../lib/libdtrace/common/dt_errtags.h | 251 + .../lib/libdtrace/common/dt_grammar.y | 834 + .../lib/libdtrace/common/dt_handle.c | 483 + .../lib/libdtrace/common/dt_ident.c | 1047 + .../lib/libdtrace/common/dt_ident.h | 183 + .../lib/libdtrace/common/dt_impl.h | 691 + .../lib/libdtrace/common/dt_inttab.c | 115 + .../lib/libdtrace/common/dt_inttab.h | 69 + .../opensolaris/lib/libdtrace/common/dt_lex.l | 860 + .../lib/libdtrace/common/dt_link.c | 1793 ++ .../lib/libdtrace/common/dt_list.c | 111 + .../lib/libdtrace/common/dt_list.h | 53 + .../opensolaris/lib/libdtrace/common/dt_map.c | 442 + .../lib/libdtrace/common/dt_module.c | 1383 ++ .../lib/libdtrace/common/dt_module.h | 56 + .../lib/libdtrace/common/dt_open.c | 1645 ++ .../lib/libdtrace/common/dt_options.c | 1031 + .../lib/libdtrace/common/dt_parser.c | 4893 +++++ .../lib/libdtrace/common/dt_parser.h | 285 + .../opensolaris/lib/libdtrace/common/dt_pcb.c | 187 + .../opensolaris/lib/libdtrace/common/dt_pcb.h | 103 + .../opensolaris/lib/libdtrace/common/dt_pid.c | 863 + .../opensolaris/lib/libdtrace/common/dt_pid.h | 64 + .../lib/libdtrace/common/dt_pragma.c | 507 + .../lib/libdtrace/common/dt_printf.c | 1979 ++ .../lib/libdtrace/common/dt_printf.h | 135 + .../lib/libdtrace/common/dt_proc.c | 1225 ++ .../lib/libdtrace/common/dt_proc.h | 118 + .../lib/libdtrace/common/dt_program.c | 618 + .../lib/libdtrace/common/dt_program.h | 63 + .../lib/libdtrace/common/dt_provider.c | 883 + .../lib/libdtrace/common/dt_provider.h | 118 + .../lib/libdtrace/common/dt_regset.c | 107 + .../lib/libdtrace/common/dt_regset.h | 53 + .../lib/libdtrace/common/dt_string.c | 325 + .../lib/libdtrace/common/dt_string.h | 51 + .../lib/libdtrace/common/dt_strtab.c | 293 + .../lib/libdtrace/common/dt_strtab.h | 72 + .../lib/libdtrace/common/dt_subr.c | 997 + .../lib/libdtrace/common/dt_work.c | 319 + .../lib/libdtrace/common/dt_xlator.c | 383 + .../lib/libdtrace/common/dt_xlator.h | 87 + .../opensolaris/lib/libdtrace/common/dtrace.h | 581 + .../lib/libdtrace/common/mkerrtags.sh | 59 + .../lib/libdtrace/common/mknames.sh | 55 + .../opensolaris/lib/libgen/common/gmatch.c | 179 + .../lib/libzpool/common/sys/zfs_context.h | 3 - .../tools/ctf/common/ctf_headers.h | 72 + .../opensolaris/tools/ctf/common/list.c | 228 + .../opensolaris/tools/ctf/common/list.h | 58 + .../opensolaris/tools/ctf/common/memory.c | 103 + .../opensolaris/tools/ctf/common/memory.h | 52 + .../opensolaris/tools/ctf/common/symbol.c | 62 + .../opensolaris/tools/ctf/common/symbol.h | 44 + .../opensolaris/tools/ctf/common/utils.c | 104 + .../opensolaris/tools/ctf/common/utils.h | 53 + .../contrib/opensolaris/tools/ctf/cvt/alist.c | 215 + .../contrib/opensolaris/tools/ctf/cvt/alist.h | 57 + .../opensolaris/tools/ctf/cvt/barrier.c | 92 + .../opensolaris/tools/ctf/cvt/barrier.h | 62 + .../opensolaris/tools/ctf/cvt/compare.c | 92 + cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c | 1263 ++ .../opensolaris/tools/ctf/cvt/ctfconvert.c | 263 + .../opensolaris/tools/ctf/cvt/ctfmerge.c | 1004 + .../opensolaris/tools/ctf/cvt/ctfmerge.h | 89 + .../opensolaris/tools/ctf/cvt/ctftools.h | 453 + .../contrib/opensolaris/tools/ctf/cvt/dwarf.c | 1848 ++ cddl/contrib/opensolaris/tools/ctf/cvt/fifo.c | 153 + cddl/contrib/opensolaris/tools/ctf/cvt/fifo.h | 54 + .../opensolaris/tools/ctf/cvt/fixup_tdescs.c | 279 + cddl/contrib/opensolaris/tools/ctf/cvt/hash.c | 291 + cddl/contrib/opensolaris/tools/ctf/cvt/hash.h | 59 + .../opensolaris/tools/ctf/cvt/iidesc.c | 197 + .../contrib/opensolaris/tools/ctf/cvt/input.c | 419 + .../contrib/opensolaris/tools/ctf/cvt/merge.c | 1143 ++ .../opensolaris/tools/ctf/cvt/output.c | 757 + .../opensolaris/tools/ctf/cvt/st_parse.c | 1198 ++ .../contrib/opensolaris/tools/ctf/cvt/stabs.c | 381 + .../contrib/opensolaris/tools/ctf/cvt/stack.c | 112 + .../contrib/opensolaris/tools/ctf/cvt/stack.h | 53 + .../opensolaris/tools/ctf/cvt/strtab.c | 258 + .../opensolaris/tools/ctf/cvt/strtab.h | 69 + .../contrib/opensolaris/tools/ctf/cvt/tdata.c | 488 + .../opensolaris/tools/ctf/cvt/traverse.c | 226 + .../opensolaris/tools/ctf/cvt/traverse.h | 71 + cddl/contrib/opensolaris/tools/ctf/cvt/util.c | 283 + .../contrib/opensolaris/tools/ctf/dump/dump.c | 1028 + cddl/lib/Makefile | 5 +- cddl/lib/drti/Makefile | 23 + cddl/lib/libctf/Makefile | 34 + cddl/lib/libdtrace/Makefile | 97 + cddl/lib/libdtrace/errno.d | 228 + cddl/lib/libdtrace/net.d | 43 + cddl/lib/libdtrace/nfs.d | 96 + cddl/lib/libdtrace/psinfo.d | 95 + cddl/lib/libdtrace/sched.d | 86 + cddl/lib/libdtrace/signal.d | 101 + cddl/lib/libdtrace/unistd.d | 56 + cddl/usr.bin/Makefile | 7 +- cddl/usr.bin/ctfconvert/Makefile | 51 + cddl/usr.bin/ctfdump/Makefile | 31 + cddl/usr.bin/ctfmerge/Makefile | 47 + cddl/usr.bin/sgsmsg/Makefile | 20 + cddl/usr.sbin/Makefile | 3 +- cddl/usr.sbin/dtrace/Makefile | 37 + include/elf.h | 4 - lib/Makefile | 10 +- lib/libdwarf/Makefile | 30 + lib/libdwarf/_libdwarf.h | 168 + lib/libdwarf/dwarf.h | 478 + lib/libdwarf/dwarf_abbrev.c | 71 + lib/libdwarf/dwarf_attr.c | 92 + lib/libdwarf/dwarf_attrval.c | 270 + lib/libdwarf/dwarf_cu.c | 68 + lib/libdwarf/dwarf_dealloc.c | 41 + lib/libdwarf/dwarf_die.c | 191 + lib/libdwarf/dwarf_dump.c | 892 + lib/libdwarf/dwarf_errmsg.c | 76 + lib/libdwarf/dwarf_errno.c | 38 + lib/libdwarf/dwarf_finish.c | 98 + lib/libdwarf/dwarf_form.c | 47 + lib/libdwarf/dwarf_init.c | 748 + lib/libdwarf/dwarf_loc.c | 613 + lib/libdwarf/libdwarf.h | 162 + lib/libelf/elf_strptr.c | 2 +- lib/libelf/elf_update.c | 21 +- lib/libelf/gelf_rel.c | 13 +- lib/libelf/gelf_rela.c | 14 +- lib/libelf/libelf_align.c | 2 +- lib/libelf/libelf_convert.m4 | 2 +- lib/libelf/libelf_data.c | 2 + lib/libelf/libelf_xlate.c | 11 +- lib/libproc/Makefile | 20 + lib/libproc/_libproc.h | 43 + lib/libproc/libproc.h | 73 + lib/libproc/proc_create.c | 163 + lib/libproc/proc_sym.c | 68 + lib/libproc/proc_util.c | 133 + share/mk/bsd.lib.mk | 42 +- share/mk/bsd.libnames.mk | 12 +- share/mk/bsd.prog.mk | 10 + share/mk/sys.mk | 76 + sys/amd64/amd64/exception.S | 109 + sys/amd64/amd64/local_apic.c | 17 + sys/amd64/amd64/trap.c | 75 +- sys/amd64/amd64/tsc.c | 20 + sys/amd64/conf/GENERIC | 3 + sys/amd64/include/param.h | 2 +- sys/arm/include/param.h | 4 +- .../compat/opensolaris/kern/opensolaris.c | 101 + .../opensolaris/kern/opensolaris_cmn_err.c | 64 + .../opensolaris/kern/opensolaris_kmem.c | 22 +- sys/cddl/compat/opensolaris/sys/atomic.h | 6 +- sys/cddl/compat/opensolaris/sys/bitmap.h | 118 + sys/cddl/compat/opensolaris/sys/cmn_err.h | 40 +- sys/cddl/compat/opensolaris/sys/cpupart.h | 38 + sys/cddl/compat/opensolaris/sys/cpuvar.h | 136 + sys/cddl/compat/opensolaris/sys/cpuvar_defs.h | 61 + sys/cddl/compat/opensolaris/sys/cyclic.h | 79 + sys/cddl/compat/opensolaris/sys/cyclic_impl.h | 304 + sys/cddl/compat/opensolaris/sys/elf.h | 116 + .../compat/opensolaris/sys/feature_tests.h | 35 + sys/cddl/compat/opensolaris/sys/kcondvar.h | 9 +- sys/cddl/compat/opensolaris/sys/kmem.h | 8 +- sys/cddl/compat/opensolaris/sys/lock.h | 3 +- .../{machine/endian.h => sys/mman.h} | 31 +- sys/cddl/compat/opensolaris/sys/modctl.h | 38 + sys/cddl/compat/opensolaris/sys/mutex.h | 9 +- sys/cddl/compat/opensolaris/sys/objfs.h | 35 + sys/cddl/compat/opensolaris/sys/param.h | 37 + sys/cddl/compat/opensolaris/sys/pcpu.h | 37 + sys/cddl/compat/opensolaris/sys/proc.h | 2 - sys/cddl/compat/opensolaris/sys/rwlock.h | 9 +- sys/cddl/compat/opensolaris/sys/sema.h | 40 + sys/cddl/compat/opensolaris/sys/stat.h | 38 + sys/cddl/compat/opensolaris/sys/time.h | 21 +- sys/cddl/compat/opensolaris/sys/types.h | 19 + sys/cddl/compat/opensolaris/sys/uio.h | 2 + .../contrib/opensolaris/OPENSOLARIS.LICENSE | 384 + .../opensolaris/uts/common/ctf/ctf_mod.c | 177 + .../opensolaris/uts/common/ctf/ctf_subr.c | 96 + .../opensolaris/uts/common/dtrace/dtrace.c | 16449 ++++++++++++++++ .../opensolaris/uts/common/dtrace/fasttrap.c | 2376 +++ .../opensolaris/uts/common/dtrace/lockstat.c | 341 + .../opensolaris/uts/common/dtrace/profile.c | 576 + .../opensolaris/uts/common/dtrace/sdt_subr.c | 888 + .../opensolaris/uts/common/dtrace/systrace.c | 373 + .../opensolaris/uts/common/fs/zfs/arc.c | 37 +- .../uts/common/fs/zfs/dmu_zfetch.c | 6 +- .../opensolaris/uts/common/fs/zfs/refcount.c | 2 +- .../opensolaris/uts/common/fs/zfs/spa_misc.c | 2 +- .../uts/common/fs/zfs/sys/refcount.h | 5 +- .../opensolaris/uts/common/fs/zfs/zfs_ioctl.c | 1 + .../contrib/opensolaris/uts/common/rpc/xdr.c | 18 +- .../opensolaris/uts/common/sys/cmn_err.h | 128 + .../opensolaris/uts/common/sys/cpupart.h | 162 + .../opensolaris/uts/common/sys/cpuvar.h | 737 + .../contrib/opensolaris/uts/common/sys/ctf.h | 360 + .../opensolaris/uts/common/sys/ctf_api.h | 245 + .../opensolaris/uts/common/sys/debug.h | 6 +- .../opensolaris/uts/common/sys/dtrace.h | 2309 +++ .../opensolaris/uts/common/sys/dtrace_impl.h | 1323 ++ .../opensolaris/uts/common/sys/fasttrap.h | 93 + .../uts/common/sys/fasttrap_impl.h | 205 + .../opensolaris/uts/common/sys/isa_defs.h | 58 +- .../opensolaris/uts/common/sys/procset.h | 2 + .../contrib/opensolaris/uts/common/sys/sdt.h | 176 - .../contrib/opensolaris/uts/common/sys/vmem.h | 142 - .../opensolaris/uts/intel/sys/fasttrap_isa.h | 114 + .../opensolaris/uts/sparc/sys/fasttrap_isa.h | 94 + sys/cddl/dev/cyclic/amd64/cyclic_machdep.c | 133 + sys/cddl/dev/cyclic/cyclic.c | 1421 ++ sys/cddl/dev/cyclic/cyclic_test.c | 301 + sys/cddl/dev/cyclic/i386/cyclic_machdep.c | 133 + sys/cddl/dev/dtmalloc/dtmalloc.c | 220 + sys/cddl/dev/dtrace/amd64/dis_tables.c | 3193 +++ sys/cddl/dev/dtrace/amd64/dis_tables.h | 112 + sys/cddl/dev/dtrace/amd64/dtrace_asm.S | 573 + sys/cddl/dev/dtrace/amd64/dtrace_isa.c | 612 + sys/cddl/dev/dtrace/amd64/dtrace_subr.c | 507 + sys/cddl/dev/dtrace/amd64/instr_size.c | 132 + sys/cddl/dev/dtrace/dtrace_anon.c | 84 + sys/cddl/dev/dtrace/dtrace_cddl.h | 134 + sys/cddl/dev/dtrace/dtrace_clone.c | 61 + sys/cddl/dev/dtrace/dtrace_debug.c | 596 + sys/cddl/dev/dtrace/dtrace_hacks.c | 13 + sys/cddl/dev/dtrace/dtrace_ioctl.c | 778 + sys/cddl/dev/dtrace/dtrace_load.c | 160 + sys/cddl/dev/dtrace/dtrace_modevent.c | 47 + sys/cddl/dev/dtrace/dtrace_sysctl.c | 82 + sys/cddl/dev/dtrace/dtrace_test.c | 73 + sys/cddl/dev/dtrace/dtrace_unload.c | 127 + sys/cddl/dev/dtrace/dtrace_vtime.c | 101 + sys/cddl/dev/dtrace/i386/dis_tables.c | 3193 +++ sys/cddl/dev/dtrace/i386/dis_tables.h | 112 + sys/cddl/dev/dtrace/i386/dtrace_asm.S | 527 + sys/cddl/dev/dtrace/i386/dtrace_isa.c | 622 + sys/cddl/dev/dtrace/i386/dtrace_subr.c | 503 + sys/cddl/dev/dtrace/i386/instr_size.c | 132 + sys/cddl/dev/fasttrap/fasttrap.c | 2333 +++ sys/cddl/dev/fbt/fbt.c | 1411 ++ sys/cddl/dev/lockstat/lockstat.c | 289 + sys/cddl/dev/profile/profile.c | 531 + sys/cddl/dev/prototype.c | 144 + sys/cddl/dev/sdt/sdt.c | 254 + sys/cddl/dev/systrace/systrace.c | 341 + sys/conf/Makefile.amd64 | 3 +- sys/conf/NOTES | 6 + sys/conf/files | 7 +- sys/conf/kern.post.mk | 3 + sys/conf/kern.pre.mk | 15 + sys/conf/options | 2 + sys/conf/options.amd64 | 1 + sys/i386/conf/GENERIC | 3 + sys/i386/i386/exception.s | 59 + sys/i386/i386/local_apic.c | 17 + sys/i386/i386/trap.c | 69 + sys/i386/include/param.h | 2 +- sys/i386/linux/Makefile | 2 + sys/i386/linux/syscalls.conf | 4 +- sys/ia64/include/param.h | 4 +- sys/kern/kern_ctf.c | 325 + sys/kern/kern_dtrace.c | 108 + sys/kern/kern_exec.c | 31 + sys/kern/kern_exit.c | 29 + sys/kern/kern_fork.c | 23 + sys/kern/kern_linker.c | 59 +- sys/kern/kern_malloc.c | 63 + sys/kern/kern_proc.c | 39 +- sys/kern/kern_sdt.c | 273 + sys/kern/link_elf.c | 49 +- sys/kern/link_elf_obj.c | 55 +- sys/kern/linker_if.m | 20 + sys/kern/makesyscalls.sh | 18 +- sys/kern/sched_4bsd.c | 16 + sys/kern/sched_ule.c | 17 + sys/kern/subr_smp.c | 115 +- sys/kern/systrace_args.c | 4717 +++++ sys/modules/Makefile | 21 + sys/modules/cyclic/Makefile | 19 + sys/modules/cyclic_test/Makefile | 16 + sys/modules/dtrace/Makefile | 21 + sys/modules/dtrace/Makefile.inc | 29 + sys/modules/dtrace/dtmalloc/Makefile | 13 + sys/modules/dtrace/dtrace/Makefile | 44 + sys/modules/dtrace/dtrace_test/Makefile | 14 + sys/modules/dtrace/dtraceall/Makefile | 8 + sys/modules/dtrace/dtraceall/dtraceall.c | 73 + sys/modules/dtrace/fasttrap/Makefile | 19 + sys/modules/dtrace/fbt/Makefile | 13 + sys/modules/dtrace/linsystrace/Makefile | 16 + sys/modules/dtrace/lockstat/Makefile | 14 + sys/modules/dtrace/profile/Makefile | 13 + sys/modules/dtrace/prototype/Makefile | 13 + sys/modules/dtrace/sdt/Makefile | 13 + sys/modules/dtrace/systrace/Makefile | 13 + sys/modules/opensolaris/Makefile | 23 + sys/modules/zfs/Makefile | 61 +- sys/powerpc/include/param.h | 4 +- sys/sparc64/include/param.h | 2 +- sys/sun4v/include/param.h | 2 +- sys/sys/dtrace_bsd.h | 111 + sys/sys/elf.h | 4 - sys/sys/elf_common.h | 3 + sys/sys/kdb.h | 1 + sys/sys/kernel.h | 9 +- sys/sys/linker.h | 56 +- sys/sys/malloc.h | 16 +- sys/sys/param.h | 16 - sys/sys/proc.h | 5 + sys/sys/sdt.h | 179 + sys/sys/smp.h | 6 + sys/sys/stat.h | 8 - sys/sys/sysent.h | 2 +- sys/sys/systm.h | 6 - sys/sys/time.h | 25 - sys/sys/types.h | 30 - tools/test/dtrace/Makefile | 455 + usr.sbin/config/mkmakefile.c | 4 +- 1823 files changed, 214274 insertions(+), 671 deletions(-) create mode 100644 cddl/compat/opensolaris/include/alloca.h create mode 100644 cddl/compat/opensolaris/include/dtrace.h create mode 100644 cddl/compat/opensolaris/include/fcntl.h create mode 100644 cddl/compat/opensolaris/include/libproc.h create mode 100644 cddl/compat/opensolaris/include/stdio.h create mode 100644 cddl/compat/opensolaris/include/stdlib.h create mode 100644 cddl/compat/opensolaris/include/strings.h create mode 100644 cddl/compat/opensolaris/include/unistd.h create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/dtrace.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/README create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof/baddof.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/cmd/badioctl/badioctl.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/cmd/chkargs/chkargs.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/Getopt.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/JDTrace.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/jdtrace.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/manifest/jdtrace.jar-manifest create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl create mode 100755 cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_FUNC.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_MDIM.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_NULL.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_REDEF.redef.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.avgtoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.maxnoarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.mintoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.quantizetoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.sumtoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_AGGARG.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_PROTO.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_IDENT.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_UNDEF.badaggfunc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badexpr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badkey3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.noeffect.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey4.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqbad1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqshort.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASEVAL.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMTYPE.lqbad1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMVAL.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.order.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.order.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHSTEP.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MISMATCH.lqbadarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPLARGE.lqtoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPSMALL.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPTYPE.lqbadinc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPVAL.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_AGGARG.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_PROTO.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_SCALAR.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_ARG.lquantizetoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgnoarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgtoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.counttoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizenoarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizetoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxnoarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxtoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.minnoarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.mintoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizenoarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizetoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumnoarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumtoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_AGGARG.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badmany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badnone.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_SCALAR.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.allquant.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.allquant.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clear.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clear.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count2.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.count3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.forms.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.forms.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.goodkey.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.keysort.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.keysort.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negorder.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negorder.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negquant.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negquant.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.normalize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.normalize.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.order.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.order.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantize.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantround.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantround.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signature.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sum.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sum.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.modby0.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.addmin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.divmin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muladd.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muldiv.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_ARR_BADREF.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRBIG.toobig.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRNULL.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRSUB.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_DECL_PROTO_TYPE.badtuple.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/err.D_IDENT_UNDEF.badureg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic4.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic5.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.basic6.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arrays/tst.uregsarray.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.this.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_ARG.badsig.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_SYNTAX.errassign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.tupoflow.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.cpyarray.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.diffprofile.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.initialize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.invalidref.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.misc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.this.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.valassign.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.begin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.tick.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.begin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.begin.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.multibegin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/begin/tst.multibegin.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_ADDROF_BITFIELD.BitfieldAddress.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.NegBitField.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.ZeroBitField.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.ExceedBaseType.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.GreaterThan64.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFTYPE.badtype.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_OFFSETOF_BITFIELD.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/err.D_SIZEOF_BITFIELD.SizeofBitfield.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/tst.BitFieldPromotion.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/bitfields/tst.SizeofBitField.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.end.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.resize3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/err.zerobuf.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.alignring.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.cputime.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.dynvarsize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.resize3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring2.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.smallring.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.switch1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.switch1.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.cpuusage.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.nice.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.priority.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.prsize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.rssize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg0.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg0clause.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8clause.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.caller.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.caller1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.epid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.epid1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.errno.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.errno1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.execname.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.hpriority.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.id.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.id1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.ipl.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.ipl1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.pid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.pid1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.tid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.tid1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.timestamp.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.vtimestamp.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggfun.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggtup.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.arrtup.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.body.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.both.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.pred.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.nopred.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.pred.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.predfirst.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/clauses/tst.predlast.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_LOCASSC.NonLocalAssoc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_LONGINT.LongStruct.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PARMCLASS.BadStorageClass.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_NAME.VoidName.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_TYPE.Dyn.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VARARGS.VarLenArgs.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VOID.NonSoleVoid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_SIGNINT.UnsignedStruct.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/err.D_DECL_VOIDATTR.ShortVoidDecl.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.arrays.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.basics.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.funcs.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.pointers.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/decls/tst.varargsfuncs.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/badptr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/countdown.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/counter.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/errorpath.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/hello.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/kstat.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/ksyms.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/renormalize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rtime.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rw.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rwinfo.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/rwtime.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/specopen.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/truss.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/trussrw.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/docsExamples/userfunc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_AGGREGATION.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DBLERROR.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DYNAMIC.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.end.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPEC.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPECUNAVAIL.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/err.D_PDESC_ZERO.InvalidDescription1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.APIVersion.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.AddSearchPath.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ELFGeneration.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.IncludedFilePath.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithFunctions create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithIDs create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithModules create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithNames create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithProviders create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.ShowCompilerCode.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceFunctions create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceIDs create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceModule create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceNames create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceProvider create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.VerboseStabilityReport.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeGiga.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeKilo.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeMega.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeTera.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel32.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel64.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithoutW.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus1.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus2.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExtraneousProbeIds.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName1.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName2.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId1.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId2.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId3.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule1.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule2.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule3.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule4.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProbeIdentifier.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider1.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider2.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider3.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider4.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc1.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc2.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc3.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc4.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc5.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc6.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc8.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc9.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID1.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID2.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID3.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID4.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID5.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID6.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID7.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule1.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule2.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule3.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule4.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule5.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule6.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule7.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule8.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName1.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName2.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName3.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName4.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName5.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName6.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName7.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName8.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName9.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider1.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider2.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider3.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider4.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider5.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.MultipleInvalidProbeId.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.UnDefineNameWithCPP.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbeIdentfier.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbesWithoutZ.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/err.D_IDENT_UNDEF.timespent.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.end.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.endwithoutbegin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.multibeginend.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/end/tst.multiend.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_BADADDR.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_DIVZERO.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_UNKNOWN.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.error.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/error/tst.errorend.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/err.D_PROTO_LEN.noarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/err.exitarg1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/exit/tst.basic1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/err.D_PDESC_ZERO.notreturn.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.basic.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_FUNC_UNDEF.progenyofbad1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_OP_VFPTR.badop.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.chillbadarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.copyoutbadarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.mobadarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.raisebadarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.allocanoarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.badbreakpoint.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrbadarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrtoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.panicbadarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.progenyofbad2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.stopbadarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_STRINGOF_TYPE.badstringof.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_VAR_UNDEF.badvar.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badalloca.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badalloca2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy4.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy5.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badbcopy6.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.badchill.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.chillbadarg.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyout.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyoutbadaddr.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.copyoutstrbadaddr.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntoa6badaddr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntoabadaddr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadaddr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.bcopy.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.chill.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.copyin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.copyinto.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ddi_pathname.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.default.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.freopen.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.hton.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owned.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.progenyof.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.rand.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strchr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strchr.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strstr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strstr.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strtok_null.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/err.D_ADDROF_LVAL.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/err.D_EMPTY.empty.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/tst.clauses.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/grammar/tst.stmts.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_IDENT_UNDEF.recur.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineDataAssign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineExpression.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineTypedef.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/inline/tst.InlineWritableAssign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/manifest/test.jar-manifest create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestAbort.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestBean.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestClose.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestDrop.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestEnable.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestMaxConsumers.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestMultiAggPrinta.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestProbeData.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestProbeDescription.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestStateMachine.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestStopLock.java create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.printa.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.printa.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NL.char.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NULL.char.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_INT_DIGIT.InvalidDigit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_INT_OFLOW.BigInt.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_STR_NL.string.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/lexer/tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.tcp.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/mib/tst.udp.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/err.D_PRAGMA_OPTSET.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.badopt.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.boolopt.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.boolopt.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dynopt.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dynopt.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.enablerace.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.haslam.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.roch.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGKEY.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGPROTO.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.many.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.many.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.same.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.same.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.badtype.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.notsou.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.OffsetofNULL.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.badmemb.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofAlias.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofArith.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofUnion.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.struct.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.struct.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.union.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/tst.union.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/operators/tst.ternary.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/operators/tst.ternary.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badproc1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_BADPID.badproc2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.addprobes.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.main.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.manypids.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.probemod.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.ArrayVar.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.DynamicVar.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.agg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_NONPTR.noptr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_VOID.VoidPointerDeref.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_ARRFUN.ArrayAssignment.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_INCOMPAT.VoidPointerArith.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_LVAL.AddressChange.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.NonPointerAccess.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.badpointer.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.BadPointerAccess.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.badpointer.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.GlobalVar.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.IntegerArithmetic1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.PointerAssignment.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.VoidCast.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.basic1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.basic2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGERR.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_DEPEND.main.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_INVAL.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_MALFORM.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_UNUSED.UnusedPragma.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.circlibdep.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.invalidlibdep.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdep.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libdepfullyconnected.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.basics.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.complex.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_IDENT_UNDEF.afterprobe.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.D_SYNTAX.withoutpound.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.defincomp.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefelsenotendif.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefincomp.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.ifdefnotendif.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.incompelse.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/err.mulelse.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.predicatedeclare.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/preprocessor/tst.withinprobe.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badagg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badfmt.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badval.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_PROTO.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.stack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.def.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.def.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.fmt.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.fmt.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.many.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.manyval.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.manyval.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.stack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.tuple.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.tuple.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_AGG_CONV.aggfmt.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.toomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.widths.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_FMT.badfmt.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_PROTO.novalue.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.aggarg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.recursive.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.noprec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.nowidth.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badprec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badwidth.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_PROTO_LEN.toofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.flags.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.flags.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.hello.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.hello.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.precs.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.precs.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.print-f.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.print-f.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printcont.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printcont.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printeE.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printeE.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printgG.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printgG.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.uints.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.uints.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.widths1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.wp.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.wp.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.op_access.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.unpriv_funcs.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probeqtn.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probestar.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.tickstar.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.assign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declare.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declarein.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.lbraces.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.probespec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.rbraces.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.recdec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.basic1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.check.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.declare.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.declareafter.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.emptyprobe.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragma.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmaaftertab.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmainside.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.pragmaoutside.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.create.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exec.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitexit.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZERO.profile.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonens.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonensec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneus.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneusec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.basic.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.basic.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_INVAL.wrongdec4.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.nonprofile.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.basics.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.basics.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginexit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginprof.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.beginprof.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probattrs.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probattrs.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probefunc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probefunc.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probemod.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probemod.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probename.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probename.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probprov.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.probprov.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profend.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profend.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profexit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.profexit.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.trace.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.trace.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.twoprof.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/providers/tst.twoprof.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.aggrate.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.aggrate.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.statusrate.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.switchrate.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/rates/tst.switchrate.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.basename.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.caller.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.cleanpath.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ddi_pathname.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.dirname.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.errno.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.execname.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.gid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.hton.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.index.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.msgdsize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.msgsize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.null.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.pid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ppid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.progenyof.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.random.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.rw.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.shortstr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stackdepth.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.stddev.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strchr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strjoin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strstr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.strtok.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.substr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ucaller.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.uid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.unalign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.uregs.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ustack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.ustackdepth.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.vahole.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.zonename.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_ARR_LOCAL.thisarray.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.selfthis.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.thisself.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_DECL_IDRED.errval.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dec.err.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/err.D_SYNTAX.declare.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.localvar.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.misc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.self.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfthis.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.this.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.thisself.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.enqueue.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.oncpu.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sched/tst.stackdepth.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_MACRO_UNDEF.invalidargs.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_OP_LVAL.rdonly.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_OP_WRITE.usepidmacro.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.concat.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.desc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.inval.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.pid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arg0.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.assign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.basic.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.pgid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.pid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.quite.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.trace.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_BADREF.SizeofAssoc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SYNTAX.SizeofBadType.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofArray.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofDataTypes.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofExpression.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofNULL.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/bug.1001148.SpecSizeVariations.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_COMM.AggAftCommit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithAvg.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithCount.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithLquant.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMax.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithSum.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.CommitAftCommit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.DisjointCommit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_COMM_DREC.CommitAftDataRec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.DataRecAftCommit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.ExitAfterCommit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_EXIT_SPEC.ExitAftSpec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_MALFORM.NspecExpr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.HugeNspecValue.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.InvalidSpecSize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_PROTO_LEN.SpecNoId.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_COMM.SpecAftCommit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_DREC.SpecAftDataRec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_SPEC.SpecAftSpec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeBufSize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeNspec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.NegativeSpecSize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.CommitAfterDiscard.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.CommitWithZero.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DataRecAftDiscard.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftCommit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDataRec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDiscard.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.DiscardWithZero.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.ExitAftDiscard.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculateWithRandom.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationCommit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationDiscard.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationID.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpeculationWithZero.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.TwoSpecBuffers.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.negcommit.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.negspec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.zerosize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stability/err.D_ATTR_MIN.MinAttributes.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_STACK_PROTO.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_STACK_SIZE.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_FRAMES.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_PROTO.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/err.D_USTACK_STRSIZE.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stack/tst.default.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stackdepth/tst.default.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/strlen/tst.strlen1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_ADDROF_VAR.StructPointer.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.circular.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.recursive.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.simple.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_DECL_VOIDOBJ.baddec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/err.D_PROTO_ARG.DupStructAssoc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructAssoc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructDataTypes.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.StructInside.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.openret.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZERO.tick.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonens.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonensec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneus.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneusec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickarg0.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.misc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.qstring.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.qstring.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.string.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_ARG.badsize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toofew.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toomany.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.negsize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.zerosize.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.rootvp.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_DECL_TYPERED.BadTransDecl.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_OP_INCOMPLETE.NonExistentInput1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl4.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_TYPE_MEMBER.NonExistentInput2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_INCOMPAT.BadInputType1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_MEMB.NonExistentOutput2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_NONE.BadTransDecl6.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_REDECL.RepeatTransDecl.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransDecl8.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransInt.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.NonExistentOutput1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.CircularTransDecl.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.EmptyTransDecl.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.ForwardTag.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.InputAliasTrans.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.InputIntTrans.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.OutputAliasTrans.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.PartialDereferencing.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.PartialOutputTransDefn.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.ProcModelTrans.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.RepeatDeclaration.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.SimultaneousTranslators.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.StructureAssignment.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransNonPointer.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransOutputPointer.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TransPointer.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TranslateSelf.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.UnionInputTrans.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.UnionOutputTrans.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_DECL_IDRED.DupTypeDef.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.BadExistingTypedef.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.TypedefInClause.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/tst.ChainTypedef.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/typedef/tst.TypedefDataAssign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CAST_INVAL.badcast.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CG_DYN.ResultDynType.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_CHR_OFLOW.charconst.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_BADCLASS.bad.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_CHARATTR.badtype3.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype4.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype5.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENCONST.badeval.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enoflow.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enuflow.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_SCOPE.scopeop.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_DECL_USELESS.baddec.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_ACT.badcond.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_ARITH.badoperand.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INCOMPAT.badassign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badbitop.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badshift.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badcond.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badincop.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badlogop.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_PROTO_LEN.badcond1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badenum.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badstruct.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype2.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupenum.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupstruct.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.assignops.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.badshiftops.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.basics.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.basics.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.bitops.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.charconstants.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.complex.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.condexpr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.constants.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.conv.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.enum.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.intincop.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.intops.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.inttypes.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.ptrincop.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.ptrops.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.relenum.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.relstring.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.shiftops.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.stringconstants.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.struct.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.typedef.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.unaryop.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_ADDROF_VAR.UnionPointer.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon1.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.circular.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.order.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.recursive.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.simple.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/err.D_PROTO_ARG.DupUnionAssoc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionAssoc.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionDataTypes.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/union/tst.UnionInside.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/argmap.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/args.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/forker.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.andpid.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.depth.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.gid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.nullassign.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ppid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.uid.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.walltimestamp.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/version/tst.1.0.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/arrays/tst.uregsarray.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyinstr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyout.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.s create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.s create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.s create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.s create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/annotated_helper.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/helper_helper.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.helper.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/Makefile create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.basic.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.hvmenable.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.memenable.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedenable.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/arrays/tst.uregsarray.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.exe create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.s create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.s create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.s create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/annotated_helper.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/helper_helper.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.s create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.c create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d.out create mode 100644 cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.trapstat.ksh create mode 100644 cddl/contrib/opensolaris/cmd/mdb/tools/common/die.c create mode 100644 cddl/contrib/opensolaris/cmd/mdb/tools/common/util.h create mode 100644 cddl/contrib/opensolaris/cmd/sgs/include/_string_table.h create mode 100644 cddl/contrib/opensolaris/cmd/sgs/include/alist.h create mode 100644 cddl/contrib/opensolaris/cmd/sgs/include/debug.h create mode 100644 cddl/contrib/opensolaris/cmd/sgs/include/sgs.h create mode 100644 cddl/contrib/opensolaris/cmd/sgs/include/string_table.h create mode 100644 cddl/contrib/opensolaris/cmd/sgs/messages/sgs.ident create mode 100644 cddl/contrib/opensolaris/cmd/sgs/tools/common/findprime.c create mode 100644 cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c create mode 100644 cddl/contrib/opensolaris/cmd/sgs/tools/common/string_table.c create mode 100644 cddl/contrib/opensolaris/common/avl/avl.c create mode 100644 cddl/contrib/opensolaris/common/ctf/ctf_create.c create mode 100644 cddl/contrib/opensolaris/common/ctf/ctf_decl.c create mode 100644 cddl/contrib/opensolaris/common/ctf/ctf_error.c create mode 100644 cddl/contrib/opensolaris/common/ctf/ctf_hash.c create mode 100644 cddl/contrib/opensolaris/common/ctf/ctf_impl.h create mode 100644 cddl/contrib/opensolaris/common/ctf/ctf_labels.c create mode 100644 cddl/contrib/opensolaris/common/ctf/ctf_lookup.c create mode 100644 cddl/contrib/opensolaris/common/ctf/ctf_open.c create mode 100644 cddl/contrib/opensolaris/common/ctf/ctf_types.c create mode 100644 cddl/contrib/opensolaris/common/ctf/ctf_util.c create mode 100644 cddl/contrib/opensolaris/head/nlist.h create mode 100644 cddl/contrib/opensolaris/head/note.h create mode 100644 cddl/contrib/opensolaris/head/storclass.h create mode 100644 cddl/contrib/opensolaris/head/syms.h create mode 100644 cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c create mode 100644 cddl/contrib/opensolaris/lib/libctf/common/ctf_subr.c create mode 100644 cddl/contrib/opensolaris/lib/libctf/common/libctf.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/drti.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_as.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_as.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_buf.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_buf.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_inttab.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_inttab.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_list.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_list.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_map.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_pcb.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_pcb.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_work.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.c create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh create mode 100644 cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh create mode 100644 cddl/contrib/opensolaris/lib/libgen/common/gmatch.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/common/ctf_headers.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/common/list.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/common/list.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/common/memory.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/common/memory.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/common/symbol.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/common/symbol.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/common/utils.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/common/utils.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/alist.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/alist.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/compare.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/ctfconvert.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/fifo.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/fifo.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/fixup_tdescs.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/hash.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/hash.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/iidesc.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/input.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/merge.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/output.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/stabs.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/stack.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/stack.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/strtab.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/strtab.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/traverse.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/traverse.h create mode 100644 cddl/contrib/opensolaris/tools/ctf/cvt/util.c create mode 100644 cddl/contrib/opensolaris/tools/ctf/dump/dump.c create mode 100644 cddl/lib/drti/Makefile create mode 100644 cddl/lib/libctf/Makefile create mode 100644 cddl/lib/libdtrace/Makefile create mode 100644 cddl/lib/libdtrace/errno.d create mode 100644 cddl/lib/libdtrace/net.d create mode 100644 cddl/lib/libdtrace/nfs.d create mode 100644 cddl/lib/libdtrace/psinfo.d create mode 100644 cddl/lib/libdtrace/sched.d create mode 100644 cddl/lib/libdtrace/signal.d create mode 100644 cddl/lib/libdtrace/unistd.d create mode 100644 cddl/usr.bin/ctfconvert/Makefile create mode 100644 cddl/usr.bin/ctfdump/Makefile create mode 100644 cddl/usr.bin/ctfmerge/Makefile create mode 100644 cddl/usr.bin/sgsmsg/Makefile create mode 100644 cddl/usr.sbin/dtrace/Makefile create mode 100644 lib/libdwarf/Makefile create mode 100644 lib/libdwarf/_libdwarf.h create mode 100644 lib/libdwarf/dwarf.h create mode 100644 lib/libdwarf/dwarf_abbrev.c create mode 100644 lib/libdwarf/dwarf_attr.c create mode 100644 lib/libdwarf/dwarf_attrval.c create mode 100644 lib/libdwarf/dwarf_cu.c create mode 100644 lib/libdwarf/dwarf_dealloc.c create mode 100644 lib/libdwarf/dwarf_die.c create mode 100644 lib/libdwarf/dwarf_dump.c create mode 100644 lib/libdwarf/dwarf_errmsg.c create mode 100644 lib/libdwarf/dwarf_errno.c create mode 100644 lib/libdwarf/dwarf_finish.c create mode 100644 lib/libdwarf/dwarf_form.c create mode 100644 lib/libdwarf/dwarf_init.c create mode 100644 lib/libdwarf/dwarf_loc.c create mode 100644 lib/libdwarf/libdwarf.h create mode 100644 lib/libproc/Makefile create mode 100644 lib/libproc/_libproc.h create mode 100644 lib/libproc/libproc.h create mode 100644 lib/libproc/proc_create.c create mode 100644 lib/libproc/proc_sym.c create mode 100644 lib/libproc/proc_util.c create mode 100644 sys/cddl/compat/opensolaris/kern/opensolaris.c create mode 100644 sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c create mode 100644 sys/cddl/compat/opensolaris/sys/bitmap.h create mode 100644 sys/cddl/compat/opensolaris/sys/cpupart.h create mode 100644 sys/cddl/compat/opensolaris/sys/cpuvar.h create mode 100644 sys/cddl/compat/opensolaris/sys/cpuvar_defs.h create mode 100644 sys/cddl/compat/opensolaris/sys/cyclic.h create mode 100644 sys/cddl/compat/opensolaris/sys/cyclic_impl.h create mode 100644 sys/cddl/compat/opensolaris/sys/elf.h create mode 100644 sys/cddl/compat/opensolaris/sys/feature_tests.h rename sys/cddl/compat/opensolaris/{machine/endian.h => sys/mman.h} (66%) create mode 100644 sys/cddl/compat/opensolaris/sys/modctl.h create mode 100644 sys/cddl/compat/opensolaris/sys/objfs.h create mode 100644 sys/cddl/compat/opensolaris/sys/param.h create mode 100644 sys/cddl/compat/opensolaris/sys/pcpu.h create mode 100644 sys/cddl/compat/opensolaris/sys/sema.h create mode 100644 sys/cddl/compat/opensolaris/sys/stat.h create mode 100644 sys/cddl/contrib/opensolaris/OPENSOLARIS.LICENSE create mode 100644 sys/cddl/contrib/opensolaris/uts/common/ctf/ctf_mod.c create mode 100644 sys/cddl/contrib/opensolaris/uts/common/ctf/ctf_subr.c create mode 100644 sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c create mode 100644 sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c create mode 100644 sys/cddl/contrib/opensolaris/uts/common/dtrace/lockstat.c create mode 100644 sys/cddl/contrib/opensolaris/uts/common/dtrace/profile.c create mode 100644 sys/cddl/contrib/opensolaris/uts/common/dtrace/sdt_subr.c create mode 100644 sys/cddl/contrib/opensolaris/uts/common/dtrace/systrace.c create mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/cmn_err.h create mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/cpupart.h create mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h create mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/ctf.h create mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h create mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h create mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h create mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h create mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h delete mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/sdt.h delete mode 100644 sys/cddl/contrib/opensolaris/uts/common/sys/vmem.h create mode 100644 sys/cddl/contrib/opensolaris/uts/intel/sys/fasttrap_isa.h create mode 100644 sys/cddl/contrib/opensolaris/uts/sparc/sys/fasttrap_isa.h create mode 100644 sys/cddl/dev/cyclic/amd64/cyclic_machdep.c create mode 100644 sys/cddl/dev/cyclic/cyclic.c create mode 100644 sys/cddl/dev/cyclic/cyclic_test.c create mode 100644 sys/cddl/dev/cyclic/i386/cyclic_machdep.c create mode 100644 sys/cddl/dev/dtmalloc/dtmalloc.c create mode 100644 sys/cddl/dev/dtrace/amd64/dis_tables.c create mode 100644 sys/cddl/dev/dtrace/amd64/dis_tables.h create mode 100644 sys/cddl/dev/dtrace/amd64/dtrace_asm.S create mode 100644 sys/cddl/dev/dtrace/amd64/dtrace_isa.c create mode 100644 sys/cddl/dev/dtrace/amd64/dtrace_subr.c create mode 100644 sys/cddl/dev/dtrace/amd64/instr_size.c create mode 100644 sys/cddl/dev/dtrace/dtrace_anon.c create mode 100644 sys/cddl/dev/dtrace/dtrace_cddl.h create mode 100644 sys/cddl/dev/dtrace/dtrace_clone.c create mode 100644 sys/cddl/dev/dtrace/dtrace_debug.c create mode 100644 sys/cddl/dev/dtrace/dtrace_hacks.c create mode 100644 sys/cddl/dev/dtrace/dtrace_ioctl.c create mode 100644 sys/cddl/dev/dtrace/dtrace_load.c create mode 100644 sys/cddl/dev/dtrace/dtrace_modevent.c create mode 100644 sys/cddl/dev/dtrace/dtrace_sysctl.c create mode 100644 sys/cddl/dev/dtrace/dtrace_test.c create mode 100644 sys/cddl/dev/dtrace/dtrace_unload.c create mode 100644 sys/cddl/dev/dtrace/dtrace_vtime.c create mode 100644 sys/cddl/dev/dtrace/i386/dis_tables.c create mode 100644 sys/cddl/dev/dtrace/i386/dis_tables.h create mode 100644 sys/cddl/dev/dtrace/i386/dtrace_asm.S create mode 100644 sys/cddl/dev/dtrace/i386/dtrace_isa.c create mode 100644 sys/cddl/dev/dtrace/i386/dtrace_subr.c create mode 100644 sys/cddl/dev/dtrace/i386/instr_size.c create mode 100644 sys/cddl/dev/fasttrap/fasttrap.c create mode 100644 sys/cddl/dev/fbt/fbt.c create mode 100644 sys/cddl/dev/lockstat/lockstat.c create mode 100644 sys/cddl/dev/profile/profile.c create mode 100644 sys/cddl/dev/prototype.c create mode 100644 sys/cddl/dev/sdt/sdt.c create mode 100644 sys/cddl/dev/systrace/systrace.c create mode 100644 sys/kern/kern_ctf.c create mode 100644 sys/kern/kern_dtrace.c create mode 100644 sys/kern/kern_sdt.c create mode 100644 sys/modules/cyclic/Makefile create mode 100644 sys/modules/cyclic_test/Makefile create mode 100644 sys/modules/dtrace/Makefile create mode 100644 sys/modules/dtrace/Makefile.inc create mode 100644 sys/modules/dtrace/dtmalloc/Makefile create mode 100644 sys/modules/dtrace/dtrace/Makefile create mode 100644 sys/modules/dtrace/dtrace_test/Makefile create mode 100644 sys/modules/dtrace/dtraceall/Makefile create mode 100644 sys/modules/dtrace/dtraceall/dtraceall.c create mode 100644 sys/modules/dtrace/fasttrap/Makefile create mode 100644 sys/modules/dtrace/fbt/Makefile create mode 100644 sys/modules/dtrace/linsystrace/Makefile create mode 100644 sys/modules/dtrace/lockstat/Makefile create mode 100644 sys/modules/dtrace/profile/Makefile create mode 100644 sys/modules/dtrace/prototype/Makefile create mode 100644 sys/modules/dtrace/sdt/Makefile create mode 100644 sys/modules/dtrace/systrace/Makefile create mode 100644 sys/modules/opensolaris/Makefile create mode 100644 sys/sys/dtrace_bsd.h create mode 100644 sys/sys/sdt.h create mode 100644 tools/test/dtrace/Makefile diff --git a/Makefile b/Makefile index 81463cdeb066..c0913c3f4f8b 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,9 @@ BINMAKE= \ `if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \ -m ${.CURDIR}/share/mk _MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 +.if !defined(WITHOUT_CTF) +_MAKE+= -DWITH_CTF +.endif # # Make sure we have an up-to-date make(1). Only world and buildworld diff --git a/Makefile.inc1 b/Makefile.inc1 index 213046d8276f..2fb8d9fd0a55 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -10,6 +10,7 @@ # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_DOCUPDATE do not update doc in ${MAKE} update +# -DNO_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list # TARGET="machine" to crossbuild world for a different machine type @@ -42,6 +43,8 @@ SUBDIR+=games .endif .if ${MK_CDDL} != "no" SUBDIR+=cddl +.else +NO_CTF=1 .endif SUBDIR+=gnu include .if ${MK_KERBEROS} != "no" @@ -102,6 +105,11 @@ OSRELDATE= 0 .endif .endif +.if !defined(VERSION) +VERSION!= uname -srp +VERSION+= ${OSRELDATE} +.endif + # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/} @@ -201,6 +209,7 @@ CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${BPATH}:${PATH} \ WORLDTMP=${WORLDTMP} \ + VERSION="${VERSION}" \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ @@ -208,14 +217,15 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ BOOTSTRAPPING=${OSRELDATE} \ -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ -DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WARNS + -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ DESTDIR= \ - BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS + BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS \ + -DNO_WARNS -DNO_CTF # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -225,8 +235,12 @@ XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ # world stage WMAKEENV= ${CROSSENV} \ _SHLIBDIRPREFIX=${WORLDTMP} \ + VERSION="${VERSION}" \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${TMPPATH} +.if ${MK_CDDL} == "no" || defined(NO_CTF) +WMAKEENV+= NO_CTF=1 +.endif WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} .if ${TARGET_ARCH} == "amd64" @@ -246,6 +260,7 @@ LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -DCOMPAT_32BIT \ # Yes, the flags are redundant. LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ _SHLIBDIRPREFIX=${LIB32TMP} \ + VERSION="${VERSION}" \ MACHINE=i386 \ MACHINE_ARCH=i386 \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ @@ -260,7 +275,7 @@ LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_INFO \ - -DWITHOUT_HTML DESTDIR=${LIB32TMP} + -DWITHOUT_HTML -DNO_CTF DESTDIR=${LIB32TMP} LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS .endif @@ -459,10 +474,15 @@ build32: distribute32 install32: .if make(distribute32) mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree + mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32/dtrace # XXX add to mtree .else mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree + mkdir -p ${DESTDIR}/usr/lib32/dtrace # XXX add to mtree .endif cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} +.if ${MK_CDDL} != "no" + cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} +.endif cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} .if ${MK_CRYPT} != "no" cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} @@ -708,13 +728,14 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} -DNO_CPU_CFLAGS -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile + ${MAKE} -DNO_CPU_CFLAGS -DNO_CTF \ + -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) .for target in obj depend all cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ - ${MAKE} -DNO_CPU_CFLAGS ${target} + ${MAKE} -DNO_CPU_CFLAGS -DNO_CTF ${target} .endfor .endif .if !defined(NO_KERNELDEPEND) @@ -728,7 +749,11 @@ buildkernel: @echo "--------------------------------------------------------------" @echo ">>> stage 3.2: building everything" @echo "--------------------------------------------------------------" +.if defined(NO_CTF) cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ +.else + cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ -DWITH_CTF +.endif @echo "--------------------------------------------------------------" @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" @echo "--------------------------------------------------------------" @@ -876,8 +901,14 @@ _crunchgen= usr.sbin/crunch/crunchgen _pwd_mkdb= usr.sbin/pwd_mkdb .endif +.if ${MK_CDDL} != "no" +_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ + lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge +.endif + bootstrap-tools: .for _tool in \ + ${_dtrace_tools} \ ${_strfile} \ ${_gperf} \ ${_groff} \ diff --git a/cddl/Makefile.inc b/cddl/Makefile.inc index bf5804e1978c..74527eb8d6c1 100644 --- a/cddl/Makefile.inc +++ b/cddl/Makefile.inc @@ -1,3 +1,13 @@ # $FreeBSD$ -CFLAGS+= -D_SOLARIS_C_SOURCE +OPENSOLARIS_USR_DISTDIR= ${.CURDIR}/../../../cddl/contrib/opensolaris +OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../../../sys/cddl/contrib/opensolaris + +IGNORE_PRAGMA= YES + +CFLAGS+= -DNEED_SOLARIS_BOOLEAN +OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../../../sys/cddl/contrib/opensolaris + +IGNORE_PRAGMA= YES + +CFLAGS+= -DNEED_SOLARIS_BOOLEAN diff --git a/cddl/compat/opensolaris/include/alloca.h b/cddl/compat/opensolaris/include/alloca.h new file mode 100644 index 000000000000..844cddc3c36b --- /dev/null +++ b/cddl/compat/opensolaris/include/alloca.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_ALLOCA_H_ +#define _COMPAT_OPENSOLARIS_ALLOCA_H_ + +#include + +#endif +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_ALLOCA_H_ +#define _COMPAT_OPENSOLARIS_ALLOCA_H_ + +#include + +#endif diff --git a/cddl/compat/opensolaris/include/dtrace.h b/cddl/compat/opensolaris/include/dtrace.h new file mode 100644 index 000000000000..4e86c6b4b359 --- /dev/null +++ b/cddl/compat/opensolaris/include/dtrace.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2008 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_DTRACE_H_ +#define _COMPAT_OPENSOLARIS_DTRACE_H_ + +#define ps_prochandle proc_handle + +#include_next + +#endif +/* + * Copyright (C) 2008 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_DTRACE_H_ +#define _COMPAT_OPENSOLARIS_DTRACE_H_ + +#define ps_prochandle proc_handle + +#include_next + +#endif diff --git a/cddl/compat/opensolaris/include/fcntl.h b/cddl/compat/opensolaris/include/fcntl.h new file mode 100644 index 000000000000..801b4803bea7 --- /dev/null +++ b/cddl/compat/opensolaris/include/fcntl.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_FCNTL_H_ +#define _COMPAT_OPENSOLARIS_FCNTL_H_ + +#include_next + +#define open64 open + +#endif +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_FCNTL_H_ +#define _COMPAT_OPENSOLARIS_FCNTL_H_ + +#include_next + +#define open64 open + +#endif diff --git a/cddl/compat/opensolaris/include/libproc.h b/cddl/compat/opensolaris/include/libproc.h new file mode 100644 index 000000000000..1e6e91fb5d74 --- /dev/null +++ b/cddl/compat/opensolaris/include/libproc.h @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2008 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_LIBPROC_H_ +#define _COMPAT_OPENSOLARIS_LIBPROC_H_ + +#include + +#define ps_prochandle proc_handle +#define Lmid_t int + +#define PR_RLC 0x0001 +#define PR_KLC 0x0002 + +#define PGRAB_RDONLY O_RDONLY +#define PGRAB_FORCE 0 + +#include_next + +#endif +/* + * Copyright (C) 2008 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_LIBPROC_H_ +#define _COMPAT_OPENSOLARIS_LIBPROC_H_ + +#include + +#define ps_prochandle proc_handle +#define Lmid_t int + +#define PR_RLC 0x0001 +#define PR_KLC 0x0002 + +#define PGRAB_RDONLY O_RDONLY +#define PGRAB_FORCE 0 + +#include_next + +#endif diff --git a/cddl/compat/opensolaris/include/stdio.h b/cddl/compat/opensolaris/include/stdio.h new file mode 100644 index 000000000000..b29b003a3a86 --- /dev/null +++ b/cddl/compat/opensolaris/include/stdio.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_STDIO_H_ +#define _COMPAT_OPENSOLARIS_STDIO_H_ + +#include_next + +#define ftello64 ftello +#define lseek64 lseek +#define fseeko64 fseeko + +#endif +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_STDIO_H_ +#define _COMPAT_OPENSOLARIS_STDIO_H_ + +#include_next + +#define ftello64 ftello +#define lseek64 lseek +#define fseeko64 fseeko + +#endif diff --git a/cddl/compat/opensolaris/include/stdlib.h b/cddl/compat/opensolaris/include/stdlib.h new file mode 100644 index 000000000000..1bae31c26c66 --- /dev/null +++ b/cddl/compat/opensolaris/include/stdlib.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_STDLIB_H_ +#define _COMPAT_OPENSOLARIS_STDLIB_H_ + +#include_next + +#define getexecname getprogname + +#endif +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_STDLIB_H_ +#define _COMPAT_OPENSOLARIS_STDLIB_H_ + +#include_next + +#define getexecname getprogname + +#endif diff --git a/cddl/compat/opensolaris/include/strings.h b/cddl/compat/opensolaris/include/strings.h new file mode 100644 index 000000000000..cc9adc4f668e --- /dev/null +++ b/cddl/compat/opensolaris/include/strings.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_STRINGS_H_ +#define _COMPAT_OPENSOLARIS_STRINGS_H_ + +#include_next + +#include + +#endif +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_STRINGS_H_ +#define _COMPAT_OPENSOLARIS_STRINGS_H_ + +#include_next + +#include + +#endif diff --git a/cddl/compat/opensolaris/include/unistd.h b/cddl/compat/opensolaris/include/unistd.h new file mode 100644 index 000000000000..2bde5d72a056 --- /dev/null +++ b/cddl/compat/opensolaris/include/unistd.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_UNISTD_H_ +#define _COMPAT_OPENSOLARIS_UNISTD_H_ + +#include_next + +#define fork1 fork +#define ftruncate64 ftruncate +#define pread64 pread + +#endif +/* + * Copyright (C) 2007 John Birrell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_UNISTD_H_ +#define _COMPAT_OPENSOLARIS_UNISTD_H_ + +#include_next + +#define fork1 fork +#define ftruncate64 ftruncate +#define pread64 pread + +#endif 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..2580e6323a83 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c @@ -0,0 +1,1898 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * 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 +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(sun) +#include +#endif +#include +#if defined(sun) +#include +#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); + + 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 : ""); + } + 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 { + (void) snprintf(dcp->dc_ofile, sizeof (dcp->dc_ofile), + g_cmdc > 1 ? "%s.%d" : "%s", "d.out", (int)(dcp - g_cmdv)); + } + + 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) +{ +fatal("DOODAD in function %s, file %s, line %d\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD + const psinfo_t *prp = Ppsinfo(P); + int pid = Pstatus(P)->pr_pid; + char name[SIG2STR_MAX]; + + if (msg != NULL) { + notice("pid %d: %s\n", pid, msg); + return; + } + + switch (Pstate(P)) { + case PS_UNDEAD: + /* + * 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 (prp != NULL && WEXITSTATUS(prp->pr_wstat) != 0) { + notice("pid %d exited with status %d\n", + pid, WEXITSTATUS(prp->pr_wstat)); + } 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; + } +#endif +} + +/*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("\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 ? "" : ""); + +/*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 + + /* + * 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..679ec53d86f1 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof/baddof.c @@ -0,0 +1,209 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL 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 +#include +#include +#include +#include +#include +#include +#include + +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 < 1) + 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 +#include +#include +#include +#include +#include +#include +#include +#include + +#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..36042e3f7274 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/chkargs/chkargs.c @@ -0,0 +1,148 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * 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 +#include +#include + +static int g_count; +static int g_errs; +static int g_fd; +static int g_verbose; +static int g_errexit; + +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; + + if ((dtp = dtrace_open(DTRACE_VERSION, 0, &err)) == NULL) { + (void) fprintf(stderr, "%s: failed to open dtrace: %s\n", + argv[0], 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", argv[0], optarg, + dtrace_errmsg(dtp, dtrace_errno(dtp))); + return (2); + } + break; + + default: + (void) fprintf(stderr, "Usage: %s [-ev] " + "[-x opt[=arg]] [probedesc]\n", argv[0]); + return (2); + } + } + + argv += optind; + argc -= optind; + + if (argc > 0) { + if (dtrace_str2desc(dtp, DTRACE_PROBESPEC_NAME, argv[1], &pd)) { + (void) fprintf(stderr, "%s: invalid probe description " + "%s: %s\n", argv[0], argv[1], + 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 getopt(3C) 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: + *
    + *
  • NULL: No argument was found
  • + *
  • empty string (""): Argument was explicitly left empty + * by the user (e.g., --option= )
  • + *
  • valid string: Argument found on the command line
  • + *
+ * @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. + *

+ * 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 records = data.getRecords(); + Iterator 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 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 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 compileRequests = new LinkedList + (); + List programList = new LinkedList (); + 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 openFlags = + new ArrayList (); + + 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 argList = new LinkedList (); + 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 > lists = + new LinkedList > (); + for (Program p : programList) { + lists.add(dtrace.listProgramProbeDetail(p)); + } + ProbeDescription p; + ProbeInfo pinfo; + for (List list : lists) { + for (Probe probe : list) { + p = probe.getDescription(); + pinfo = probe.getInfo(); + printProbeDescription(p); + printProbeInfo(pinfo); + } + } + } else { + List > lists = + new LinkedList > (); + for (Program p : programList) { + lists.add(dtrace.listProgramProbes(p)); + } + for (List 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..261f8707c18f --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst @@ -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 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# 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.header.ksh +common/usdt/tst.guess32.ksh +common/usdt/tst.guess64.ksh +common/usdt/tst.linkpriv.ksh +common/usdt/tst.linkunpriv.ksh +common/usdt/tst.multiple.ksh +common/usdt/tst.nodtrace.ksh +common/usdt/tst.onlyenabled.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 +#include +#include +#include + +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 100644 index 000000000000..cb47c7cbfd1c --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl @@ -0,0 +1,236 @@ +#!/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 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#pragma ident "%Z%%M% %I% %E% SMI" + +require 5.6.1; + +$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 () { + $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/ || /\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..2e6d88fa004a --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl @@ -0,0 +1,705 @@ +#!/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. +# +# ident "%Z%%M% %I% %E% SMI" + +require 5.6.1; + +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 = '/bin/sh'; + +@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 () { + 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, '$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, '$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 = ; + 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 () { + 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")); + +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, '$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, '$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.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.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.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..80cffd4c9694 --- /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 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * 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[timestamp] = max(new_time); + @g[timestamp] = quantize(new_time); + @h[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..21c05b8e844b --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.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: + * 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); + + 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..2e84e08ead16 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out @@ -0,0 +1,36 @@ + + 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 + 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..0685c0dac059 --- /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 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * 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); + + i += 100; +} + +tick-10ms +/i == 1000/ +{ + 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..b0c49a33d3e6 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out @@ -0,0 +1,37 @@ + + 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.stddev.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d new file mode 100644 index 000000000000..11e99d390553 --- /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 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + + +/* + * ASSERTION: + * Positive stddev() test + * + * SECTION: Aggregations/Aggregations + * + * NOTES: This is a simple verifiable positive test of the stddev() function. + */ + +#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); + 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..cec6074081e1 --- /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..5ca1f1ef9389 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d @@ -0,0 +1,112 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL 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 + +#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.complex.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d new file mode 100644 index 000000000000..2db1b6350b94 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.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: + * Complex expressions. + * Call complex expressions and make sure test succeeds. + * Match expected output in tst.complex.d.out + * + * SECTION: Types, Operators, and Expressions/Arithmetic Operators + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; + i = i++ + ++i; + printf("The value of i is %d\n", i); + i = i-- - --i; + printf("The value of i is %d\n", i); + i = i-- + ++i; + printf("The value of i is %d\n", i); + i += i++ + -- i + ++i - ++i * i ; + printf("The value of i is %d\n", i); + i -= i++ * 3; + printf("The value of i is %d\n", i); + i = i++/i--+i++-++i-++i; + printf("The value of i is %d\n", i); + exit (0); +} 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..f474a572098e --- /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->t_did] == 0/ +{ + exit(0); +} + +BEGIN +{ + printf("value should be 0; value is %x!", b[curthread->t_did]); + 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 <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..143ed641f9e7 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.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: + * 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 8 bytes. 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=64 +#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/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/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 and define the variable VALUE in it. Move it a + * directory different from the current directory. Change the value + * of appropriately in the code below. + * Invoke: dtrace -C -I -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..2f49f733e3ef --- /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 <' + 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 + +/usr/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 <' + 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 <' + 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 <' + 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..923be51c6992 --- /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 unix'{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..b68fc1387497 --- /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 <' + 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 + +/usr/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..ec38b50285fa --- /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 <' + 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 + +/usr/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..182466f4f8b1 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.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 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 < + + 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 <' + 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 <' + 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 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 <' + 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..78e107eed492 --- /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::ioctl:entry +{ + printf("Entering the ioctl function\n"); +} + +fbt::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..6d1b8a8fab69 --- /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::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..c2c7bf04d002 --- /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::ioctl:entry +{ + printf("Entering the ioctl function\n"); + printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); +} + +fbt::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..be2c0d6a6169 --- /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::ioctl:entry +{ + printf("Entering the function\n"); +} + +fbt::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..240744bff38f --- /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::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::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..cadbaa00f925 --- /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::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..67ef106fac0c --- /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::ioctl:entry +{ + self->traceme = 1; +} + +fbt:::entry +/self->traceme/ +{ + printf("called %s\n", probefunc); +} + +fbt::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_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..e878713abb27 --- /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:genunix:mutex_enter: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..d3b9ed486eb0 --- /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:genunix:mutex_enter: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..98bc5c9313dd --- /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:genunix:mutex_enter: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..e4f259a7e78c --- /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:genunix:mutex_enter: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_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 <' + 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 <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 <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 <' + 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 < 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 <' + 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 <' + 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..547730a14ea1 --- /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/perl5/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.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..392c18a6df89 --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.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 +{ + printf("%s\n", strjoin("foo", "baz")); + printf("%s\n", strjoin("foo", "")); + printf("%s\n", strjoin("", "baz")); + printf("%s\n", strjoin("", "")); + exit(0); +} 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 : "", + command[i].result != NULL ? command[i].result : ""); + 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/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/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(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..2785b51f3084 --- /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 +#include +#include +#include +#include +#include +#include + +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); + + 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/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. 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..3488903c19ea --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java @@ -0,0 +1,116 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: 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 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 "); + 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`setrun")) { + 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/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 < 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 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