From f215e02bf85f68d3a6106c2a1f4f7f063f819064 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 11 Apr 2024 10:17:27 +0200 Subject: Adding upstream version 7.0.14-dfsg. Signed-off-by: Daniel Baumann --- src/VBox/ExtPacks/.scm-settings | 32 + src/VBox/ExtPacks/BusMouseSample/.scm-settings | 33 + src/VBox/ExtPacks/BusMouseSample/DevBusMouse.cpp | 901 + src/VBox/ExtPacks/BusMouseSample/ExtPack.xml | 10 + src/VBox/ExtPacks/BusMouseSample/Makefile.kmk | 203 + .../ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp | 130 + .../ExtPacks/BusMouseSample/VBoxBusMouseMainVM.cpp | 175 + src/VBox/ExtPacks/Makefile.kmk | 45 + src/VBox/ExtPacks/Skeleton/.scm-settings | 33 + src/VBox/ExtPacks/Skeleton/ExtPack.xml | 11 + src/VBox/ExtPacks/Skeleton/Makefile.kmk | 171 + src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp | 130 + src/VBox/ExtPacks/Skeleton/VBoxSkeletonMainVM.cpp | 130 + src/VBox/ExtPacks/VBoxDTrace/.scm-settings | 34 + src/VBox/ExtPacks/VBoxDTrace/CDDL-ONLY | 2 + src/VBox/ExtPacks/VBoxDTrace/COPYING | 378 + src/VBox/ExtPacks/VBoxDTrace/ExtPack.xml | 8 + src/VBox/ExtPacks/VBoxDTrace/Makefile.kmk | 367 + src/VBox/ExtPacks/VBoxDTrace/Samples/Hello.d | 38 + src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp | 130 + src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0.cpp | 2174 +++ src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0A.asm | 32 + src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceWrapper.cpp | 202 + .../ExtPacks/VBoxDTrace/generated/dt_grammar.c | 3729 +++++ .../ExtPacks/VBoxDTrace/generated/dt_grammar.h | 290 + src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c | 3516 ++++ .../VBoxDTrace/include/VBoxDTraceLibCWrappers.h | 101 + .../ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h | 472 + src/VBox/ExtPacks/VBoxDTrace/onnv/COPYING | 378 + src/VBox/ExtPacks/VBoxDTrace/onnv/Makefile.kup | 0 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/Makefile.kup | 0 .../ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile | 57 + .../VBoxDTrace/onnv/cmd/dtrace/Makefile.com | 57 + .../VBoxDTrace/onnv/cmd/dtrace/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/amd64/Makefile | 32 + .../VBoxDTrace/onnv/cmd/dtrace/amd64/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/Makefile | 167 + .../VBoxDTrace/onnv/cmd/dtrace/demo/Makefile.kup | 0 .../onnv/cmd/dtrace/demo/act/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/act/time.d | 44 + .../onnv/cmd/dtrace/demo/agg/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/agg/clear.d | 45 + .../VBoxDTrace/onnv/cmd/dtrace/demo/agg/dateprof.d | 52 + .../VBoxDTrace/onnv/cmd/dtrace/demo/agg/denorm.d | 51 + .../onnv/cmd/dtrace/demo/agg/lquantize.d | 30 + .../onnv/cmd/dtrace/demo/agg/normalize.d | 49 + .../onnv/cmd/dtrace/demo/agg/renormalize.d | 43 + .../VBoxDTrace/onnv/cmd/dtrace/demo/agg/trunc.d | 46 + .../VBoxDTrace/onnv/cmd/dtrace/demo/agg/writes.d | 30 + .../onnv/cmd/dtrace/demo/agg/writesbycmd.d | 30 + .../onnv/cmd/dtrace/demo/agg/writesbycmdfd.d | 30 + .../onnv/cmd/dtrace/demo/agg/writetime.d | 37 + .../onnv/cmd/dtrace/demo/agg/writetimeq.d | 37 + .../onnv/cmd/dtrace/demo/anon/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/anon/iprb.d | 39 + .../onnv/cmd/dtrace/demo/buf/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/buf/ring.d | 39 + .../VBoxDTrace/onnv/cmd/dtrace/demo/chapters | 125 + .../onnv/cmd/dtrace/demo/dtrace/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/begin.d | 42 + .../VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/end.d | 39 + .../VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/error.d | 35 + .../onnv/cmd/dtrace/demo/fbt/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/fbt/delay.d | 39 + .../VBoxDTrace/onnv/cmd/dtrace/demo/fbt/putnext.d | 30 + .../VBoxDTrace/onnv/cmd/dtrace/demo/fbt/ssd.d | 31 + .../VBoxDTrace/onnv/cmd/dtrace/demo/fbt/xioctl.d | 50 + .../onnv/cmd/dtrace/demo/intro/Makefile.kup | 0 .../onnv/cmd/dtrace/demo/intro/countdown.d | 43 + .../onnv/cmd/dtrace/demo/intro/counter.d | 44 + .../VBoxDTrace/onnv/cmd/dtrace/demo/intro/hello.d | 31 + .../VBoxDTrace/onnv/cmd/dtrace/demo/intro/rwtime.d | 39 + .../onnv/cmd/dtrace/demo/intro/trussrw.d | 38 + .../onnv/cmd/dtrace/demo/io/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/io/applicat.d | 32 + .../VBoxDTrace/onnv/cmd/dtrace/demo/io/iocpu.d | 65 + .../VBoxDTrace/onnv/cmd/dtrace/demo/io/iosnoop.d | 38 + .../VBoxDTrace/onnv/cmd/dtrace/demo/io/iothrough.d | 66 + .../VBoxDTrace/onnv/cmd/dtrace/demo/io/iotime.d | 47 + .../VBoxDTrace/onnv/cmd/dtrace/demo/io/whoio.d | 38 + .../VBoxDTrace/onnv/cmd/dtrace/demo/io/whowrite.d | 39 + .../onnv/cmd/dtrace/demo/ip/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/ip/ipio.d | 52 + .../VBoxDTrace/onnv/cmd/dtrace/demo/ip/ipproto.d | 45 + .../VBoxDTrace/onnv/cmd/dtrace/demo/ip/tcprst.d | 284 + .../onnv/cmd/dtrace/demo/lockstat/Makefile.kup | 0 .../onnv/cmd/dtrace/demo/lockstat/whatlock.d | 37 + .../VBoxDTrace/onnv/cmd/dtrace/demo/mkdemo.pl | 227 + .../onnv/cmd/dtrace/demo/out/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/out/printa.d | 35 + .../onnv/cmd/dtrace/demo/proc/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/proc/lwptime.d | 38 + .../onnv/cmd/dtrace/demo/proc/progtime.d | 37 + .../VBoxDTrace/onnv/cmd/dtrace/demo/proc/sig.d | 39 + .../VBoxDTrace/onnv/cmd/dtrace/demo/proc/whoexec.d | 51 + .../onnv/cmd/dtrace/demo/profile/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/profile/prof.d | 39 + .../onnv/cmd/dtrace/demo/profile/profpri.d | 31 + .../onnv/cmd/dtrace/demo/profile/restest.d | 45 + .../onnv/cmd/dtrace/demo/sched/Makefile.kup | 0 .../onnv/cmd/dtrace/demo/sched/firebird.d | 52 + .../onnv/cmd/dtrace/demo/sched/howlong.d | 42 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sched/nscd.d | 45 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sched/pri.d | 31 + .../onnv/cmd/dtrace/demo/sched/pritime.d | 44 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sched/qlen.d | 37 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sched/qtime.d | 38 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sched/tick.d | 31 + .../onnv/cmd/dtrace/demo/sched/ticktime.d | 38 + .../onnv/cmd/dtrace/demo/sched/whatfor.d | 64 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sched/where.d | 37 + .../onnv/cmd/dtrace/demo/sched/whererun.d | 60 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sched/whofor.d | 46 + .../onnv/cmd/dtrace/demo/sched/whopreempt.d | 57 + .../onnv/cmd/dtrace/demo/sched/whoqueue.d | 95 + .../onnv/cmd/dtrace/demo/sched/whosteal.d | 40 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sched/xterm.d | 44 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sched/xwork.d | 40 + .../onnv/cmd/dtrace/demo/script/Makefile.kup | 0 .../onnv/cmd/dtrace/demo/script/interp.d | 33 + .../onnv/cmd/dtrace/demo/script/syscall.d | 31 + .../onnv/cmd/dtrace/demo/script/tracewrite.d | 32 + .../onnv/cmd/dtrace/demo/sdt/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/sdt/callout.d | 38 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sdt/interval.d | 54 + .../VBoxDTrace/onnv/cmd/dtrace/demo/sdt/intr.d | 38 + .../onnv/cmd/dtrace/demo/spec/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/spec/spec.d | 37 + .../onnv/cmd/dtrace/demo/spec/specopen.d | 93 + .../onnv/cmd/dtrace/demo/struct/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/struct/kstat.d | 44 + .../VBoxDTrace/onnv/cmd/dtrace/demo/struct/ksyms.d | 55 + .../onnv/cmd/dtrace/demo/struct/rwinfo.d | 59 + .../onnv/cmd/dtrace/demo/sysinfo/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/sysinfo/find.d | 45 + .../onnv/cmd/dtrace/demo/tcp/Makefile.kup | 0 .../onnv/cmd/dtrace/demo/tcp/tcp1stbyte.d | 37 + .../VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpbytes.d | 36 + .../onnv/cmd/dtrace/demo/tcp/tcpbytesstat.d | 45 + .../onnv/cmd/dtrace/demo/tcp/tcpconnlat.d | 37 + .../VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpio.d | 32 + .../onnv/cmd/dtrace/demo/tcp/tcpioflags.d | 64 + .../VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpsnoop.d | 78 + .../VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpstate.d | 39 + .../VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcptop.d | 138 + .../onnv/cmd/dtrace/demo/udp/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpbytes.d | 36 + .../onnv/cmd/dtrace/demo/udp/udpbytesstat.d | 45 + .../VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpio.d | 32 + .../VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpsnoop.d | 59 + .../VBoxDTrace/onnv/cmd/dtrace/demo/udp/udptop.d | 133 + .../onnv/cmd/dtrace/demo/user/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/user/badopen.d | 38 + .../onnv/cmd/dtrace/demo/user/errorpath.d | 52 + .../VBoxDTrace/onnv/cmd/dtrace/demo/user/libc.d | 30 + .../onnv/cmd/dtrace/demo/user/userfunc.d | 42 + .../onnv/cmd/dtrace/demo/vars/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/demo/vars/clause.d | 55 + .../VBoxDTrace/onnv/cmd/dtrace/demo/vars/rtime.d | 43 + .../onnv/cmd/dtrace/demo/vminfo/Makefile.kup | 0 .../onnv/cmd/dtrace/demo/vminfo/soffice.d | 52 + .../ExtPacks/VBoxDTrace/onnv/cmd/dtrace/dtrace.c | 2085 +++ .../VBoxDTrace/onnv/cmd/dtrace/i386/Makefile | 30 + .../VBoxDTrace/onnv/cmd/dtrace/i386/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/sparc/Makefile | 30 + .../VBoxDTrace/onnv/cmd/dtrace/sparc/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/sparcv9/Makefile | 31 + .../onnv/cmd/dtrace/sparcv9/Makefile.kup | 0 .../VBoxDTrace/onnv/cmd/dtrace/test/Makefile | 46 + .../VBoxDTrace/onnv/cmd/dtrace/test/Makefile.kup | 0 .../onnv/cmd/dtrace/test/Makefile.subdirs | 41 + .../VBoxDTrace/onnv/cmd/dtrace/test/README | 32 + .../VBoxDTrace/onnv/cmd/dtrace/test/cmd/Makefile | 31 + .../onnv/cmd/dtrace/test/cmd/Makefile.kup | 0 .../onnv/cmd/dtrace/test/cmd/baddof/Makefile | 59 + .../onnv/cmd/dtrace/test/cmd/baddof/Makefile.kup | 0 .../onnv/cmd/dtrace/test/cmd/baddof/baddof.c | 207 + .../onnv/cmd/dtrace/test/cmd/badioctl/Makefile | 58 + .../onnv/cmd/dtrace/test/cmd/badioctl/Makefile.kup | 0 .../onnv/cmd/dtrace/test/cmd/badioctl/badioctl.c | 145 + .../onnv/cmd/dtrace/test/cmd/chkargs/Makefile | 33 + .../onnv/cmd/dtrace/test/cmd/chkargs/Makefile.com | 76 + .../onnv/cmd/dtrace/test/cmd/chkargs/Makefile.kup | 0 .../cmd/dtrace/test/cmd/chkargs/amd64/Makefile | 31 + .../cmd/dtrace/test/cmd/chkargs/amd64/Makefile.kup | 0 .../onnv/cmd/dtrace/test/cmd/chkargs/chkargs.c | 149 + .../onnv/cmd/dtrace/test/cmd/chkargs/i386/Makefile | 30 + .../cmd/dtrace/test/cmd/chkargs/i386/Makefile.kup | 0 .../cmd/dtrace/test/cmd/chkargs/sparc/Makefile | 30 + .../cmd/dtrace/test/cmd/chkargs/sparc/Makefile.kup | 0 .../cmd/dtrace/test/cmd/chkargs/sparcv9/Makefile | 31 + .../dtrace/test/cmd/chkargs/sparcv9/Makefile.kup | 0 .../onnv/cmd/dtrace/test/cmd/jdtrace/Getopt.java | 453 + .../onnv/cmd/dtrace/test/cmd/jdtrace/JDTrace.java | 1042 ++ .../onnv/cmd/dtrace/test/cmd/jdtrace/Makefile | 109 + .../onnv/cmd/dtrace/test/cmd/jdtrace/Makefile.kup | 0 .../onnv/cmd/dtrace/test/cmd/jdtrace/exception.lst | 77 + .../onnv/cmd/dtrace/test/cmd/jdtrace/jdtrace.c | 60 + .../dtrace/test/cmd/jdtrace/manifest/Makefile.kup | 0 .../test/cmd/jdtrace/manifest/jdtrace.jar-manifest | 3 + .../onnv/cmd/dtrace/test/cmd/scripts/Makefile | 56 + .../onnv/cmd/dtrace/test/cmd/scripts/Makefile.kup | 0 .../onnv/cmd/dtrace/test/cmd/scripts/dstyle.pl | 235 + .../onnv/cmd/dtrace/test/cmd/scripts/dtest.pl | 704 + .../VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile | 39 + .../onnv/cmd/dtrace/test/tst/Makefile.com | 104 + .../onnv/cmd/dtrace/test/tst/Makefile.kup | 0 .../onnv/cmd/dtrace/test/tst/common/Makefile | 101 + .../onnv/cmd/dtrace/test/tst/common/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/aggs/Makefile.kup | 0 .../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 + .../test/tst/common/aggs/err.D_AGG_REDEF.redef.d | 45 + .../tst/common/aggs/err.D_AGG_SCALAR.avgtoofew.d | 43 + .../tst/common/aggs/err.D_AGG_SCALAR.maxnoarg.d | 41 + .../tst/common/aggs/err.D_AGG_SCALAR.mintoofew.d | 42 + .../common/aggs/err.D_AGG_SCALAR.quantizetoofew.d | 41 + .../common/aggs/err.D_AGG_SCALAR.stddevtoofew.d | 41 + .../tst/common/aggs/err.D_AGG_SCALAR.sumtoofew.d | 42 + .../test/tst/common/aggs/err.D_CLEAR_AGGARG.bad.d | 77 + .../test/tst/common/aggs/err.D_CLEAR_PROTO.bad.d | 77 + .../test/tst/common/aggs/err.D_FUNC_IDENT.bad.d | 45 + .../tst/common/aggs/err.D_FUNC_UNDEF.badaggfunc.d | 43 + .../tst/common/aggs/err.D_IDENT_UNDEF.badexpr.d | 41 + .../tst/common/aggs/err.D_IDENT_UNDEF.badkey3.d | 42 + .../tst/common/aggs/err.D_IDENT_UNDEF.noeffect.d | 41 + .../test/tst/common/aggs/err.D_KEY_TYPE.badkey1.d | 41 + .../test/tst/common/aggs/err.D_KEY_TYPE.badkey2.d | 42 + .../test/tst/common/aggs/err.D_KEY_TYPE.badkey4.d | 44 + .../tst/common/aggs/err.D_LQUANT_BASETYPE.lqbad1.d | 44 + .../common/aggs/err.D_LQUANT_BASETYPE.lqshort.d | 44 + .../tst/common/aggs/err.D_LQUANT_BASEVAL.bad.d | 43 + .../tst/common/aggs/err.D_LQUANT_LIMTYPE.lqbad1.d | 45 + .../test/tst/common/aggs/err.D_LQUANT_LIMVAL.bad.d | 44 + .../test/tst/common/aggs/err.D_LQUANT_MATCHBASE.d | 33 + .../tst/common/aggs/err.D_LQUANT_MATCHBASE.order.d | 33 + .../test/tst/common/aggs/err.D_LQUANT_MATCHLIM.d | 33 + .../tst/common/aggs/err.D_LQUANT_MATCHLIM.order.d | 33 + .../test/tst/common/aggs/err.D_LQUANT_MATCHSTEP.d | 33 + .../common/aggs/err.D_LQUANT_MISMATCH.lqbadarg.d | 55 + .../common/aggs/err.D_LQUANT_STEPLARGE.lqtoofew.d | 42 + .../tst/common/aggs/err.D_LQUANT_STEPSMALL.bad.d | 55 + .../common/aggs/err.D_LQUANT_STEPTYPE.lqbadinc.d | 56 + .../tst/common/aggs/err.D_LQUANT_STEPVAL.bad.d | 56 + .../tst/common/aggs/err.D_NORMALIZE_AGGARG.bad.d | 65 + .../tst/common/aggs/err.D_NORMALIZE_PROTO.bad.d | 64 + .../tst/common/aggs/err.D_NORMALIZE_SCALAR.bad.d | 64 + .../common/aggs/err.D_PROTO_ARG.lquantizetoofew.d | 42 + .../tst/common/aggs/err.D_PROTO_LEN.avgnoarg.d | 44 + .../tst/common/aggs/err.D_PROTO_LEN.avgtoomany.d | 44 + .../tst/common/aggs/err.D_PROTO_LEN.counttoomany.d | 41 + .../common/aggs/err.D_PROTO_LEN.lquantizenoarg.d | 42 + .../common/aggs/err.D_PROTO_LEN.lquantizetoomany.d | 40 + .../tst/common/aggs/err.D_PROTO_LEN.maxnoarg.d | 41 + .../tst/common/aggs/err.D_PROTO_LEN.maxtoomany.d | 41 + .../tst/common/aggs/err.D_PROTO_LEN.minnoarg.d | 41 + .../tst/common/aggs/err.D_PROTO_LEN.mintoomany.d | 42 + .../common/aggs/err.D_PROTO_LEN.quantizenoarg.d | 42 + .../common/aggs/err.D_PROTO_LEN.quantizetoomany.d | 41 + .../tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d | 41 + .../common/aggs/err.D_PROTO_LEN.stddevtoomany.d | 41 + .../tst/common/aggs/err.D_PROTO_LEN.sumnoarg.d | 41 + .../tst/common/aggs/err.D_PROTO_LEN.sumtoomany.d | 41 + .../test/tst/common/aggs/err.D_TRUNC_AGGARG.bad.d | 35 + .../tst/common/aggs/err.D_TRUNC_PROTO.badmany.d | 34 + .../tst/common/aggs/err.D_TRUNC_PROTO.badnone.d | 33 + .../test/tst/common/aggs/err.D_TRUNC_SCALAR.bad.d | 34 + .../cmd/dtrace/test/tst/common/aggs/tst.allquant.d | 46 + .../dtrace/test/tst/common/aggs/tst.allquant.d.out | 131 + .../onnv/cmd/dtrace/test/tst/common/aggs/tst.avg.d | 57 + .../cmd/dtrace/test/tst/common/aggs/tst.avg.d.out | 2 + .../cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d | 46 + .../dtrace/test/tst/common/aggs/tst.avg_neg.d.out | 2 + .../cmd/dtrace/test/tst/common/aggs/tst.clear.d | 75 + .../dtrace/test/tst/common/aggs/tst.clear.d.out | 22 + .../cmd/dtrace/test/tst/common/aggs/tst.clearavg.d | 60 + .../dtrace/test/tst/common/aggs/tst.clearavg.d.out | 2 + .../dtrace/test/tst/common/aggs/tst.clearavg2.d | 63 + .../test/tst/common/aggs/tst.clearavg2.d.out | 16 + .../test/tst/common/aggs/tst.cleardenormalize.d | 78 + .../tst/common/aggs/tst.cleardenormalize.d.out | 22 + .../test/tst/common/aggs/tst.clearlquantize.d | 67 + .../test/tst/common/aggs/tst.clearlquantize.d.out | 94 + .../test/tst/common/aggs/tst.clearnormalize.d | 77 + .../test/tst/common/aggs/tst.clearnormalize.d.out | 22 + .../dtrace/test/tst/common/aggs/tst.clearstddev.d | 57 + .../test/tst/common/aggs/tst.clearstddev.d.out | 2 + .../cmd/dtrace/test/tst/common/aggs/tst.count.d | 44 + .../dtrace/test/tst/common/aggs/tst.count.d.out | 2 + .../cmd/dtrace/test/tst/common/aggs/tst.count2.d | 54 + .../dtrace/test/tst/common/aggs/tst.count2.d.out | 2 + .../cmd/dtrace/test/tst/common/aggs/tst.count3.d | 56 + .../dtrace/test/tst/common/aggs/tst.denormalize.d | 63 + .../test/tst/common/aggs/tst.denormalize.d.out | 7 + .../test/tst/common/aggs/tst.denormalizeonly.d | 61 + .../test/tst/common/aggs/tst.denormalizeonly.d.out | 6 + .../dtrace/test/tst/common/aggs/tst.fmtnormalize.d | 61 + .../test/tst/common/aggs/tst.fmtnormalize.d.out | 7 + .../cmd/dtrace/test/tst/common/aggs/tst.forms.d | 53 + .../dtrace/test/tst/common/aggs/tst.forms.d.out | 6 + .../cmd/dtrace/test/tst/common/aggs/tst.goodkey.d | 55 + .../cmd/dtrace/test/tst/common/aggs/tst.keysort.d | 108 + .../dtrace/test/tst/common/aggs/tst.keysort.d.out | 160 + .../dtrace/test/tst/common/aggs/tst.lquantize.d | 57 + .../test/tst/common/aggs/tst.lquantize.d.out | 61 + .../dtrace/test/tst/common/aggs/tst.lquantnormal.d | 51 + .../test/tst/common/aggs/tst.lquantnormal.d.out | 16 + .../dtrace/test/tst/common/aggs/tst.lquantrange.d | 40 + .../test/tst/common/aggs/tst.lquantrange.d.out | 23 + .../dtrace/test/tst/common/aggs/tst.lquantround.d | 57 + .../test/tst/common/aggs/tst.lquantround.d.out | 9 + .../dtrace/test/tst/common/aggs/tst.lquantzero.d | 96 + .../test/tst/common/aggs/tst.lquantzero.d.out | 910 ++ .../onnv/cmd/dtrace/test/tst/common/aggs/tst.max.d | 58 + .../cmd/dtrace/test/tst/common/aggs/tst.max.d.out | 3 + .../cmd/dtrace/test/tst/common/aggs/tst.max_neg.d | 46 + .../dtrace/test/tst/common/aggs/tst.max_neg.d.out | 2 + .../onnv/cmd/dtrace/test/tst/common/aggs/tst.min.d | 57 + .../cmd/dtrace/test/tst/common/aggs/tst.min.d.out | 2 + .../cmd/dtrace/test/tst/common/aggs/tst.min_neg.d | 46 + .../dtrace/test/tst/common/aggs/tst.min_neg.d.out | 2 + .../dtrace/test/tst/common/aggs/tst.multiaggs1.d | 66 + .../dtrace/test/tst/common/aggs/tst.multiaggs2.d | 61 + .../test/tst/common/aggs/tst.multiaggs2.d.out | 37 + .../dtrace/test/tst/common/aggs/tst.multiaggs3.d | 74 + .../test/tst/common/aggs/tst.multiaggs3.d.out | 38 + .../test/tst/common/aggs/tst.multinormalize.d | 65 + .../test/tst/common/aggs/tst.multinormalize.d.out | 15 + .../dtrace/test/tst/common/aggs/tst.neglquant.d | 150 + .../test/tst/common/aggs/tst.neglquant.d.out | 64 + .../cmd/dtrace/test/tst/common/aggs/tst.negorder.d | 85 + .../dtrace/test/tst/common/aggs/tst.negorder.d.out | 376 + .../cmd/dtrace/test/tst/common/aggs/tst.negquant.d | 115 + .../dtrace/test/tst/common/aggs/tst.negquant.d.out | 55 + .../cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d | 49 + .../dtrace/test/tst/common/aggs/tst.negtrunc.d.out | 11 + .../test/tst/common/aggs/tst.negtruncquant.d | 52 + .../test/tst/common/aggs/tst.negtruncquant.d.out | 46 + .../dtrace/test/tst/common/aggs/tst.normalize.d | 60 + .../test/tst/common/aggs/tst.normalize.d.out | 7 + .../cmd/dtrace/test/tst/common/aggs/tst.order.d | 78 + .../dtrace/test/tst/common/aggs/tst.order.d.out | 33 + .../cmd/dtrace/test/tst/common/aggs/tst.quantize.d | 57 + .../dtrace/test/tst/common/aggs/tst.quantize.d.out | 61 + .../dtrace/test/tst/common/aggs/tst.quantmany.d | 56 + .../test/tst/common/aggs/tst.quantmany.d.out | 1208 ++ .../dtrace/test/tst/common/aggs/tst.quantround.d | 57 + .../test/tst/common/aggs/tst.quantround.d.out | 9 + .../dtrace/test/tst/common/aggs/tst.quantzero.d | 63 + .../test/tst/common/aggs/tst.quantzero.d.out | 146 + .../dtrace/test/tst/common/aggs/tst.signature.d | 54 + .../dtrace/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 + .../test/tst/common/aggs/tst.signedkeyspos.d.out | 61 + .../cmd/dtrace/test/tst/common/aggs/tst.stddev.d | 64 + .../dtrace/test/tst/common/aggs/tst.stddev.d.out | 3 + .../cmd/dtrace/test/tst/common/aggs/tst.subr.d | 112 + .../onnv/cmd/dtrace/test/tst/common/aggs/tst.sum.d | 57 + .../cmd/dtrace/test/tst/common/aggs/tst.sum.d.out | 2 + .../cmd/dtrace/test/tst/common/aggs/tst.trunc.d | 49 + .../dtrace/test/tst/common/aggs/tst.trunc.d.out | 11 + .../cmd/dtrace/test/tst/common/aggs/tst.trunc0.d | 57 + .../dtrace/test/tst/common/aggs/tst.trunc0.d.out | 7 + .../dtrace/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 + .../test/tst/common/aggs/tst.valsortkeypos.d.out | 4 + .../dtrace/test/tst/common/arithmetic/Makefile.kup | 0 .../tst/common/arithmetic/err.D_DIV_ZERO.divby0.d | 43 + .../common/arithmetic/err.D_DIV_ZERO.divby0_1.d | 45 + .../common/arithmetic/err.D_DIV_ZERO.divby0_2.d | 46 + .../tst/common/arithmetic/err.D_DIV_ZERO.modby0.d | 44 + .../tst/common/arithmetic/err.D_SYNTAX.addmin.d | 47 + .../tst/common/arithmetic/err.D_SYNTAX.divmin.d | 46 + .../tst/common/arithmetic/err.D_SYNTAX.muladd.d | 46 + .../tst/common/arithmetic/err.D_SYNTAX.muldiv.d | 46 + .../dtrace/test/tst/common/arithmetic/tst.basics.d | 66 + .../test/tst/common/arithmetic/tst.complex.d | 57 + .../cmd/dtrace/test/tst/common/arrays/Makefile.kup | 0 .../test/tst/common/arrays/err.D_ARR_BADREF.bad.d | 42 + .../tst/common/arrays/err.D_DECL_ARRBIG.toobig.d | 45 + .../tst/common/arrays/err.D_DECL_ARRNULL.bad.d | 42 + .../test/tst/common/arrays/err.D_DECL_ARRSUB.bad.d | 42 + .../common/arrays/err.D_DECL_PROTO_TYPE.badtuple.d | 44 + .../tst/common/arrays/err.D_IDENT_UNDEF.badureg.d | 42 + .../cmd/dtrace/test/tst/common/arrays/tst.basic1.d | 56 + .../cmd/dtrace/test/tst/common/arrays/tst.basic2.d | 57 + .../cmd/dtrace/test/tst/common/arrays/tst.basic3.d | 56 + .../cmd/dtrace/test/tst/common/arrays/tst.basic4.d | 56 + .../cmd/dtrace/test/tst/common/arrays/tst.basic5.d | 59 + .../cmd/dtrace/test/tst/common/arrays/tst.basic6.d | 58 + .../dtrace/test/tst/common/arrays/tst.uregsarray.d | 51 + .../cmd/dtrace/test/tst/common/assocs/Makefile.kup | 0 .../tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d | 42 + .../tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d | 42 + .../tst/common/assocs/err.D_OP_INCOMPAT.this.d | 48 + .../tst/common/assocs/err.D_PROTO_ARG.badsig.d | 46 + .../tst/common/assocs/err.D_PROTO_LEN.toofew.d | 46 + .../tst/common/assocs/err.D_PROTO_LEN.toomany.d | 46 + .../tst/common/assocs/err.D_SYNTAX.errassign.d | 45 + .../dtrace/test/tst/common/assocs/err.tupoflow.d | 41 + .../dtrace/test/tst/common/assocs/tst.cpyarray.d | 65 + .../test/tst/common/assocs/tst.diffprofile.d | 62 + .../dtrace/test/tst/common/assocs/tst.initialize.d | 47 + .../dtrace/test/tst/common/assocs/tst.invalidref.d | 75 + .../cmd/dtrace/test/tst/common/assocs/tst.misc.d | 69 + .../test/tst/common/assocs/tst.orthogonality.d | 51 + .../cmd/dtrace/test/tst/common/assocs/tst.this.d | 49 + .../test/tst/common/assocs/tst.valassign.d.out | 2 + .../cmd/dtrace/test/tst/common/begin/Makefile.kup | 0 .../test/tst/common/begin/err.D_PDESC_ZERO.begin.d | 44 + .../test/tst/common/begin/err.D_PDESC_ZERO.tick.d | 45 + .../cmd/dtrace/test/tst/common/begin/tst.begin.d | 55 + .../dtrace/test/tst/common/begin/tst.begin.d.out | 5 + .../dtrace/test/tst/common/begin/tst.multibegin.d | 60 + .../test/tst/common/begin/tst.multibegin.d.out | 6 + .../dtrace/test/tst/common/bitfields/Makefile.kup | 0 .../err.D_ADDROF_BITFIELD.BitfieldAddress.d | 50 + .../bitfields/err.D_DECL_BFCONST.NegBitField.d | 46 + .../bitfields/err.D_DECL_BFCONST.ZeroBitField.d | 46 + .../bitfields/err.D_DECL_BFSIZE.ExceedBaseType.d | 53 + .../bitfields/err.D_DECL_BFSIZE.GreaterThan64.d | 46 + .../common/bitfields/err.D_DECL_BFTYPE.badtype.d | 47 + .../tst/common/bitfields/err.D_OFFSETOF_BITFIELD.d | 53 + .../err.D_SIZEOF_BITFIELD.SizeofBitfield.d | 49 + .../tst/common/bitfields/tst.BitFieldPromotion.d | 60 + .../test/tst/common/bitfields/tst.SizeofBitField.d | 109 + .../dtrace/test/tst/common/buffering/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/buffering/err.end.d | 54 + .../dtrace/test/tst/common/buffering/err.resize1.d | 46 + .../dtrace/test/tst/common/buffering/err.resize2.d | 47 + .../dtrace/test/tst/common/buffering/err.resize3.d | 62 + .../dtrace/test/tst/common/buffering/err.zerobuf.d | 43 + .../test/tst/common/buffering/tst.alignring.d | 81 + .../test/tst/common/buffering/tst.cputime.ksh | 90 + .../test/tst/common/buffering/tst.dynvarsize.d | 67 + .../dtrace/test/tst/common/buffering/tst.fill1.d | 115 + .../test/tst/common/buffering/tst.fill1.d.out | 9 + .../dtrace/test/tst/common/buffering/tst.resize1.d | 51 + .../dtrace/test/tst/common/buffering/tst.resize2.d | 52 + .../dtrace/test/tst/common/buffering/tst.resize3.d | 73 + .../dtrace/test/tst/common/buffering/tst.ring1.d | 75 + .../dtrace/test/tst/common/buffering/tst.ring2.d | 53 + .../test/tst/common/buffering/tst.ring2.d.out | 6 + .../dtrace/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 + .../dtrace/test/tst/common/buffering/tst.switch1.d | 69 + .../test/tst/common/buffering/tst.switch1.d.out | 11 + .../dtrace/test/tst/common/builtinvar/Makefile.kup | 0 .../builtinvar/err.D_XLATE_NOCONV.cpuusage.d | 42 + .../common/builtinvar/err.D_XLATE_NOCONV.nice.d | 45 + .../builtinvar/err.D_XLATE_NOCONV.priority.d | 43 + .../common/builtinvar/err.D_XLATE_NOCONV.prsize.d | 42 + .../common/builtinvar/err.D_XLATE_NOCONV.rssize.d | 42 + .../dtrace/test/tst/common/builtinvar/tst.arg0.d | 42 + .../test/tst/common/builtinvar/tst.arg0clause.d | 47 + .../dtrace/test/tst/common/builtinvar/tst.arg1.d | 42 + .../test/tst/common/builtinvar/tst.arg1to8.d | 43 + .../test/tst/common/builtinvar/tst.arg1to8clause.d | 47 + .../dtrace/test/tst/common/builtinvar/tst.caller.d | 42 + .../test/tst/common/builtinvar/tst.caller1.d | 46 + .../dtrace/test/tst/common/builtinvar/tst.epid.d | 46 + .../dtrace/test/tst/common/builtinvar/tst.epid1.d | 43 + .../dtrace/test/tst/common/builtinvar/tst.errno.d | 47 + .../dtrace/test/tst/common/builtinvar/tst.errno1.d | 43 + .../test/tst/common/builtinvar/tst.execname.d | 49 + .../test/tst/common/builtinvar/tst.hpriority.d | 42 + .../cmd/dtrace/test/tst/common/builtinvar/tst.id.d | 46 + .../dtrace/test/tst/common/builtinvar/tst.id1.d | 42 + .../dtrace/test/tst/common/builtinvar/tst.ipl.d | 46 + .../dtrace/test/tst/common/builtinvar/tst.ipl1.d | 42 + .../test/tst/common/builtinvar/tst.lwpsinfo.d | 55 + .../test/tst/common/builtinvar/tst.lwpsinfo1.d | 51 + .../dtrace/test/tst/common/builtinvar/tst.pid.d | 46 + .../dtrace/test/tst/common/builtinvar/tst.pid1.d | 42 + .../dtrace/test/tst/common/builtinvar/tst.psinfo.d | 55 + .../test/tst/common/builtinvar/tst.psinfo1.d | 51 + .../dtrace/test/tst/common/builtinvar/tst.tid.d | 46 + .../dtrace/test/tst/common/builtinvar/tst.tid1.d | 43 + .../test/tst/common/builtinvar/tst.timestamp.d | 43 + .../test/tst/common/builtinvar/tst.vtimestamp.d | 43 + .../dtrace/test/tst/common/clauses/Makefile.kup | 0 .../tst/common/clauses/err.D_IDENT_UNDEF.aggfun.d | 40 + .../tst/common/clauses/err.D_IDENT_UNDEF.aggtup.d | 40 + .../tst/common/clauses/err.D_IDENT_UNDEF.arrtup.d | 40 + .../tst/common/clauses/err.D_IDENT_UNDEF.body.d | 38 + .../tst/common/clauses/err.D_IDENT_UNDEF.both.d | 41 + .../tst/common/clauses/err.D_IDENT_UNDEF.pred.d | 39 + .../dtrace/test/tst/common/clauses/tst.nopred.d | 38 + .../cmd/dtrace/test/tst/common/clauses/tst.pred.d | 39 + .../dtrace/test/tst/common/clauses/tst.predfirst.d | 41 + .../dtrace/test/tst/common/clauses/tst.predlast.d | 42 + .../cmd/dtrace/test/tst/common/cpc/Makefile.kup | 0 .../tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d | 45 + .../cpc/err.D_PDESC_ZERO.malformedoverflow.d | 40 + .../common/cpc/err.D_PDESC_ZERO.nonexistentevent.d | 40 + .../test/tst/common/cpc/err.cpcvscpustatpart1.ksh | 78 + .../test/tst/common/cpc/err.cpcvscpustatpart2.ksh | 70 + .../tst/common/cpc/err.cputrackfailtostart.ksh | 77 + .../test/tst/common/cpc/err.cputrackterminates.ksh | 70 + .../test/tst/common/cpc/err.toomanyenablings.d | 55 + .../cmd/dtrace/test/tst/common/cpc/tst.allcpus.ksh | 107 + .../dtrace/test/tst/common/cpc/tst.genericevent.d | 48 + .../test/tst/common/cpc/tst.platformevent.ksh | 81 + .../cmd/dtrace/test/tst/common/decls/Makefile.kup | 0 .../decls/err.D_DECL_LOCASSC.NonLocalAssoc.d | 49 + .../common/decls/err.D_DECL_LONGINT.LongStruct.d | 52 + .../decls/err.D_DECL_PARMCLASS.BadStorageClass.d | 51 + .../common/decls/err.D_DECL_PROTO_NAME.VoidName.d | 40 + .../tst/common/decls/err.D_DECL_PROTO_TYPE.Dyn.d | 40 + .../decls/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 + .../cmd/dtrace/test/tst/common/decls/tst.arrays.d | 51 + .../cmd/dtrace/test/tst/common/decls/tst.basics.d | 67 + .../cmd/dtrace/test/tst/common/decls/tst.funcs.d | 49 + .../dtrace/test/tst/common/decls/tst.pointers.d | 43 + .../test/tst/common/decls/tst.varargsfuncs.d | 45 + .../test/tst/common/docsExamples/Makefile.kup | 0 .../dtrace/test/tst/common/docsExamples/badptr.d | 42 + .../test/tst/common/docsExamples/countdown.d | 53 + .../dtrace/test/tst/common/docsExamples/counter.d | 52 + .../test/tst/common/docsExamples/errorpath.d | 47 + .../dtrace/test/tst/common/docsExamples/hello.d | 42 + .../dtrace/test/tst/common/docsExamples/kstat.d | 57 + .../dtrace/test/tst/common/docsExamples/ksyms.d | 63 + .../test/tst/common/docsExamples/renormalize.d | 55 + .../dtrace/test/tst/common/docsExamples/rtime.d | 50 + .../cmd/dtrace/test/tst/common/docsExamples/rw.d | 42 + .../dtrace/test/tst/common/docsExamples/rwinfo.d | 74 + .../dtrace/test/tst/common/docsExamples/rwtime.d | 50 + .../dtrace/test/tst/common/docsExamples/specopen.d | 79 + .../dtrace/test/tst/common/docsExamples/truss.d | 55 + .../dtrace/test/tst/common/docsExamples/trussrw.d | 52 + .../dtrace/test/tst/common/docsExamples/userfunc.d | 61 + .../cmd/dtrace/test/tst/common/drops/Makefile.kup | 0 .../tst/common/drops/drp.DTRACEDROP_AGGREGATION.d | 44 + .../tst/common/drops/drp.DTRACEDROP_DBLERROR.d | 42 + .../test/tst/common/drops/drp.DTRACEDROP_DYNAMIC.d | 43 + .../tst/common/drops/drp.DTRACEDROP_PRINCIPAL.d | 43 + .../common/drops/drp.DTRACEDROP_PRINCIPAL.end.d | 43 + .../test/tst/common/drops/drp.DTRACEDROP_SPEC.d | 48 + .../tst/common/drops/drp.DTRACEDROP_SPECUNAVAIL.d | 42 + .../common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d | 53 + .../dtrace/test/tst/common/dtraceUtil/Makefile.kup | 0 .../err.D_PDESC_ZERO.InvalidDescription1.d | 42 + .../test/tst/common/dtraceUtil/man.APIVersion.d | 37 + .../test/tst/common/dtraceUtil/man.AddSearchPath.d | 55 + .../test/tst/common/dtraceUtil/man.CoalesceTrace.d | 67 + .../test/tst/common/dtraceUtil/man.ELFGeneration.d | 48 + .../tst/common/dtraceUtil/man.IncludedFilePath.d | 48 + .../common/dtraceUtil/man.ListProbesWithFunctions | 99 + .../tst/common/dtraceUtil/man.ListProbesWithIDs | 77 + .../common/dtraceUtil/man.ListProbesWithModules | 91 + .../tst/common/dtraceUtil/man.ListProbesWithNames | 128 + .../common/dtraceUtil/man.ListProbesWithProviders | 82 + .../tst/common/dtraceUtil/man.ShowCompilerCode.d | 44 + .../test/tst/common/dtraceUtil/man.TraceFunctions | 115 + .../dtrace/test/tst/common/dtraceUtil/man.TraceIDs | 70 + .../test/tst/common/dtraceUtil/man.TraceModule | 114 + .../test/tst/common/dtraceUtil/man.TraceNames | 129 + .../test/tst/common/dtraceUtil/man.TraceProvider | 83 + .../common/dtraceUtil/man.VerboseStabilityReport.d | 47 + .../tst/common/dtraceUtil/tst.AddSearchPath.d.ksh | 82 + .../tst/common/dtraceUtil/tst.BufsizeGiga.d.ksh | 45 + .../tst/common/dtraceUtil/tst.BufsizeKilo.d.ksh | 45 + .../tst/common/dtraceUtil/tst.BufsizeMega.d.ksh | 45 + .../tst/common/dtraceUtil/tst.BufsizeTera.d.ksh | 45 + .../tst/common/dtraceUtil/tst.DataModel32.d.ksh | 73 + .../tst/common/dtraceUtil/tst.DataModel64.d.ksh | 74 + .../common/dtraceUtil/tst.DefineNameWithCPP.d.ksh | 68 + .../dtraceUtil/tst.DefineNameWithCPP.d.ksh.out | 2 + .../dtraceUtil/tst.DestructWithFunction.d.ksh | 56 + .../dtraceUtil/tst.DestructWithFunction.d.ksh.out | 1 + .../tst/common/dtraceUtil/tst.DestructWithID.d.ksh | 54 + .../common/dtraceUtil/tst.DestructWithID.d.ksh.out | 1 + .../common/dtraceUtil/tst.DestructWithModule.d.ksh | 54 + .../dtraceUtil/tst.DestructWithModule.d.ksh.out | 1 + .../common/dtraceUtil/tst.DestructWithName.d.ksh | 54 + .../dtraceUtil/tst.DestructWithName.d.ksh.out | 1 + .../dtraceUtil/tst.DestructWithProvider.d.ksh | 54 + .../dtraceUtil/tst.DestructWithProvider.d.ksh.out | 1 + .../common/dtraceUtil/tst.DestructWithoutW.d.ksh | 55 + .../common/dtraceUtil/tst.ELFGenerationOut.d.ksh | 73 + .../common/dtraceUtil/tst.ELFGenerationWithO.d.ksh | 74 + .../tst/common/dtraceUtil/tst.ExitStatus1.d.ksh | 56 + .../tst/common/dtraceUtil/tst.ExitStatus2.d.ksh | 55 + .../common/dtraceUtil/tst.ExtraneousProbeIds.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidFuncName1.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidFuncName2.d.ksh | 53 + .../tst/common/dtraceUtil/tst.InvalidId1.d.ksh | 59 + .../tst/common/dtraceUtil/tst.InvalidId2.d.ksh | 59 + .../tst/common/dtraceUtil/tst.InvalidId3.d.ksh | 59 + .../tst/common/dtraceUtil/tst.InvalidModule1.d.ksh | 59 + .../tst/common/dtraceUtil/tst.InvalidModule2.d.ksh | 59 + .../tst/common/dtraceUtil/tst.InvalidModule3.d.ksh | 59 + .../tst/common/dtraceUtil/tst.InvalidModule4.d.ksh | 59 + .../dtraceUtil/tst.InvalidProbeIdentifier.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidProvider1.d.ksh | 59 + .../common/dtraceUtil/tst.InvalidProvider2.d.ksh | 59 + .../common/dtraceUtil/tst.InvalidProvider3.d.ksh | 59 + .../common/dtraceUtil/tst.InvalidProvider4.d.ksh | 59 + .../common/dtraceUtil/tst.InvalidTraceFunc1.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidTraceFunc2.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidTraceFunc3.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidTraceFunc4.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidTraceFunc5.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidTraceFunc6.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidTraceFunc8.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidTraceFunc9.d.ksh | 53 + .../common/dtraceUtil/tst.InvalidTraceID1.d.ksh | 58 + .../common/dtraceUtil/tst.InvalidTraceID2.d.ksh | 58 + .../common/dtraceUtil/tst.InvalidTraceID3.d.ksh | 58 + .../common/dtraceUtil/tst.InvalidTraceID4.d.ksh | 58 + .../common/dtraceUtil/tst.InvalidTraceID5.d.ksh | 58 + .../common/dtraceUtil/tst.InvalidTraceID6.d.ksh | 58 + .../common/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 + .../common/dtraceUtil/tst.InvalidTraceName1.d.ksh | 57 + .../common/dtraceUtil/tst.InvalidTraceName2.d.ksh | 57 + .../common/dtraceUtil/tst.InvalidTraceName3.d.ksh | 57 + .../common/dtraceUtil/tst.InvalidTraceName4.d.ksh | 57 + .../common/dtraceUtil/tst.InvalidTraceName5.d.ksh | 57 + .../common/dtraceUtil/tst.InvalidTraceName6.d.ksh | 57 + .../common/dtraceUtil/tst.InvalidTraceName7.d.ksh | 57 + .../common/dtraceUtil/tst.InvalidTraceName8.d.ksh | 57 + .../common/dtraceUtil/tst.InvalidTraceName9.d.ksh | 57 + .../dtraceUtil/tst.InvalidTraceProvider1.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceProvider2.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceProvider3.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceProvider4.d.ksh | 58 + .../dtraceUtil/tst.InvalidTraceProvider5.d.ksh | 58 + .../dtraceUtil/tst.MultipleInvalidProbeId.d.ksh | 53 + .../dtraceUtil/tst.PreprocessorStatement.d.ksh | 70 + .../test/tst/common/dtraceUtil/tst.QuietMode.d.ksh | 65 + .../tst/common/dtraceUtil/tst.QuietMode.d.ksh.out | 1 + .../tst/common/dtraceUtil/tst.TestCompile.d.ksh | 67 + .../common/dtraceUtil/tst.TestCompile.d.ksh.out | 0 .../dtraceUtil/tst.UnDefineNameWithCPP.d.ksh | 71 + .../common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh | 58 + .../dtraceUtil/tst.ZeroFunctionProbes.d.ksh.out | 1 + .../common/dtraceUtil/tst.ZeroModuleProbes.d.ksh | 57 + .../dtraceUtil/tst.ZeroModuleProbes.d.ksh.out | 1 + .../tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh | 56 + .../common/dtraceUtil/tst.ZeroNameProbes.d.ksh.out | 1 + .../common/dtraceUtil/tst.ZeroProbeIdentfier.d.ksh | 53 + .../common/dtraceUtil/tst.ZeroProbesWithoutZ.d.ksh | 57 + .../common/dtraceUtil/tst.ZeroProviderProbes.d.ksh | 57 + .../dtraceUtil/tst.ZeroProviderProbes.d.ksh.out | 1 + .../cmd/dtrace/test/tst/common/end/Makefile.kup | 0 .../tst/common/end/err.D_IDENT_UNDEF.timespent.d | 49 + .../onnv/cmd/dtrace/test/tst/common/end/tst.end.d | 55 + .../test/tst/common/end/tst.endwithoutbegin.d | 48 + .../dtrace/test/tst/common/end/tst.multibeginend.d | 77 + .../cmd/dtrace/test/tst/common/end/tst.multiend.d | 61 + .../cmd/dtrace/test/tst/common/enum/Makefile.kup | 0 .../common/enum/err.D_DECL_IDRED.EnumSameName.d | 57 + .../common/enum/err.D_UNKNOWN.RepeatIdentifiers.d | 52 + .../dtrace/test/tst/common/enum/tst.EnumEquality.d | 56 + .../test/tst/common/enum/tst.EnumSameValue.d | 51 + .../test/tst/common/enum/tst.EnumValAssign.d | 57 + .../cmd/dtrace/test/tst/common/error/Makefile.kup | 0 .../test/tst/common/error/tst.DTRACEFLT_BADADDR.d | 51 + .../test/tst/common/error/tst.DTRACEFLT_DIVZERO.d | 54 + .../test/tst/common/error/tst.DTRACEFLT_UNKNOWN.d | 53 + .../cmd/dtrace/test/tst/common/error/tst.error.d | 49 + .../dtrace/test/tst/common/error/tst.errorend.d | 54 + .../cmd/dtrace/test/tst/common/exit/Makefile.kup | 0 .../test/tst/common/exit/err.D_PROTO_LEN.noarg.d | 42 + .../cmd/dtrace/test/tst/common/exit/err.exitarg1.d | 42 + .../cmd/dtrace/test/tst/common/exit/tst.basic1.d | 42 + .../test/tst/common/fbtprovider/Makefile.kup | 0 .../fbtprovider/err.D_PDESC_ZERO.notreturn.d | 56 + .../dtrace/test/tst/common/fbtprovider/tst.basic.d | 49 + .../tst/common/fbtprovider/tst.functionentry.d | 48 + .../common/fbtprovider/tst.functionreturnvalue.d | 43 + .../test/tst/common/fbtprovider/tst.ioctlargs.d | 50 + .../test/tst/common/fbtprovider/tst.offset.d | 53 + .../test/tst/common/fbtprovider/tst.offsetzero.d | 50 + .../test/tst/common/fbtprovider/tst.return.d | 52 + .../test/tst/common/fbtprovider/tst.return0.d | 44 + .../test/tst/common/fbtprovider/tst.tailcall.d | 55 + .../cmd/dtrace/test/tst/common/funcs/Makefile.kup | 0 .../common/funcs/err.D_FUNC_UNDEF.progenyofbad1.d | 44 + .../test/tst/common/funcs/err.D_OP_VFPTR.badop.d | 47 + .../tst/common/funcs/err.D_PROTO_ARG.chillbadarg.d | 43 + .../common/funcs/err.D_PROTO_ARG.copyoutbadarg.d | 43 + .../tst/common/funcs/err.D_PROTO_ARG.mobadarg.d | 41 + .../tst/common/funcs/err.D_PROTO_ARG.raisebadarg.d | 43 + .../tst/common/funcs/err.D_PROTO_LEN.allocanoarg.d | 45 + .../common/funcs/err.D_PROTO_LEN.badbreakpoint.d | 43 + .../tst/common/funcs/err.D_PROTO_LEN.chilltoofew.d | 43 + .../common/funcs/err.D_PROTO_LEN.chilltoomany.d | 42 + .../funcs/err.D_PROTO_LEN.copyoutstrbadarg.d | 43 + .../funcs/err.D_PROTO_LEN.copyoutstrtoofew.d | 43 + .../common/funcs/err.D_PROTO_LEN.copyouttoofew.d | 43 + .../common/funcs/err.D_PROTO_LEN.copyouttoomany.d | 44 + .../tst/common/funcs/err.D_PROTO_LEN.motoofew.d | 41 + .../tst/common/funcs/err.D_PROTO_LEN.motoomany.d | 41 + .../tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d | 42 + .../tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d | 43 + .../tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d | 42 + .../tst/common/funcs/err.D_PROTO_LEN.panicbadarg.d | 43 + .../common/funcs/err.D_PROTO_LEN.progenyofbad2.d | 44 + .../tst/common/funcs/err.D_PROTO_LEN.stopbadarg.d | 43 + .../common/funcs/err.D_STRINGOF_TYPE.badstringof.d | 43 + .../test/tst/common/funcs/err.D_VAR_UNDEF.badvar.d | 43 + .../dtrace/test/tst/common/funcs/err.badalloca.d | 56 + .../dtrace/test/tst/common/funcs/err.badalloca2.d | 49 + .../dtrace/test/tst/common/funcs/err.badbcopy.d | 55 + .../dtrace/test/tst/common/funcs/err.badbcopy1.d | 54 + .../dtrace/test/tst/common/funcs/err.badbcopy2.d | 53 + .../dtrace/test/tst/common/funcs/err.badbcopy3.d | 50 + .../dtrace/test/tst/common/funcs/err.badbcopy4.d | 53 + .../dtrace/test/tst/common/funcs/err.badbcopy5.d | 55 + .../dtrace/test/tst/common/funcs/err.badbcopy6.d | 40 + .../dtrace/test/tst/common/funcs/err.badchill.d | 39 + .../test/tst/common/funcs/err.chillbadarg.ksh | 69 + .../cmd/dtrace/test/tst/common/funcs/err.copyout.d | 49 + .../test/tst/common/funcs/err.copyoutbadaddr.ksh | 71 + .../tst/common/funcs/err.copyoutstrbadaddr.ksh | 70 + .../test/tst/common/funcs/err.inet_ntoa6badaddr.d | 45 + .../test/tst/common/funcs/err.inet_ntoabadaddr.d | 45 + .../test/tst/common/funcs/err.inet_ntopbadaddr.d | 45 + .../test/tst/common/funcs/err.inet_ntopbadarg.d | 47 + .../test/tst/common/funcs/tst.badfreopen.ksh | 102 + .../dtrace/test/tst/common/funcs/tst.basename.d | 87 + .../test/tst/common/funcs/tst.basename.d.out | 163 + .../cmd/dtrace/test/tst/common/funcs/tst.bcopy.d | 61 + .../cmd/dtrace/test/tst/common/funcs/tst.chill.ksh | 77 + .../dtrace/test/tst/common/funcs/tst.cleanpath.d | 70 + .../test/tst/common/funcs/tst.cleanpath.d.out | 22 + .../cmd/dtrace/test/tst/common/funcs/tst.copyin.d | 54 + .../dtrace/test/tst/common/funcs/tst.copyinto.d | 56 + .../test/tst/common/funcs/tst.ddi_pathname.d | 64 + .../cmd/dtrace/test/tst/common/funcs/tst.default.d | 64 + .../dtrace/test/tst/common/funcs/tst.freopen.ksh | 111 + .../dtrace/test/tst/common/funcs/tst.ftruncate.ksh | 64 + .../test/tst/common/funcs/tst.ftruncate.ksh.out | 11 + .../cmd/dtrace/test/tst/common/funcs/tst.hton.d | 97 + .../cmd/dtrace/test/tst/common/funcs/tst.index.d | 226 + .../dtrace/test/tst/common/funcs/tst.index.d.out | 1126 ++ .../dtrace/test/tst/common/funcs/tst.inet_ntoa.d | 58 + .../test/tst/common/funcs/tst.inet_ntoa.d.out | 5 + .../dtrace/test/tst/common/funcs/tst.inet_ntoa6.d | 95 + .../test/tst/common/funcs/tst.inet_ntoa6.d.out | 8 + .../dtrace/test/tst/common/funcs/tst.inet_ntop.d | 135 + .../test/tst/common/funcs/tst.inet_ntop.d.out | 13 + .../cmd/dtrace/test/tst/common/funcs/tst.lltostr.d | 41 + .../dtrace/test/tst/common/funcs/tst.lltostr.d.out | 8 + .../dtrace/test/tst/common/funcs/tst.mutex_owned.d | 62 + .../dtrace/test/tst/common/funcs/tst.mutex_owner.d | 63 + .../tst/common/funcs/tst.mutex_type_adaptive.d | 71 + .../dtrace/test/tst/common/funcs/tst.progenyof.d | 64 + .../cmd/dtrace/test/tst/common/funcs/tst.rand.d | 54 + .../cmd/dtrace/test/tst/common/funcs/tst.strchr.d | 71 + .../dtrace/test/tst/common/funcs/tst.strchr.d.out | 6 + .../cmd/dtrace/test/tst/common/funcs/tst.strjoin.d | 38 + .../dtrace/test/tst/common/funcs/tst.strjoin.d.out | 5 + .../cmd/dtrace/test/tst/common/funcs/tst.strstr.d | 89 + .../dtrace/test/tst/common/funcs/tst.strstr.d.out | 10 + .../cmd/dtrace/test/tst/common/funcs/tst.strtok.d | 146 + .../dtrace/test/tst/common/funcs/tst.strtok.d.out | 5 + .../dtrace/test/tst/common/funcs/tst.strtok_null.d | 43 + .../cmd/dtrace/test/tst/common/funcs/tst.substr.d | 231 + .../dtrace/test/tst/common/funcs/tst.substr.d.out | 254 + .../test/tst/common/funcs/tst.substrminate.d | 52 + .../test/tst/common/funcs/tst.substrminate.d.out | 3 + .../cmd/dtrace/test/tst/common/funcs/tst.system.d | 45 + .../dtrace/test/tst/common/funcs/tst.system.d.out | 8 + .../dtrace/test/tst/common/grammar/Makefile.kup | 0 .../test/tst/common/grammar/err.D_ADDROF_LVAL.d | 41 + .../test/tst/common/grammar/err.D_EMPTY.empty.d | 34 + .../dtrace/test/tst/common/grammar/tst.clauses.d | 48 + .../cmd/dtrace/test/tst/common/grammar/tst.stmts.d | 59 + .../cmd/dtrace/test/tst/common/inline/Makefile.kup | 0 .../tst/common/inline/err.D_DECL_IDRED.redef1.d | 42 + .../tst/common/inline/err.D_DECL_IDRED.redef2.d | 41 + .../tst/common/inline/err.D_IDENT_UNDEF.recur.d | 41 + .../tst/common/inline/err.D_OP_INCOMPAT.baddef1.d | 41 + .../tst/common/inline/err.D_OP_INCOMPAT.baddef2.d | 41 + .../tst/common/inline/err.D_OP_INCOMPAT.badxlate.d | 41 + .../test/tst/common/inline/tst.InlineDataAssign.d | 68 + .../test/tst/common/inline/tst.InlineExpression.d | 80 + .../test/tst/common/inline/tst.InlineKinds.d | 64 + .../test/tst/common/inline/tst.InlineKinds.d.out | 7 + .../test/tst/common/inline/tst.InlineTypedef.d | 52 + .../tst/common/inline/tst.InlineWritableAssign.d | 66 + .../cmd/dtrace/test/tst/common/io/Makefile.kup | 0 .../onnv/cmd/dtrace/test/tst/common/io/tst.fds.c | 100 + .../onnv/cmd/dtrace/test/tst/common/io/tst.fds.d | 54 + .../cmd/dtrace/test/tst/common/io/tst.fds.d.out | 36 + .../cmd/dtrace/test/tst/common/ip/Makefile.kup | 0 .../dtrace/test/tst/common/ip/get.ipv4remote.pl | 104 + .../dtrace/test/tst/common/ip/get.ipv6remote.pl | 88 + .../test/tst/common/ip/tst.ipv4localicmp.ksh | 70 + .../test/tst/common/ip/tst.ipv4localicmp.ksh.out | 6 + .../dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh | 125 + .../test/tst/common/ip/tst.ipv4localtcp.ksh.out | 7 + .../dtrace/test/tst/common/ip/tst.ipv4localudp.ksh | 93 + .../test/tst/common/ip/tst.ipv4localudp.ksh.out | 6 + .../test/tst/common/ip/tst.ipv4remoteicmp.ksh | 81 + .../test/tst/common/ip/tst.ipv4remoteicmp.ksh.out | 3 + .../test/tst/common/ip/tst.ipv4remotetcp.ksh | 128 + .../test/tst/common/ip/tst.ipv4remotetcp.ksh.out | 7 + .../test/tst/common/ip/tst.ipv4remoteudp.ksh | 88 + .../test/tst/common/ip/tst.ipv4remoteudp.ksh.out | 5 + .../test/tst/common/ip/tst.ipv6localicmp.ksh | 82 + .../test/tst/common/ip/tst.ipv6localicmp.ksh.out | 6 + .../test/tst/common/ip/tst.ipv6remoteicmp.ksh | 88 + .../test/tst/common/ip/tst.ipv6remoteicmp.ksh.out | 3 + .../test/tst/common/ip/tst.localtcpstate.ksh | 182 + .../test/tst/common/ip/tst.localtcpstate.ksh.out | 18 + .../test/tst/common/ip/tst.remotetcpstate.ksh | 172 + .../test/tst/common/ip/tst.remotetcpstate.ksh.out | 15 + .../cmd/dtrace/test/tst/common/java_api/Makefile | 79 + .../dtrace/test/tst/common/java_api/Makefile.kup | 0 .../test/tst/common/java_api/manifest/Makefile.kup | 0 .../tst/common/java_api/manifest/test.jar-manifest | 2 + .../test/tst/common/java_api/src/Makefile.kup | 0 .../test/tst/common/java_api/src/TestAbort.java | 158 + .../test/tst/common/java_api/src/TestBean.java | 706 + .../test/tst/common/java_api/src/TestClose.java | 90 + .../test/tst/common/java_api/src/TestDrop.java | 169 + .../test/tst/common/java_api/src/TestEnable.java | 151 + .../common/java_api/src/TestFunctionLookup.java | 114 + .../tst/common/java_api/src/TestGetAggregate.java | 252 + .../tst/common/java_api/src/TestMaxConsumers.java | 97 + .../common/java_api/src/TestMultiAggPrinta.java | 144 + .../tst/common/java_api/src/TestProbeData.java | 110 + .../common/java_api/src/TestProbeDescription.java | 55 + .../tst/common/java_api/src/TestStateMachine.java | 627 + .../test/tst/common/java_api/src/TestStopLock.java | 67 + .../dtrace/test/tst/common/java_api/tst.Abort.ksh | 39 + .../test/tst/common/java_api/tst.Abort.ksh.out | 1 + .../dtrace/test/tst/common/java_api/tst.Bean.ksh | 41 + .../test/tst/common/java_api/tst.Bean.ksh.out | 722 + .../dtrace/test/tst/common/java_api/tst.Close.ksh | 38 + .../test/tst/common/java_api/tst.Close.ksh.out | 1 + .../dtrace/test/tst/common/java_api/tst.Drop.ksh | 38 + .../test/tst/common/java_api/tst.Drop.ksh.out | 1 + .../dtrace/test/tst/common/java_api/tst.Enable.ksh | 40 + .../test/tst/common/java_api/tst.Enable.ksh.out | 6 + .../test/tst/common/java_api/tst.FunctionLookup.c | 51 + .../tst/common/java_api/tst.FunctionLookup.ksh | 39 + .../tst/common/java_api/tst.FunctionLookup.ksh.out | 3 + .../test/tst/common/java_api/tst.GetAggregate.ksh | 36 + .../test/tst/common/java_api/tst.MaxConsumers.ksh | 47 + .../tst/common/java_api/tst.MaxConsumers.ksh.out | 17 + .../tst/common/java_api/tst.MultiAggPrinta.ksh | 38 + .../tst/common/java_api/tst.MultiAggPrinta.ksh.out | 78 + .../test/tst/common/java_api/tst.ProbeData.c | 93 + .../test/tst/common/java_api/tst.ProbeData.ksh | 38 + .../test/tst/common/java_api/tst.ProbeData.ksh.out | 50 + .../tst/common/java_api/tst.ProbeDescription.ksh | 45 + .../common/java_api/tst.ProbeDescription.ksh.out | 8 + .../test/tst/common/java_api/tst.StateMachine.ksh | 40 + .../tst/common/java_api/tst.StateMachine.ksh.out | 70 + .../test/tst/common/java_api/tst.StopLock.ksh | 39 + .../test/tst/common/java_api/tst.StopLock.ksh.out | 1 + .../dtrace/test/tst/common/java_api/tst.printa.d | 78 + .../test/tst/common/java_api/tst.printa.d.out | 47 + .../cmd/dtrace/test/tst/common/lexer/Makefile.kup | 0 .../test/tst/common/lexer/err.D_CHR_NL.char.d | 43 + .../test/tst/common/lexer/err.D_CHR_NULL.char.d | 42 + .../common/lexer/err.D_INT_DIGIT.InvalidDigit.d | 39 + .../test/tst/common/lexer/err.D_INT_OFLOW.BigInt.d | 39 + .../test/tst/common/lexer/err.D_STR_NL.string.d | 44 + .../test/tst/common/lexer/err.D_SYNTAX.brace1.d | 39 + .../test/tst/common/lexer/err.D_SYNTAX.brace2.d | 37 + .../test/tst/common/lexer/err.D_SYNTAX.brack1.d | 38 + .../test/tst/common/lexer/err.D_SYNTAX.brack2.d | 38 + .../test/tst/common/lexer/err.D_SYNTAX.brack3.d | 39 + .../test/tst/common/lexer/err.D_SYNTAX.paren1.d | 38 + .../test/tst/common/lexer/err.D_SYNTAX.paren2.d | 38 + .../test/tst/common/lexer/err.D_SYNTAX.paren3.d | 39 + .../lexer/tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh | 54 + .../cmd/dtrace/test/tst/common/mdb/Makefile.kup | 0 .../dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh | 85 + .../cmd/dtrace/test/tst/common/mib/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/mib/tst.icmp.ksh | 79 + .../cmd/dtrace/test/tst/common/mib/tst.tcp.ksh | 155 + .../cmd/dtrace/test/tst/common/mib/tst.udp.ksh | 74 + .../cmd/dtrace/test/tst/common/misc/Makefile.kup | 0 .../test/tst/common/misc/err.D_PRAGMA_OPTSET.d | 34 + .../cmd/dtrace/test/tst/common/misc/tst.badopt.d | 41 + .../cmd/dtrace/test/tst/common/misc/tst.boolopt.d | 50 + .../dtrace/test/tst/common/misc/tst.boolopt.d.out | 2 + .../cmd/dtrace/test/tst/common/misc/tst.dynopt.d | 61 + .../dtrace/test/tst/common/misc/tst.dynopt.d.out | 31 + .../dtrace/test/tst/common/misc/tst.enablerace.ksh | 89 + .../cmd/dtrace/test/tst/common/misc/tst.haslam.d | 63 + .../dtrace/test/tst/common/misc/tst.include.ksh | 135 + .../dtrace/test/tst/common/misc/tst.macroglob.ksh | 41 + .../test/tst/common/misc/tst.macroglob.ksh.out | 15 + .../cmd/dtrace/test/tst/common/misc/tst.roch.d | 93 + .../dtrace/test/tst/common/misc/tst.schrock.ksh | 79 + .../dtrace/test/tst/common/multiaggs/Makefile.kup | 0 .../tst/common/multiaggs/err.D_PRINTA_AGGKEY.d | 38 + .../tst/common/multiaggs/err.D_PRINTA_AGGPROTO.d | 38 + .../dtrace/test/tst/common/multiaggs/tst.many.d | 311 + .../test/tst/common/multiaggs/tst.many.d.out | 265 + .../dtrace/test/tst/common/multiaggs/tst.same.d | 37 + .../test/tst/common/multiaggs/tst.same.d.out | 3 + .../dtrace/test/tst/common/multiaggs/tst.sort.d | 46 + .../test/tst/common/multiaggs/tst.sort.d.out | 201 + .../dtrace/test/tst/common/multiaggs/tst.sortpos.d | 60 + .../test/tst/common/multiaggs/tst.sortpos.d.out | 1021 ++ .../test/tst/common/multiaggs/tst.tuplecompat.d | 37 + .../tst/common/multiaggs/tst.tuplecompat.d.out | 2 + .../dtrace/test/tst/common/multiaggs/tst.zero.d | 51 + .../test/tst/common/multiaggs/tst.zero.d.out | 55 + .../dtrace/test/tst/common/multiaggs/tst.zero2.d | 50 + .../test/tst/common/multiaggs/tst.zero2.d.out | 72 + .../dtrace/test/tst/common/multiaggs/tst.zero3.d | 45 + .../test/tst/common/multiaggs/tst.zero3.d.out | 3 + .../cmd/dtrace/test/tst/common/nfs/Makefile.kup | 0 .../onnv/cmd/dtrace/test/tst/common/nfs/tst.call.c | 120 + .../onnv/cmd/dtrace/test/tst/common/nfs/tst.call.d | 70 + .../cmd/dtrace/test/tst/common/nfs/tst.call3.c | 441 + .../cmd/dtrace/test/tst/common/nfs/tst.call3.d | 91 + .../dtrace/test/tst/common/offsetof/Makefile.kup | 0 .../offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d | 50 + .../common/offsetof/err.D_OFFSETOF_TYPE.badtype.d | 44 + .../common/offsetof/err.D_OFFSETOF_TYPE.notsou.d | 44 + .../common/offsetof/err.D_UNKNOWN.OffsetofNULL.d | 49 + .../tst/common/offsetof/err.D_UNKNOWN.badmemb.d | 44 + .../test/tst/common/offsetof/tst.OffsetofAlias.d | 59 + .../test/tst/common/offsetof/tst.OffsetofArith.d | 73 + .../test/tst/common/offsetof/tst.OffsetofUnion.d | 59 + .../dtrace/test/tst/common/offsetof/tst.struct.d | 50 + .../test/tst/common/offsetof/tst.struct.d.out | 2 + .../dtrace/test/tst/common/offsetof/tst.union.d | 50 + .../test/tst/common/offsetof/tst.union.d.out | 2 + .../dtrace/test/tst/common/operators/Makefile.kup | 0 .../dtrace/test/tst/common/operators/tst.ternary.d | 48 + .../test/tst/common/operators/tst.ternary.d.out | 4 + .../cmd/dtrace/test/tst/common/pid/Makefile.kup | 0 .../test/tst/common/pid/err.D_PDESC_ZERO.badlib.d | 38 + .../tst/common/pid/err.D_PDESC_ZERO.badlib.exe | 29 + .../tst/common/pid/err.D_PDESC_ZERO.badproc1.d | 38 + .../tst/common/pid/err.D_PROC_BADPID.badproc2.d | 38 + .../tst/common/pid/err.D_PROC_CREATEFAIL.many.d | 36 + .../tst/common/pid/err.D_PROC_CREATEFAIL.many.exe | 29 + .../test/tst/common/pid/err.D_PROC_FUNC.badfunc.d | 40 + .../tst/common/pid/err.D_PROC_FUNC.badfunc.exe | 29 + .../test/tst/common/pid/err.D_PROC_LIB.libdash.d | 38 + .../test/tst/common/pid/err.D_PROC_LIB.libdash.exe | 29 + .../test/tst/common/pid/err.D_PROC_NAME.alldash.d | 38 + .../tst/common/pid/err.D_PROC_NAME.alldash.exe | 29 + .../test/tst/common/pid/err.D_PROC_NAME.badname.d | 38 + .../tst/common/pid/err.D_PROC_NAME.badname.exe | 29 + .../test/tst/common/pid/err.D_PROC_NAME.globdash.d | 38 + .../tst/common/pid/err.D_PROC_NAME.globdash.exe | 29 + .../test/tst/common/pid/err.D_PROC_OFF.toobig.d | 40 + .../test/tst/common/pid/err.D_PROC_OFF.toobig.exe | 29 + .../dtrace/test/tst/common/pid/tst.addprobes.ksh | 61 + .../cmd/dtrace/test/tst/common/pid/tst.args1.c | 52 + .../cmd/dtrace/test/tst/common/pid/tst.args1.d | 75 + .../cmd/dtrace/test/tst/common/pid/tst.coverage.d | 51 + .../dtrace/test/tst/common/pid/tst.coverage.exe | 29 + .../dtrace/test/tst/common/pid/tst.emptystack.d | 64 + .../test/tst/common/pid/tst.emptystack.d.out | 3 + .../dtrace/test/tst/common/pid/tst.emptystack.exe | 29 + .../cmd/dtrace/test/tst/common/pid/tst.float.c | 46 + .../cmd/dtrace/test/tst/common/pid/tst.float.d | 51 + .../onnv/cmd/dtrace/test/tst/common/pid/tst.fork.c | 63 + .../onnv/cmd/dtrace/test/tst/common/pid/tst.fork.d | 86 + .../onnv/cmd/dtrace/test/tst/common/pid/tst.gcc.c | 63 + .../onnv/cmd/dtrace/test/tst/common/pid/tst.gcc.d | 52 + .../dtrace/test/tst/common/pid/tst.killonerror.ksh | 41 + .../cmd/dtrace/test/tst/common/pid/tst.main.ksh | 59 + .../dtrace/test/tst/common/pid/tst.manypids.ksh | 70 + .../dtrace/test/tst/common/pid/tst.newprobes.ksh | 62 + .../test/tst/common/pid/tst.newprobes.ksh.out | 7 + .../dtrace/test/tst/common/pid/tst.probemod.ksh | 54 + .../dtrace/test/tst/common/pid/tst.provregex1.ksh | 93 + .../dtrace/test/tst/common/pid/tst.provregex2.ksh | 131 + .../test/tst/common/pid/tst.provregex2.ksh.out | 3 + .../dtrace/test/tst/common/pid/tst.provregex3.ksh | 102 + .../test/tst/common/pid/tst.provregex3.ksh.out | 3 + .../dtrace/test/tst/common/pid/tst.provregex4.ksh | 154 + .../test/tst/common/pid/tst.provregex4.ksh.out | 3 + .../onnv/cmd/dtrace/test/tst/common/pid/tst.ret1.c | 64 + .../onnv/cmd/dtrace/test/tst/common/pid/tst.ret1.d | 73 + .../onnv/cmd/dtrace/test/tst/common/pid/tst.ret2.c | 58 + .../onnv/cmd/dtrace/test/tst/common/pid/tst.ret2.d | 73 + .../cmd/dtrace/test/tst/common/pid/tst.vfork.c | 65 + .../cmd/dtrace/test/tst/common/pid/tst.vfork.d | 61 + .../cmd/dtrace/test/tst/common/pid/tst.weak1.c | 58 + .../cmd/dtrace/test/tst/common/pid/tst.weak1.d | 83 + .../cmd/dtrace/test/tst/common/pid/tst.weak2.c | 58 + .../cmd/dtrace/test/tst/common/pid/tst.weak2.d | 83 + .../dtrace/test/tst/common/plockstat/Makefile.kup | 0 .../test/tst/common/plockstat/tst.available.d | 39 + .../test/tst/common/plockstat/tst.available.exe | 29 + .../dtrace/test/tst/common/plockstat/tst.libmap.d | 39 + .../test/tst/common/plockstat/tst.libmap.exe | 29 + .../dtrace/test/tst/common/pointers/Makefile.kup | 0 .../dtrace/test/tst/common/pointers/err.BadAlign.d | 50 + .../common/pointers/err.D_ADDROF_VAR.ArrayVar.d | 47 + .../common/pointers/err.D_ADDROF_VAR.DynamicVar.d | 50 + .../tst/common/pointers/err.D_ADDROF_VAR.agg.d | 42 + .../tst/common/pointers/err.D_DEREF_NONPTR.noptr.d | 46 + .../pointers/err.D_DEREF_VOID.VoidPointerDeref.d | 52 + .../pointers/err.D_OP_ARRFUN.ArrayAssignment.d | 61 + .../pointers/err.D_OP_INCOMPAT.VoidPointerArith.d | 46 + .../common/pointers/err.D_OP_LVAL.AddressChange.d | 50 + .../pointers/err.D_OP_PTR.NonPointerAccess.d | 59 + .../tst/common/pointers/err.D_OP_PTR.badpointer.d | 50 + .../pointers/err.D_OP_SOU.BadPointerAccess.d | 51 + .../tst/common/pointers/err.D_OP_SOU.badpointer.d | 44 + .../test/tst/common/pointers/err.InvalidAddress1.d | 52 + .../test/tst/common/pointers/err.InvalidAddress2.d | 52 + .../test/tst/common/pointers/err.InvalidAddress3.d | 50 + .../test/tst/common/pointers/err.InvalidAddress4.d | 52 + .../test/tst/common/pointers/err.InvalidAddress5.d | 75 + .../test/tst/common/pointers/tst.ArrayPointer1.d | 174 + .../test/tst/common/pointers/tst.ArrayPointer2.d | 71 + .../test/tst/common/pointers/tst.ArrayPointer3.d | 72 + .../test/tst/common/pointers/tst.GlobalVar.d | 59 + .../tst/common/pointers/tst.IntegerArithmetic1.d | 72 + .../tst/common/pointers/tst.PointerArithmetic1.d | 58 + .../tst/common/pointers/tst.PointerArithmetic2.d | 72 + .../tst/common/pointers/tst.PointerArithmetic3.d | 61 + .../tst/common/pointers/tst.PointerAssignment.d | 71 + .../test/tst/common/pointers/tst.ValidPointer1.d | 49 + .../test/tst/common/pointers/tst.ValidPointer2.d | 49 + .../dtrace/test/tst/common/pointers/tst.VoidCast.d | 59 + .../dtrace/test/tst/common/pointers/tst.basic1.d | 47 + .../dtrace/test/tst/common/pointers/tst.basic2.d | 47 + .../cmd/dtrace/test/tst/common/pragma/Makefile.kup | 0 .../dtrace/test/tst/common/pragma/err.D_PRAGERR.d | 42 + .../tst/common/pragma/err.D_PRAGMA_DEPEND.main.d | 38 + .../test/tst/common/pragma/err.D_PRAGMA_INVAL.d | 45 + .../test/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 + .../test/tst/common/pragma/err.invalidlibdep.ksh | 57 + .../dtrace/test/tst/common/pragma/tst.libchain.ksh | 58 + .../dtrace/test/tst/common/pragma/tst.libdep.ksh | 66 + .../tst/common/pragma/tst.libdepfullyconnected.ksh | 100 + .../dtrace/test/tst/common/predicates/Makefile.kup | 0 .../predicates/err.D_PRED_SCALAR.NonScalarPred.d | 44 + .../tst/common/predicates/err.D_SYNTAX.invalid.d | 50 + .../tst/common/predicates/err.D_SYNTAX.operr.d | 50 + .../test/tst/common/predicates/tst.argsnotcached.d | 55 + .../dtrace/test/tst/common/predicates/tst.basics.d | 57 + .../test/tst/common/predicates/tst.basics.d.out | 1 + .../test/tst/common/predicates/tst.complex.d | 126 + .../test/tst/common/predicates/tst.complex.d.out | 83 + .../test/tst/common/predicates/tst.predcache.ksh | 197 + .../test/tst/common/preprocessor/Makefile.kup | 0 .../preprocessor/err.D_IDENT_UNDEF.afterprobe.d | 51 + .../preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d | 47 + .../preprocessor/err.D_SYNTAX.withoutpound.d | 47 + .../test/tst/common/preprocessor/err.defincomp.d | 47 + .../common/preprocessor/err.ifdefelsenotendif.d | 50 + .../test/tst/common/preprocessor/err.ifdefincomp.d | 48 + .../tst/common/preprocessor/err.ifdefnotendif.d | 47 + .../test/tst/common/preprocessor/err.incompelse.d | 47 + .../test/tst/common/preprocessor/err.mulelse.d | 55 + .../test/tst/common/preprocessor/tst.ifdef.d | 51 + .../test/tst/common/preprocessor/tst.ifdef.d.out | 2 + .../test/tst/common/preprocessor/tst.ifndef.d | 55 + .../test/tst/common/preprocessor/tst.ifndef.d.out | 2 + .../test/tst/common/preprocessor/tst.ifnotdef.d | 51 + .../tst/common/preprocessor/tst.ifnotdef.d.out | 2 + .../test/tst/common/preprocessor/tst.logicaland.d | 50 + .../tst/common/preprocessor/tst.logicaland.d.out | 2 + .../tst/common/preprocessor/tst.logicalandor.d | 50 + .../tst/common/preprocessor/tst.logicalandor.d.out | 2 + .../test/tst/common/preprocessor/tst.logicalor.d | 50 + .../tst/common/preprocessor/tst.logicalor.d.out | 2 + .../test/tst/common/preprocessor/tst.muland.d | 50 + .../test/tst/common/preprocessor/tst.muland.d.out | 2 + .../test/tst/common/preprocessor/tst.mulor.d | 50 + .../test/tst/common/preprocessor/tst.mulor.d.out | 2 + .../test/tst/common/preprocessor/tst.precondi.d | 48 + .../tst/common/preprocessor/tst.precondi.d.out | 2 + .../tst/common/preprocessor/tst.predicatedeclare.d | 49 + .../test/tst/common/preprocessor/tst.preexp.d | 48 + .../test/tst/common/preprocessor/tst.preexp.d.out | 2 + .../test/tst/common/preprocessor/tst.preexpelse.d | 51 + .../tst/common/preprocessor/tst.preexpelse.d.out | 2 + .../test/tst/common/preprocessor/tst.preexpif.d | 50 + .../tst/common/preprocessor/tst.preexpif.d.out | 2 + .../tst/common/preprocessor/tst.preexpifelse.d | 52 + .../tst/common/preprocessor/tst.preexpifelse.d.out | 2 + .../test/tst/common/preprocessor/tst.withinprobe.d | 50 + .../cmd/dtrace/test/tst/common/printa/Makefile.kup | 0 .../tst/common/printa/err.D_PRINTA_AGGARG.badagg.d | 40 + .../tst/common/printa/err.D_PRINTA_AGGARG.badfmt.d | 40 + .../tst/common/printa/err.D_PRINTA_AGGARG.badval.d | 41 + .../tst/common/printa/err.D_PRINTA_PROTO.bad.d | 40 + .../common/printa/err.D_PRINTF_ARG_TYPE.jstack.d | 36 + .../common/printa/err.D_PRINTF_ARG_TYPE.stack.d | 36 + .../common/printa/err.D_PRINTF_ARG_TYPE.ustack.d | 36 + .../cmd/dtrace/test/tst/common/printa/tst.basics.d | 58 + .../dtrace/test/tst/common/printa/tst.basics.d.out | 19 + .../cmd/dtrace/test/tst/common/printa/tst.def.d | 44 + .../dtrace/test/tst/common/printa/tst.def.d.out | 3 + .../dtrace/test/tst/common/printa/tst.dynwidth.d | 43 + .../test/tst/common/printa/tst.dynwidth.d.out | 5 + .../cmd/dtrace/test/tst/common/printa/tst.fmt.d | 43 + .../dtrace/test/tst/common/printa/tst.fmt.d.out | 1 + .../test/tst/common/printa/tst.largeusersym.ksh | 83 + .../cmd/dtrace/test/tst/common/printa/tst.many.d | 76 + .../dtrace/test/tst/common/printa/tst.manyval.d | 44 + .../test/tst/common/printa/tst.manyval.d.out | 2 + .../cmd/dtrace/test/tst/common/printa/tst.stack.d | 40 + .../cmd/dtrace/test/tst/common/printa/tst.tuple.d | 55 + .../dtrace/test/tst/common/printa/tst.tuple.d.out | 8 + .../test/tst/common/printa/tst.walltimestamp.ksh | 62 + .../tst/common/printa/tst.walltimestamp.ksh.out | 2 + .../cmd/dtrace/test/tst/common/printf/Makefile.kup | 0 .../common/printf/err.D_PRINTF_AGG_CONV.aggfmt.d | 40 + .../common/printf/err.D_PRINTF_ARG_EXTRA.toomany.d | 40 + .../common/printf/err.D_PRINTF_ARG_EXTRA.widths.d | 47 + .../common/printf/err.D_PRINTF_ARG_FMT.badfmt.d | 40 + .../common/printf/err.D_PRINTF_ARG_PROTO.novalue.d | 40 + .../common/printf/err.D_PRINTF_ARG_TYPE.aggarg.d | 42 + .../printf/err.D_PRINTF_ARG_TYPE.recursive.d | 46 + .../common/printf/err.D_PRINTF_DYN_PROTO.noprec.d | 40 + .../common/printf/err.D_PRINTF_DYN_PROTO.nowidth.d | 40 + .../common/printf/err.D_PRINTF_DYN_TYPE.badprec.d | 40 + .../common/printf/err.D_PRINTF_DYN_TYPE.badwidth.d | 40 + .../tst/common/printf/err.D_PROTO_LEN.toofew.d | 40 + .../test/tst/common/printf/err.D_SYNTAX.badconv1.d | 40 + .../test/tst/common/printf/err.D_SYNTAX.badconv2.d | 40 + .../test/tst/common/printf/err.D_SYNTAX.badconv3.d | 40 + .../cmd/dtrace/test/tst/common/printf/tst.basics.d | 73 + .../dtrace/test/tst/common/printf/tst.basics.d.out | 26 + .../cmd/dtrace/test/tst/common/printf/tst.flags.d | 49 + .../dtrace/test/tst/common/printf/tst.flags.d.out | 7 + .../cmd/dtrace/test/tst/common/printf/tst.hello.d | 44 + .../dtrace/test/tst/common/printf/tst.hello.d.out | 1 + .../cmd/dtrace/test/tst/common/printf/tst.ints.d | 87 + .../dtrace/test/tst/common/printf/tst.ints.d.out | 45 + .../cmd/dtrace/test/tst/common/printf/tst.precs.d | 58 + .../dtrace/test/tst/common/printf/tst.precs.d.out | 14 + .../dtrace/test/tst/common/printf/tst.print-f.d | 51 + .../test/tst/common/printf/tst.print-f.d.out | 4 + .../dtrace/test/tst/common/printf/tst.printT.ksh | 56 + .../test/tst/common/printf/tst.printT.ksh.out | 3 + .../dtrace/test/tst/common/printf/tst.printY.ksh | 56 + .../test/tst/common/printf/tst.printY.ksh.out | 3 + .../dtrace/test/tst/common/printf/tst.printcont.d | 60 + .../test/tst/common/printf/tst.printcont.d.out | 16 + .../dtrace/test/tst/common/printf/tst.printeE.d | 54 + .../test/tst/common/printf/tst.printeE.d.out | 6 + .../dtrace/test/tst/common/printf/tst.printgG.d | 54 + .../test/tst/common/printf/tst.printgG.d.out | 6 + .../cmd/dtrace/test/tst/common/printf/tst.rawfmt.d | 43 + .../dtrace/test/tst/common/printf/tst.rawfmt.d.out | 1 + .../cmd/dtrace/test/tst/common/printf/tst.str.d | 41 + .../dtrace/test/tst/common/printf/tst.str.d.out | 1 + .../cmd/dtrace/test/tst/common/printf/tst.sym.d | 43 + .../dtrace/test/tst/common/printf/tst.sym.d.out | 1 + .../cmd/dtrace/test/tst/common/printf/tst.uints.d | 47 + .../dtrace/test/tst/common/printf/tst.uints.d.out | 6 + .../cmd/dtrace/test/tst/common/printf/tst.widths.d | 59 + .../dtrace/test/tst/common/printf/tst.widths.d.out | 14 + .../dtrace/test/tst/common/printf/tst.widths1.d | 52 + .../cmd/dtrace/test/tst/common/printf/tst.wp.d | 66 + .../cmd/dtrace/test/tst/common/printf/tst.wp.d.out | 22 + .../cmd/dtrace/test/tst/common/privs/Makefile.kup | 0 .../test/tst/common/privs/tst.func_access.ksh | 82 + .../dtrace/test/tst/common/privs/tst.op_access.ksh | 70 + .../test/tst/common/privs/tst.unpriv_funcs.ksh | 79 + .../cmd/dtrace/test/tst/common/probes/Makefile.kup | 0 .../tst/common/probes/err.D_PDESC_ZERO.probeqtn.d | 51 + .../tst/common/probes/err.D_PDESC_ZERO.probestar.d | 45 + .../tst/common/probes/err.D_PDESC_ZERO.tickstar.d | 51 + .../test/tst/common/probes/err.D_SYNTAX.assign.d | 48 + .../test/tst/common/probes/err.D_SYNTAX.declare.d | 46 + .../tst/common/probes/err.D_SYNTAX.declarein.d | 46 + .../test/tst/common/probes/err.D_SYNTAX.lbraces.d | 43 + .../tst/common/probes/err.D_SYNTAX.probespec.d | 45 + .../test/tst/common/probes/err.D_SYNTAX.rbraces.d | 43 + .../test/tst/common/probes/err.D_SYNTAX.recdec.d | 46 + .../cmd/dtrace/test/tst/common/probes/tst.basic1.d | 44 + .../cmd/dtrace/test/tst/common/probes/tst.check.d | 51 + .../dtrace/test/tst/common/probes/tst.declare.d | 45 + .../test/tst/common/probes/tst.declareafter.d | 45 + .../dtrace/test/tst/common/probes/tst.emptyprobe.d | 47 + .../cmd/dtrace/test/tst/common/probes/tst.pragma.d | 44 + .../test/tst/common/probes/tst.pragmaaftertab.d | 44 + .../test/tst/common/probes/tst.pragmainside.d | 44 + .../test/tst/common/probes/tst.pragmaoutside.d | 44 + .../dtrace/test/tst/common/probes/tst.probestar.d | 50 + .../cmd/dtrace/test/tst/common/proc/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/proc/tst.create.ksh | 67 + .../dtrace/test/tst/common/proc/tst.discard.ksh | 74 + .../cmd/dtrace/test/tst/common/proc/tst.exec.ksh | 73 + .../test/tst/common/proc/tst.execfail.ENOENT.ksh | 84 + .../dtrace/test/tst/common/proc/tst.execfail.ksh | 86 + .../dtrace/test/tst/common/proc/tst.exitcore.ksh | 95 + .../dtrace/test/tst/common/proc/tst.exitexit.ksh | 67 + .../dtrace/test/tst/common/proc/tst.exitkilled.ksh | 75 + .../cmd/dtrace/test/tst/common/proc/tst.signal.ksh | 84 + .../cmd/dtrace/test/tst/common/proc/tst.sigwait.c | 75 + .../cmd/dtrace/test/tst/common/proc/tst.sigwait.d | 41 + .../dtrace/test/tst/common/proc/tst.startexit.ksh | 89 + .../dtrace/test/tst/common/profile-n/Makefile.kup | 0 .../common/profile-n/err.D_PDESC_ZERO.profile.d | 45 + .../tst/common/profile-n/err.D_PDESC_ZEROonens.d | 44 + .../tst/common/profile-n/err.D_PDESC_ZEROonensec.d | 44 + .../tst/common/profile-n/err.D_PDESC_ZEROoneus.d | 44 + .../tst/common/profile-n/err.D_PDESC_ZEROoneusec.d | 44 + .../dtrace/test/tst/common/profile-n/tst.argtest.d | 53 + .../test/tst/common/profile-n/tst.argtest.d.out | 2 + .../dtrace/test/tst/common/profile-n/tst.basic.d | 45 + .../test/tst/common/profile-n/tst.basic.d.out | 2 + .../dtrace/test/tst/common/profile-n/tst.func.ksh | 74 + .../dtrace/test/tst/common/profile-n/tst.mod.ksh | 70 + .../test/tst/common/profile-n/tst.profilehz.d | 45 + .../test/tst/common/profile-n/tst.profilehz.d.out | 1 + .../test/tst/common/profile-n/tst.profilems.d | 45 + .../test/tst/common/profile-n/tst.profilems.d.out | 1 + .../test/tst/common/profile-n/tst.profilemsec.d | 45 + .../tst/common/profile-n/tst.profilemsec.d.out | 1 + .../test/tst/common/profile-n/tst.profilenhz.d | 45 + .../test/tst/common/profile-n/tst.profilenhz.d.out | 1 + .../test/tst/common/profile-n/tst.profilens.d | 45 + .../test/tst/common/profile-n/tst.profilens.d.out | 1 + .../test/tst/common/profile-n/tst.profilensec.d | 45 + .../tst/common/profile-n/tst.profilensec.d.out | 1 + .../test/tst/common/profile-n/tst.profiles.d | 45 + .../test/tst/common/profile-n/tst.profiles.d.out | 1 + .../test/tst/common/profile-n/tst.profilesec.d | 45 + .../test/tst/common/profile-n/tst.profilesec.d.out | 1 + .../test/tst/common/profile-n/tst.profileus.d | 45 + .../test/tst/common/profile-n/tst.profileus.d.out | 1 + .../test/tst/common/profile-n/tst.profileusec.d | 45 + .../tst/common/profile-n/tst.profileusec.d.out | 1 + .../dtrace/test/tst/common/profile-n/tst.sym.ksh | 70 + .../dtrace/test/tst/common/profile-n/tst.ufunc.ksh | 71 + .../test/tst/common/profile-n/tst.ufuncsort.c | 78 + .../test/tst/common/profile-n/tst.ufuncsort.ksh | 66 + .../tst/common/profile-n/tst.ufuncsort.ksh.out | 6 + .../dtrace/test/tst/common/profile-n/tst.umod.ksh | 69 + .../dtrace/test/tst/common/profile-n/tst.usym.ksh | 70 + .../dtrace/test/tst/common/providers/Makefile.kup | 0 .../common/providers/err.D_PDESC_INVAL.wrongdec4.d | 50 + .../common/providers/err.D_PDESC_ZERO.nonprofile.d | 50 + .../common/providers/err.D_PDESC_ZERO.wrongdec1.d | 49 + .../common/providers/err.D_PDESC_ZERO.wrongdec2.d | 49 + .../common/providers/err.D_PDESC_ZERO.wrongdec3.d | 49 + .../dtrace/test/tst/common/providers/tst.basics.d | 57 + .../test/tst/common/providers/tst.basics.d.out | 1 + .../test/tst/common/providers/tst.beginexit.d | 43 + .../test/tst/common/providers/tst.beginprof.d | 47 + .../test/tst/common/providers/tst.beginprof.d.out | 1 + .../test/tst/common/providers/tst.probattrs.d | 52 + .../test/tst/common/providers/tst.probattrs.d.out | 1 + .../test/tst/common/providers/tst.probefunc.d | 52 + .../test/tst/common/providers/tst.probefunc.d.out | 1 + .../test/tst/common/providers/tst.probemod.d | 52 + .../test/tst/common/providers/tst.probemod.d.out | 1 + .../test/tst/common/providers/tst.probename.d | 52 + .../test/tst/common/providers/tst.probename.d.out | 1 + .../test/tst/common/providers/tst.probprov.d | 52 + .../test/tst/common/providers/tst.probprov.d.out | 1 + .../dtrace/test/tst/common/providers/tst.profend.d | 57 + .../test/tst/common/providers/tst.profend.d.out | 2 + .../test/tst/common/providers/tst.profexit.d | 52 + .../test/tst/common/providers/tst.profexit.d.out | 1 + .../dtrace/test/tst/common/providers/tst.trace.d | 56 + .../test/tst/common/providers/tst.trace.d.out | 1 + .../dtrace/test/tst/common/providers/tst.twoprof.d | 58 + .../test/tst/common/providers/tst.twoprof.d.out | 1 + .../cmd/dtrace/test/tst/common/raise/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/raise/tst.raise1.c | 47 + .../cmd/dtrace/test/tst/common/raise/tst.raise1.d | 67 + .../cmd/dtrace/test/tst/common/raise/tst.raise2.c | 52 + .../cmd/dtrace/test/tst/common/raise/tst.raise2.d | 67 + .../cmd/dtrace/test/tst/common/raise/tst.raise3.c | 52 + .../cmd/dtrace/test/tst/common/raise/tst.raise3.d | 67 + .../cmd/dtrace/test/tst/common/rates/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/rates/tst.aggrate.d | 68 + .../dtrace/test/tst/common/rates/tst.aggrate.d.out | 101 + .../dtrace/test/tst/common/rates/tst.statusrate.d | 72 + .../dtrace/test/tst/common/rates/tst.switchrate.d | 62 + .../test/tst/common/rates/tst.switchrate.d.out | 101 + .../cmd/dtrace/test/tst/common/safety/Makefile.kup | 0 .../dtrace/test/tst/common/safety/tst.basename.d | 54 + .../cmd/dtrace/test/tst/common/safety/tst.caller.d | 54 + .../dtrace/test/tst/common/safety/tst.cleanpath.d | 54 + .../cmd/dtrace/test/tst/common/safety/tst.copyin.d | 83 + .../dtrace/test/tst/common/safety/tst.copyin2.d | 67 + .../test/tst/common/safety/tst.ddi_pathname.d | 54 + .../dtrace/test/tst/common/safety/tst.dirname.d | 54 + .../cmd/dtrace/test/tst/common/safety/tst.errno.d | 49 + .../dtrace/test/tst/common/safety/tst.execname.d | 49 + .../cmd/dtrace/test/tst/common/safety/tst.gid.d | 49 + .../cmd/dtrace/test/tst/common/safety/tst.hton.d | 78 + .../cmd/dtrace/test/tst/common/safety/tst.index.d | 67 + .../dtrace/test/tst/common/safety/tst.msgdsize.d | 64 + .../dtrace/test/tst/common/safety/tst.msgsize.d | 64 + .../cmd/dtrace/test/tst/common/safety/tst.null.d | 78 + .../cmd/dtrace/test/tst/common/safety/tst.pid.d | 49 + .../cmd/dtrace/test/tst/common/safety/tst.ppid.d | 49 + .../dtrace/test/tst/common/safety/tst.progenyof.d | 57 + .../cmd/dtrace/test/tst/common/safety/tst.random.d | 73 + .../cmd/dtrace/test/tst/common/safety/tst.rw.d | 64 + .../dtrace/test/tst/common/safety/tst.shortstr.d | 77 + .../cmd/dtrace/test/tst/common/safety/tst.stack.d | 52 + .../dtrace/test/tst/common/safety/tst.stackdepth.d | 53 + .../cmd/dtrace/test/tst/common/safety/tst.stddev.d | 52 + .../cmd/dtrace/test/tst/common/safety/tst.strchr.d | 66 + .../dtrace/test/tst/common/safety/tst.strjoin.d | 54 + .../cmd/dtrace/test/tst/common/safety/tst.strstr.d | 54 + .../cmd/dtrace/test/tst/common/safety/tst.strtok.d | 54 + .../cmd/dtrace/test/tst/common/safety/tst.substr.d | 54 + .../dtrace/test/tst/common/safety/tst.ucaller.d | 49 + .../cmd/dtrace/test/tst/common/safety/tst.uid.d | 49 + .../dtrace/test/tst/common/safety/tst.unalign.d | 60 + .../cmd/dtrace/test/tst/common/safety/tst.uregs.d | 52 + .../cmd/dtrace/test/tst/common/safety/tst.ustack.d | 52 + .../test/tst/common/safety/tst.ustackdepth.d | 53 + .../cmd/dtrace/test/tst/common/safety/tst.vahole.d | 69 + .../test/tst/common/safety/tst.violentdeath.ksh | 51 + .../dtrace/test/tst/common/safety/tst.zonename.d | 49 + .../dtrace/test/tst/common/scalars/Makefile.kup | 0 .../tst/common/scalars/err.D_ARR_LOCAL.thisarray.d | 46 + .../tst/common/scalars/err.D_DECL_CLASS.selfthis.d | 41 + .../tst/common/scalars/err.D_DECL_CLASS.thisself.d | 42 + .../tst/common/scalars/err.D_DECL_IDRED.errval.d | 44 + .../tst/common/scalars/err.D_OP_INCOMPAT.dec.err.d | 42 + .../common/scalars/err.D_OP_INCOMPAT.dupgtype.d | 41 + .../common/scalars/err.D_OP_INCOMPAT.dupltype.d | 41 + .../common/scalars/err.D_OP_INCOMPAT.dupttype.d | 42 + .../test/tst/common/scalars/err.D_SYNTAX.declare.d | 41 + .../dtrace/test/tst/common/scalars/tst.basicvar.d | 57 + .../test/tst/common/scalars/tst.basicvar.d.out | 2 + .../dtrace/test/tst/common/scalars/tst.localvar.d | 54 + .../cmd/dtrace/test/tst/common/scalars/tst.misc.d | 50 + .../cmd/dtrace/test/tst/common/scalars/tst.self.d | 42 + .../dtrace/test/tst/common/scalars/tst.selfarray.d | 48 + .../test/tst/common/scalars/tst.selfarray2.d | 64 + .../dtrace/test/tst/common/scalars/tst.selfthis.d | 45 + .../cmd/dtrace/test/tst/common/scalars/tst.this.d | 43 + .../dtrace/test/tst/common/scalars/tst.thisself.d | 44 + .../cmd/dtrace/test/tst/common/sched/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/sched/tst.enqueue.d | 48 + .../cmd/dtrace/test/tst/common/sched/tst.oncpu.d | 54 + .../dtrace/test/tst/common/sched/tst.stackdepth.d | 41 + .../dtrace/test/tst/common/scripting/Makefile.kup | 0 .../scripting/err.D_MACRO_UNDEF.invalidargs.d | 43 + .../tst/common/scripting/err.D_OP_LVAL.rdonly.d | 43 + .../common/scripting/err.D_OP_WRITE.usepidmacro.d | 43 + .../tst/common/scripting/err.D_SYNTAX.concat.d | 45 + .../test/tst/common/scripting/err.D_SYNTAX.desc.d | 49 + .../test/tst/common/scripting/err.D_SYNTAX.inval.d | 43 + .../test/tst/common/scripting/err.D_SYNTAX.pid.d | 43 + .../scripting/tst.D_MACRO_UNUSED.overflow.ksh | 80 + .../dtrace/test/tst/common/scripting/tst.arg0.d | 43 + .../test/tst/common/scripting/tst.arguments.ksh | 90 + .../dtrace/test/tst/common/scripting/tst.assign.d | 43 + .../dtrace/test/tst/common/scripting/tst.basic.d | 42 + .../dtrace/test/tst/common/scripting/tst.egid.d | 43 + .../dtrace/test/tst/common/scripting/tst.egid.ksh | 97 + .../dtrace/test/tst/common/scripting/tst.euid.d | 44 + .../dtrace/test/tst/common/scripting/tst.euid.ksh | 86 + .../cmd/dtrace/test/tst/common/scripting/tst.gid.d | 43 + .../dtrace/test/tst/common/scripting/tst.gid.ksh | 86 + .../dtrace/test/tst/common/scripting/tst.pgid.d | 43 + .../cmd/dtrace/test/tst/common/scripting/tst.pid.d | 43 + .../dtrace/test/tst/common/scripting/tst.ppid.d | 43 + .../dtrace/test/tst/common/scripting/tst.ppid.ksh | 86 + .../dtrace/test/tst/common/scripting/tst.projid.d | 43 + .../test/tst/common/scripting/tst.projid.ksh | 86 + .../dtrace/test/tst/common/scripting/tst.quite.d | 42 + .../cmd/dtrace/test/tst/common/scripting/tst.sid.d | 43 + .../dtrace/test/tst/common/scripting/tst.sid.ksh | 86 + .../test/tst/common/scripting/tst.stringmacro.ksh | 78 + .../dtrace/test/tst/common/scripting/tst.taskid.d | 43 + .../test/tst/common/scripting/tst.taskid.ksh | 86 + .../dtrace/test/tst/common/scripting/tst.trace.d | 43 + .../cmd/dtrace/test/tst/common/scripting/tst.uid.d | 43 + .../dtrace/test/tst/common/scripting/tst.uid.ksh | 86 + .../cmd/dtrace/test/tst/common/sdt/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c | 45 + .../cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d | 67 + .../cmd/dtrace/test/tst/common/sizeof/Makefile.kup | 0 .../common/sizeof/err.D_IDENT_BADREF.SizeofAssoc.d | 51 + .../sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d | 42 + .../test/tst/common/sizeof/err.D_SIZEOF_TYPE.d | 41 + .../tst/common/sizeof/err.D_SYNTAX.SizeofBadType.d | 42 + .../test/tst/common/sizeof/tst.SizeofArray.d | 61 + .../test/tst/common/sizeof/tst.SizeofDataTypes.d | 122 + .../test/tst/common/sizeof/tst.SizeofExpression.d | 64 + .../dtrace/test/tst/common/sizeof/tst.SizeofNULL.d | 48 + .../test/tst/common/sizeof/tst.SizeofStrConst.d | 42 + .../tst/common/sizeof/tst.SizeofStrConst.d.out | 2 + .../test/tst/common/sizeof/tst.SizeofString1.d | 51 + .../test/tst/common/sizeof/tst.SizeofString1.d.out | 3 + .../test/tst/common/sizeof/tst.SizeofString2.d | 44 + .../test/tst/common/sizeof/tst.SizeofString2.d.out | 2 + .../test/tst/common/speculation/Makefile.kup | 0 .../speculation/bug.1001148.SpecSizeVariations.d | 87 + .../common/speculation/err.BufSizeVariations1.d | 88 + .../common/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 + .../speculation/err.D_ACT_SPEC.SpeculateWithStop.d | 68 + .../speculation/err.D_AGG_COMM.AggAftCommit.d | 40 + .../speculation/err.D_AGG_SPEC.SpeculateWithAvg.d | 67 + .../err.D_AGG_SPEC.SpeculateWithCount.d | 67 + .../err.D_AGG_SPEC.SpeculateWithLquant.d | 72 + .../speculation/err.D_AGG_SPEC.SpeculateWithMax.d | 62 + .../speculation/err.D_AGG_SPEC.SpeculateWithMin.d | 62 + .../err.D_AGG_SPEC.SpeculateWithQuant.d | 67 + .../err.D_AGG_SPEC.SpeculateWithStddev.d | 65 + .../speculation/err.D_AGG_SPEC.SpeculateWithSum.d | 62 + .../speculation/err.D_COMM_COMM.CommitAftCommit.d | 82 + .../speculation/err.D_COMM_COMM.DisjointCommit.d | 102 + .../speculation/err.D_COMM_DREC.CommitAftDataRec.d | 51 + .../speculation/err.D_DREC_COMM.DataRecAftCommit.d | 73 + .../speculation/err.D_DREC_COMM.ExitAfterCommit.d | 61 + .../speculation/err.D_EXIT_SPEC.ExitAftSpec.d | 70 + .../speculation/err.D_PRAGMA_MALFORM.NspecExpr.d | 77 + .../err.D_PRAGMA_OPTSET.HugeNspecValue.d | 76 + .../err.D_PRAGMA_OPTSET.InvalidSpecSize.d | 53 + .../speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d | 78 + .../common/speculation/err.D_PROTO_LEN.SpecNoId.d | 61 + .../speculation/err.D_SPEC_COMM.SpecAftCommit.d | 72 + .../speculation/err.D_SPEC_DREC.SpecAftDataRec.d | 70 + .../speculation/err.D_SPEC_SPEC.SpecAftSpec.d | 66 + .../tst/common/speculation/err.NegativeBufSize.d | 88 + .../tst/common/speculation/err.NegativeNspec.d | 48 + .../tst/common/speculation/err.NegativeSpecSize.d | 47 + .../common/speculation/err.SpecSizeVariations1.d | 78 + .../common/speculation/err.SpecSizeVariations2.d | 78 + .../common/speculation/tst.CommitAfterDiscard.d | 86 + .../tst/common/speculation/tst.CommitWithZero.d | 66 + .../tst/common/speculation/tst.DataRecAftDiscard.d | 77 + .../tst/common/speculation/tst.DiscardAftCommit.d | 85 + .../tst/common/speculation/tst.DiscardAftDataRec.d | 50 + .../tst/common/speculation/tst.DiscardAftDiscard.d | 85 + .../tst/common/speculation/tst.DiscardWithZero.d | 67 + .../tst/common/speculation/tst.ExitAftDiscard.d | 56 + .../test/tst/common/speculation/tst.NoSpecBuffer.d | 64 + .../common/speculation/tst.SpecSizeVariations1.d | 78 + .../common/speculation/tst.SpecSizeVariations2.d | 78 + .../common/speculation/tst.SpecSizeVariations3.d | 78 + .../common/speculation/tst.SpeculateWithRandom.d | 59 + .../tst/common/speculation/tst.SpeculationCommit.d | 75 + .../common/speculation/tst.SpeculationDiscard.d | 74 + .../tst/common/speculation/tst.SpeculationID.d | 50 + .../common/speculation/tst.SpeculationWithZero.d | 65 + .../tst/common/speculation/tst.TwoSpecBuffers.d | 77 + .../test/tst/common/speculation/tst.negcommit.d | 37 + .../test/tst/common/speculation/tst.negspec.d | 37 + .../test/tst/common/speculation/tst.zerosize.d | 53 + .../dtrace/test/tst/common/stability/Makefile.kup | 0 .../stability/err.D_ATTR_MIN.MinAttributes.d | 50 + .../cmd/dtrace/test/tst/common/stack/Makefile.kup | 0 .../test/tst/common/stack/err.D_STACK_PROTO.bad.d | 43 + .../test/tst/common/stack/err.D_STACK_SIZE.d | 40 + .../tst/common/stack/err.D_USTACK_FRAMES.bad.d | 44 + .../test/tst/common/stack/err.D_USTACK_PROTO.bad.d | 44 + .../tst/common/stack/err.D_USTACK_STRSIZE.bad.d | 44 + .../cmd/dtrace/test/tst/common/stack/tst.default.d | 41 + .../dtrace/test/tst/common/stackdepth/Makefile.kup | 0 .../test/tst/common/stackdepth/tst.default.d | 41 + .../cmd/dtrace/test/tst/common/stop/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/stop/tst.stop1.c | 37 + .../cmd/dtrace/test/tst/common/stop/tst.stop1.d | 78 + .../cmd/dtrace/test/tst/common/stop/tst.stop2.c | 37 + .../cmd/dtrace/test/tst/common/stop/tst.stop2.d | 78 + .../cmd/dtrace/test/tst/common/strlen/Makefile.kup | 0 .../dtrace/test/tst/common/strlen/tst.strlen1.d | 46 + .../cmd/dtrace/test/tst/common/struct/Makefile.kup | 0 .../common/struct/err.D_ADDROF_VAR.StructPointer.d | 59 + .../struct/err.D_DECL_COMBO.StructWithoutColon.d | 74 + .../struct/err.D_DECL_COMBO.StructWithoutColon1.d | 68 + .../common/struct/err.D_DECL_INCOMPLETE.circular.d | 66 + .../common/struct/err.D_DECL_INCOMPLETE.order.d | 69 + .../common/struct/err.D_DECL_INCOMPLETE.order2.d | 108 + .../struct/err.D_DECL_INCOMPLETE.recursive.d | 59 + .../common/struct/err.D_DECL_INCOMPLETE.simple.d | 59 + .../tst/common/struct/err.D_DECL_VOIDOBJ.baddec.d | 46 + .../common/struct/err.D_PROTO_ARG.DupStructAssoc.d | 80 + .../test/tst/common/struct/tst.StructAssoc.d | 71 + .../test/tst/common/struct/tst.StructDataTypes.d | 133 + .../test/tst/common/struct/tst.StructInside.d | 124 + .../test/tst/common/struct/tst.clauselocal.d | 52 + .../test/tst/common/struct/tst.clauselocal.d.out | 2 + .../dtrace/test/tst/common/syscall/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/syscall/tst.args.c | 41 + .../cmd/dtrace/test/tst/common/syscall/tst.args.d | 46 + .../dtrace/test/tst/common/syscall/tst.openret.ksh | 75 + .../dtrace/test/tst/common/sysevent/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/sysevent/tst.post.c | 45 + .../cmd/dtrace/test/tst/common/sysevent/tst.post.d | 88 + .../test/tst/common/sysevent/tst.post_chan.c | 49 + .../test/tst/common/sysevent/tst.post_chan.d | 87 + .../cmd/dtrace/test/tst/common/tick-n/Makefile.kup | 0 .../test/tst/common/tick-n/err.D_PDESC_ZERO.tick.d | 45 + .../test/tst/common/tick-n/err.D_PDESC_ZEROonens.d | 44 + .../tst/common/tick-n/err.D_PDESC_ZEROonensec.d | 44 + .../test/tst/common/tick-n/err.D_PDESC_ZEROoneus.d | 44 + .../tst/common/tick-n/err.D_PDESC_ZEROoneusec.d | 44 + .../dtrace/test/tst/common/tick-n/tst.tickarg0.d | 45 + .../cmd/dtrace/test/tst/common/tick-n/tst.tickms.d | 45 + .../dtrace/test/tst/common/tick-n/tst.tickms.d.out | 2 + .../dtrace/test/tst/common/tick-n/tst.tickmsec.d | 45 + .../test/tst/common/tick-n/tst.tickmsec.d.out | 2 + .../cmd/dtrace/test/tst/common/tick-n/tst.tickns.d | 45 + .../dtrace/test/tst/common/tick-n/tst.tickns.d.out | 2 + .../dtrace/test/tst/common/tick-n/tst.ticknsec.d | 45 + .../test/tst/common/tick-n/tst.ticknsec.d.out | 2 + .../cmd/dtrace/test/tst/common/tick-n/tst.ticks.d | 45 + .../dtrace/test/tst/common/tick-n/tst.ticks.d.out | 2 + .../dtrace/test/tst/common/tick-n/tst.ticksec.d | 49 + .../test/tst/common/tick-n/tst.ticksec.d.out | 2 + .../cmd/dtrace/test/tst/common/tick-n/tst.tickus.d | 45 + .../dtrace/test/tst/common/tick-n/tst.tickus.d.out | 2 + .../dtrace/test/tst/common/tick-n/tst.tickusec.d | 45 + .../test/tst/common/tick-n/tst.tickusec.d.out | 2 + .../cmd/dtrace/test/tst/common/trace/Makefile.kup | 0 .../test/tst/common/trace/err.D_PROTO_LEN.bad.d | 41 + .../test/tst/common/trace/err.D_TRACE_VOID.bad.d | 39 + .../cmd/dtrace/test/tst/common/trace/tst.misc.d | 63 + .../cmd/dtrace/test/tst/common/trace/tst.qstring.d | 48 + .../dtrace/test/tst/common/trace/tst.qstring.d.out | 3 + .../cmd/dtrace/test/tst/common/trace/tst.string.d | 43 + .../dtrace/test/tst/common/tracemem/Makefile.kup | 0 .../tst/common/tracemem/err.D_PROTO_ARG.badsize.d | 39 + .../tst/common/tracemem/err.D_PROTO_LEN.toofew.d | 40 + .../tst/common/tracemem/err.D_PROTO_LEN.toomany.d | 39 + .../common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d | 39 + .../common/tracemem/err.D_TRACEMEM_SIZE.negsize.d | 39 + .../common/tracemem/err.D_TRACEMEM_SIZE.zerosize.d | 39 + .../dtrace/test/tst/common/tracemem/tst.rootvp.d | 54 + .../test/tst/common/translators/Makefile.kup | 0 .../translators/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 + .../translators/err.D_XLATE_NONE.BadTransDecl6.d | 72 + .../err.D_XLATE_REDECL.RepeatTransDecl.d | 67 + .../translators/err.D_XLATE_SOU.BadTransDecl8.d | 58 + .../translators/err.D_XLATE_SOU.BadTransInt.d | 52 + .../err.D_XLATE_SOU.NonExistentOutput1.d | 55 + .../common/translators/man.TestTransStability.d | 61 + .../tst/common/translators/tst.CircularTransDecl.d | 100 + .../tst/common/translators/tst.EmptyTransDecl.d | 79 + .../test/tst/common/translators/tst.ForwardTag.d | 60 + .../tst/common/translators/tst.InputAliasTrans.d | 60 + .../tst/common/translators/tst.InputIntTrans.d | 60 + .../tst/common/translators/tst.OutputAliasTrans.d | 63 + .../common/translators/tst.PartialDereferencing.d | 85 + .../translators/tst.PartialOutputTransDefn.d | 60 + .../tst/common/translators/tst.ProcModelTrans.d | 53 + .../tst/common/translators/tst.RepeatDeclaration.d | 71 + .../translators/tst.SimultaneousTranslators.d | 71 + .../common/translators/tst.StructureAssignment.d | 85 + .../tst/common/translators/tst.TransNonPointer.d | 84 + .../common/translators/tst.TransOutputPointer.d | 80 + .../test/tst/common/translators/tst.TransPointer.d | 63 + .../tst/common/translators/tst.TranslateSelf.d | 76 + .../tst/common/translators/tst.UnionInputTrans.d | 61 + .../tst/common/translators/tst.UnionOutputTrans.d | 61 + .../dtrace/test/tst/common/typedef/Makefile.kup | 0 .../common/typedef/err.D_DECL_IDRED.DupTypeDef.d | 51 + .../typedef/err.D_SYNTAX.BadExistingTypedef.d | 45 + .../common/typedef/err.D_SYNTAX.TypedefInClause.d | 43 + .../test/tst/common/typedef/tst.ChainTypedef.d | 48 + .../tst/common/typedef/tst.TypedefDataAssign.d | 118 + .../cmd/dtrace/test/tst/common/types/Makefile.kup | 0 .../tst/common/types/err.D_CAST_INVAL.badcast.d | 45 + .../tst/common/types/err.D_CG_DYN.ResultDynType.d | 47 + .../tst/common/types/err.D_CHR_OFLOW.charconst.d | 46 + .../tst/common/types/err.D_DECL_BADCLASS.bad.d | 43 + .../common/types/err.D_DECL_CHARATTR.badtype3.d | 44 + .../tst/common/types/err.D_DECL_COMBO.badtype4.d | 44 + .../tst/common/types/err.D_DECL_COMBO.badtype5.d | 44 + .../tst/common/types/err.D_DECL_ENCONST.badeval.d | 39 + .../tst/common/types/err.D_DECL_ENOFLOW.enoflow.d | 38 + .../tst/common/types/err.D_DECL_ENOFLOW.enuflow.d | 39 + .../tst/common/types/err.D_DECL_SCOPE.scopeop.d | 46 + .../tst/common/types/err.D_DECL_USELESS.baddec.d | 43 + .../test/tst/common/types/err.D_OP_ACT.badcond.d | 46 + .../tst/common/types/err.D_OP_ARITH.badoperand.d | 44 + .../tst/common/types/err.D_OP_INCOMPAT.badassign.d | 44 + .../test/tst/common/types/err.D_OP_INT.badbitop.d | 43 + .../test/tst/common/types/err.D_OP_INT.badshift.d | 43 + .../tst/common/types/err.D_OP_SCALAR.badcond.d | 44 + .../tst/common/types/err.D_OP_SCALAR.badincop.d | 44 + .../tst/common/types/err.D_OP_SCALAR.badlogop.d | 43 + .../tst/common/types/err.D_PROTO_LEN.badcond1.d | 45 + .../test/tst/common/types/err.D_SYNTAX.badenum.d | 40 + .../test/tst/common/types/err.D_SYNTAX.badid.d | 46 + .../test/tst/common/types/err.D_SYNTAX.badstruct.d | 38 + .../test/tst/common/types/err.D_UNKNOWN.badtype1.d | 44 + .../test/tst/common/types/err.D_UNKNOWN.badtype2.d | 44 + .../test/tst/common/types/err.D_UNKNOWN.dupenum.d | 39 + .../tst/common/types/err.D_UNKNOWN.dupstruct.d | 39 + .../types/err.D_XLATE_REDECL.ResultDynType.d | 48 + .../dtrace/test/tst/common/types/tst.assignops.d | 82 + .../dtrace/test/tst/common/types/tst.badshiftops.d | 49 + .../cmd/dtrace/test/tst/common/types/tst.basics.d | 59 + .../dtrace/test/tst/common/types/tst.basics.d.out | 16 + .../cmd/dtrace/test/tst/common/types/tst.bitops.d | 62 + .../test/tst/common/types/tst.charconstants.d | 68 + .../cmd/dtrace/test/tst/common/types/tst.complex.d | 74 + .../dtrace/test/tst/common/types/tst.condexpr.d | 61 + .../dtrace/test/tst/common/types/tst.constants.d | 52 + .../cmd/dtrace/test/tst/common/types/tst.conv.d | 109 + .../cmd/dtrace/test/tst/common/types/tst.enum.d | 51 + .../dtrace/test/tst/common/types/tst.intincop.d | 70 + .../cmd/dtrace/test/tst/common/types/tst.intops.d | 70 + .../dtrace/test/tst/common/types/tst.inttypes.d | 52 + .../dtrace/test/tst/common/types/tst.ptrincop.d | 72 + .../cmd/dtrace/test/tst/common/types/tst.ptrops.d | 71 + .../cmd/dtrace/test/tst/common/types/tst.relenum.d | 73 + .../dtrace/test/tst/common/types/tst.relstring.d | 70 + .../dtrace/test/tst/common/types/tst.shiftops.d | 62 + .../test/tst/common/types/tst.stringconstants.d | 51 + .../cmd/dtrace/test/tst/common/types/tst.struct.d | 84 + .../cmd/dtrace/test/tst/common/types/tst.typedef.d | 85 + .../cmd/dtrace/test/tst/common/types/tst.unaryop.d | 50 + .../cmd/dtrace/test/tst/common/union/Makefile.kup | 0 .../common/union/err.D_ADDROF_VAR.UnionPointer.d | 60 + .../union/err.D_DECL_COMBO.UnionWithoutColon.d | 69 + .../union/err.D_DECL_COMBO.UnionWithoutColon1.d | 68 + .../common/union/err.D_DECL_INCOMPLETE.circular.d | 65 + .../tst/common/union/err.D_DECL_INCOMPLETE.order.d | 69 + .../common/union/err.D_DECL_INCOMPLETE.recursive.d | 59 + .../common/union/err.D_DECL_INCOMPLETE.simple.d | 58 + .../common/union/err.D_PROTO_ARG.DupUnionAssoc.d | 80 + .../dtrace/test/tst/common/union/tst.UnionAssoc.d | 71 + .../test/tst/common/union/tst.UnionDataTypes.d | 132 + .../dtrace/test/tst/common/union/tst.UnionInside.d | 85 + .../cmd/dtrace/test/tst/common/usdt/Makefile.kup | 0 .../onnv/cmd/dtrace/test/tst/common/usdt/argmap.d | 31 + .../onnv/cmd/dtrace/test/tst/common/usdt/args.d | 31 + .../onnv/cmd/dtrace/test/tst/common/usdt/forker.d | 31 + .../cmd/dtrace/test/tst/common/usdt/tst.andpid.ksh | 46 + .../cmd/dtrace/test/tst/common/usdt/tst.argmap.c | 39 + .../cmd/dtrace/test/tst/common/usdt/tst.argmap.d | 65 + .../cmd/dtrace/test/tst/common/usdt/tst.args.c | 39 + .../cmd/dtrace/test/tst/common/usdt/tst.args.d | 60 + .../dtrace/test/tst/common/usdt/tst.badguess.ksh | 84 + .../dtrace/test/tst/common/usdt/tst.corruptenv.ksh | 107 + .../dtrace/test/tst/common/usdt/tst.dlclose1.ksh | 159 + .../test/tst/common/usdt/tst.dlclose1.ksh.out | 3 + .../dtrace/test/tst/common/usdt/tst.dlclose2.ksh | 160 + .../test/tst/common/usdt/tst.dlclose2.ksh.out | 2 + .../dtrace/test/tst/common/usdt/tst.dlclose3.ksh | 170 + .../dtrace/test/tst/common/usdt/tst.eliminate.ksh | 106 + .../dtrace/test/tst/common/usdt/tst.enabled.ksh | 96 + .../test/tst/common/usdt/tst.enabled.ksh.out | 2 + .../dtrace/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 + .../test/tst/common/usdt/tst.entryreturn.ksh.out | 10 + .../cmd/dtrace/test/tst/common/usdt/tst.fork.ksh | 105 + .../dtrace/test/tst/common/usdt/tst.fork.ksh.out | 4 + .../cmd/dtrace/test/tst/common/usdt/tst.forker.c | 47 + .../cmd/dtrace/test/tst/common/usdt/tst.forker.ksh | 55 + .../dtrace/test/tst/common/usdt/tst.guess32.ksh | 96 + .../dtrace/test/tst/common/usdt/tst.guess64.ksh | 100 + .../cmd/dtrace/test/tst/common/usdt/tst.header.ksh | 85 + .../dtrace/test/tst/common/usdt/tst.include.ksh | 61 + .../dtrace/test/tst/common/usdt/tst.linkpriv.ksh | 82 + .../dtrace/test/tst/common/usdt/tst.linkunpriv.ksh | 84 + .../dtrace/test/tst/common/usdt/tst.multiple.ksh | 99 + .../test/tst/common/usdt/tst.multiple.ksh.out | 5 + .../dtrace/test/tst/common/usdt/tst.nodtrace.ksh | 90 + .../test/tst/common/usdt/tst.onlyenabled.ksh | 82 + .../cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh | 98 + .../cmd/dtrace/test/tst/common/usdt/tst.static.ksh | 98 + .../dtrace/test/tst/common/usdt/tst.static.ksh.out | 5 + .../dtrace/test/tst/common/usdt/tst.static2.ksh | 108 + .../test/tst/common/usdt/tst.static2.ksh.out | 5 + .../cmd/dtrace/test/tst/common/usdt/tst.user.ksh | 96 + .../dtrace/test/tst/common/usdt/tst.user.ksh.out | 2 + .../cmd/dtrace/test/tst/common/ustack/Makefile.kup | 0 .../dtrace/test/tst/common/ustack/tst.bigstack.c | 61 + .../dtrace/test/tst/common/ustack/tst.bigstack.d | 45 + .../dtrace/test/tst/common/ustack/tst.depth.ksh | 110 + .../cmd/dtrace/test/tst/common/ustack/tst.spin.c | 61 + .../cmd/dtrace/test/tst/common/ustack/tst.spin.ksh | 139 + .../cmd/dtrace/test/tst/common/vars/Makefile.kup | 0 .../onnv/cmd/dtrace/test/tst/common/vars/tst.gid.d | 41 + .../dtrace/test/tst/common/vars/tst.nullassign.d | 94 + .../cmd/dtrace/test/tst/common/vars/tst.ppid.d | 41 + .../dtrace/test/tst/common/vars/tst.ucaller.ksh | 65 + .../test/tst/common/vars/tst.ucaller.ksh.out | 3 + .../onnv/cmd/dtrace/test/tst/common/vars/tst.uid.d | 41 + .../test/tst/common/vars/tst.walltimestamp.d | 55 + .../dtrace/test/tst/common/version/Makefile.kup | 0 .../cmd/dtrace/test/tst/common/version/tst.1.0.d | 48 + .../onnv/cmd/dtrace/test/tst/i386/Makefile | 51 + .../onnv/cmd/dtrace/test/tst/i386/Makefile.kup | 0 .../cmd/dtrace/test/tst/i386/arrays/Makefile.kup | 0 .../dtrace/test/tst/i386/arrays/tst.uregsarray.d | 63 + .../cmd/dtrace/test/tst/i386/funcs/Makefile.kup | 0 .../cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d | 52 + .../dtrace/test/tst/i386/funcs/tst.badcopyinstr.d | 52 + .../dtrace/test/tst/i386/funcs/tst.badcopyout.d | 56 + .../dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d | 56 + .../onnv/cmd/dtrace/test/tst/i386/pid/Makefile.kup | 0 .../cmd/dtrace/test/tst/i386/pid/tst.badinstr.d | 40 + .../cmd/dtrace/test/tst/i386/pid/tst.badinstr.s | 41 + .../onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.d | 78 + .../onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.s | 73 + .../cmd/dtrace/test/tst/i386/pid/tst.embedded.d | 73 + .../cmd/dtrace/test/tst/i386/pid/tst.embedded.s | 68 + .../onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.d | 76 + .../onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.s | 114 + .../cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh | 50 + .../cmd/dtrace/test/tst/i386/pid/tst.retlist.s | 51 + .../cmd/dtrace/test/tst/i386/ustack/Makefile.kup | 0 .../dtrace/test/tst/i386/ustack/annotated_helper.d | 32 + .../dtrace/test/tst/i386/ustack/helper_helper.d | 32 + .../dtrace/test/tst/i386/ustack/tst.annotated.c | 43 + .../dtrace/test/tst/i386/ustack/tst.annotated.d | 35 + .../test/tst/i386/ustack/tst.annotated.d.out | 4 + .../dtrace/test/tst/i386/ustack/tst.circstack.d | 46 + .../dtrace/test/tst/i386/ustack/tst.circstack.s | 43 + .../cmd/dtrace/test/tst/i386/ustack/tst.helper.c | 82 + .../cmd/dtrace/test/tst/i386/ustack/tst.helper.d | 44 + .../dtrace/test/tst/i386/ustack/tst.helper.d.out | 4 + .../onnv/cmd/dtrace/test/tst/i86xpv/Makefile | 29 + .../onnv/cmd/dtrace/test/tst/i86xpv/Makefile.kup | 0 .../cmd/dtrace/test/tst/i86xpv/xdt/Makefile.kup | 0 .../cmd/dtrace/test/tst/i86xpv/xdt/tst.basic.ksh | 77 + .../dtrace/test/tst/i86xpv/xdt/tst.hvmenable.ksh | 64 + .../dtrace/test/tst/i86xpv/xdt/tst.memenable.ksh | 65 + .../dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh | 121 + .../dtrace/test/tst/i86xpv/xdt/tst.schedenable.ksh | 74 + .../onnv/cmd/dtrace/test/tst/sparc/Makefile | 51 + .../onnv/cmd/dtrace/test/tst/sparc/Makefile.kup | 0 .../cmd/dtrace/test/tst/sparc/arrays/Makefile.kup | 0 .../dtrace/test/tst/sparc/arrays/tst.uregsarray.d | 85 + .../cmd/dtrace/test/tst/sparc/pid/Makefile.kup | 0 .../tst/sparc/pid/err.D_PROC_ALIGN.misaligned.d | 40 + .../tst/sparc/pid/err.D_PROC_ALIGN.misaligned.exe | 29 + .../onnv/cmd/dtrace/test/tst/sparc/pid/tst.br.d | 70 + .../cmd/dtrace/test/tst/sparc/pid/tst.br.d.out | 23 + .../onnv/cmd/dtrace/test/tst/sparc/pid/tst.br.s | 81 + .../cmd/dtrace/test/tst/sparc/pid/tst.branch.d | 78 + .../cmd/dtrace/test/tst/sparc/pid/tst.branch.s | 63 + .../cmd/dtrace/test/tst/sparc/pid/tst.embedded.d | 73 + .../cmd/dtrace/test/tst/sparc/pid/tst.embedded.s | 59 + .../cmd/dtrace/test/tst/sparc/usdt/Makefile.kup | 0 .../dtrace/test/tst/sparc/usdt/tst.tailcall.ksh | 132 + .../cmd/dtrace/test/tst/sparc/ustack/Makefile.kup | 0 .../test/tst/sparc/ustack/annotated_helper.d | 32 + .../dtrace/test/tst/sparc/ustack/helper_helper.d | 32 + .../dtrace/test/tst/sparc/ustack/tst.annotated.c | 43 + .../dtrace/test/tst/sparc/ustack/tst.annotated.d | 35 + .../test/tst/sparc/ustack/tst.annotated.d.out | 4 + .../dtrace/test/tst/sparc/ustack/tst.circstack.d | 46 + .../dtrace/test/tst/sparc/ustack/tst.circstack.s | 44 + .../cmd/dtrace/test/tst/sparc/ustack/tst.helper.c | 81 + .../cmd/dtrace/test/tst/sparc/ustack/tst.helper.d | 44 + .../dtrace/test/tst/sparc/ustack/tst.helper.d.out | 4 + .../dtrace/test/tst/sparc/ustack/tst.trapstat.ksh | 87 + .../ExtPacks/VBoxDTrace/onnv/common/Makefile.kup | 0 .../VBoxDTrace/onnv/common/ctf/Makefile.kup | 0 .../VBoxDTrace/onnv/common/ctf/ctf_create.c | 1370 ++ .../ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_decl.c | 190 + .../VBoxDTrace/onnv/common/ctf/ctf_error.c | 99 + .../ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_hash.c | 180 + .../ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_impl.h | 353 + .../VBoxDTrace/onnv/common/ctf/ctf_labels.c | 158 + .../VBoxDTrace/onnv/common/ctf/ctf_lookup.c | 322 + .../ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_open.c | 972 ++ .../VBoxDTrace/onnv/common/ctf/ctf_types.c | 847 + .../ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_util.c | 154 + .../VBoxDTrace/onnv/common/dtrace/Makefile.kup | 0 .../VBoxDTrace/onnv/common/dtrace/dtrace_data.c | 113 + src/VBox/ExtPacks/VBoxDTrace/onnv/lib/Makefile.kup | 0 .../ExtPacks/VBoxDTrace/onnv/lib/libctf/Makefile | 55 + .../VBoxDTrace/onnv/lib/libctf/Makefile.com | 72 + .../VBoxDTrace/onnv/lib/libctf/Makefile.kup | 0 .../VBoxDTrace/onnv/lib/libctf/amd64/Makefile | 31 + .../VBoxDTrace/onnv/lib/libctf/common/Makefile.kup | 0 .../VBoxDTrace/onnv/lib/libctf/common/ctf_lib.c | 596 + .../VBoxDTrace/onnv/lib/libctf/common/ctf_subr.c | 119 + .../VBoxDTrace/onnv/lib/libctf/common/libctf.h | 66 + .../VBoxDTrace/onnv/lib/libctf/common/llib-lctf | 32 + .../VBoxDTrace/onnv/lib/libctf/common/mapfile-vers | 114 + .../VBoxDTrace/onnv/lib/libctf/i386/Makefile | 30 + .../VBoxDTrace/onnv/lib/libctf/sparc/Makefile | 30 + .../VBoxDTrace/onnv/lib/libctf/sparcv9/Makefile | 31 + .../VBoxDTrace/onnv/lib/libdtrace/Makefile | 63 + .../VBoxDTrace/onnv/lib/libdtrace/Makefile.com | 233 + .../VBoxDTrace/onnv/lib/libdtrace/Makefile.kup | 0 .../VBoxDTrace/onnv/lib/libdtrace/amd64/Makefile | 46 + .../onnv/lib/libdtrace/amd64/Makefile.kup | 0 .../onnv/lib/libdtrace/common/Makefile.kup | 0 .../VBoxDTrace/onnv/lib/libdtrace/common/drti.c | 190 + .../onnv/lib/libdtrace/common/dt_aggregate.c | 1917 +++ .../VBoxDTrace/onnv/lib/libdtrace/common/dt_as.c | 507 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_as.h | 66 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_buf.c | 181 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_buf.h | 71 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_cc.c | 2321 +++ .../VBoxDTrace/onnv/lib/libdtrace/common/dt_cg.c | 1973 +++ .../onnv/lib/libdtrace/common/dt_consume.c | 2342 +++ .../VBoxDTrace/onnv/lib/libdtrace/common/dt_decl.c | 1130 ++ .../VBoxDTrace/onnv/lib/libdtrace/common/dt_decl.h | 128 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_dis.c | 524 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_dof.c | 969 ++ .../VBoxDTrace/onnv/lib/libdtrace/common/dt_dof.h | 68 + .../onnv/lib/libdtrace/common/dt_error.c | 219 + .../onnv/lib/libdtrace/common/dt_errtags.h | 249 + .../onnv/lib/libdtrace/common/dt_grammar.y | 846 + .../onnv/lib/libdtrace/common/dt_handle.c | 483 + .../onnv/lib/libdtrace/common/dt_ident.c | 1049 ++ .../onnv/lib/libdtrace/common/dt_ident.h | 185 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_impl.h | 669 + .../onnv/lib/libdtrace/common/dt_inttab.c | 117 + .../onnv/lib/libdtrace/common/dt_inttab.h | 71 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_lex.l | 931 ++ .../VBoxDTrace/onnv/lib/libdtrace/common/dt_link.c | 1634 ++ .../VBoxDTrace/onnv/lib/libdtrace/common/dt_list.c | 117 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_list.h | 57 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_map.c | 428 + .../onnv/lib/libdtrace/common/dt_module.c | 1348 ++ .../onnv/lib/libdtrace/common/dt_module.h | 58 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_open.c | 1500 ++ .../onnv/lib/libdtrace/common/dt_options.c | 1118 ++ .../onnv/lib/libdtrace/common/dt_parser.c | 4907 ++++++ .../onnv/lib/libdtrace/common/dt_parser.h | 290 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_pcb.c | 193 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_pcb.h | 105 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_pid.c | 757 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_pid.h | 66 + .../onnv/lib/libdtrace/common/dt_pragma.c | 509 + .../onnv/lib/libdtrace/common/dt_printf.c | 2057 +++ .../onnv/lib/libdtrace/common/dt_printf.h | 137 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_proc.c | 1111 ++ .../VBoxDTrace/onnv/lib/libdtrace/common/dt_proc.h | 136 + .../onnv/lib/libdtrace/common/dt_program.c | 622 + .../onnv/lib/libdtrace/common/dt_program.h | 65 + .../onnv/lib/libdtrace/common/dt_provider.c | 890 + .../onnv/lib/libdtrace/common/dt_provider.h | 120 + .../onnv/lib/libdtrace/common/dt_regset.c | 112 + .../onnv/lib/libdtrace/common/dt_regset.h | 57 + .../onnv/lib/libdtrace/common/dt_string.c | 348 + .../onnv/lib/libdtrace/common/dt_string.h | 51 + .../onnv/lib/libdtrace/common/dt_strtab.c | 295 + .../onnv/lib/libdtrace/common/dt_strtab.h | 76 + .../VBoxDTrace/onnv/lib/libdtrace/common/dt_subr.c | 1028 ++ .../VBoxDTrace/onnv/lib/libdtrace/common/dt_work.c | 322 + .../onnv/lib/libdtrace/common/dt_xlator.c | 390 + .../onnv/lib/libdtrace/common/dt_xlator.h | 89 + .../VBoxDTrace/onnv/lib/libdtrace/common/dtrace.h | 595 + .../VBoxDTrace/onnv/lib/libdtrace/common/fc.d | 183 + .../VBoxDTrace/onnv/lib/libdtrace/common/io.d.in | 218 + .../VBoxDTrace/onnv/lib/libdtrace/common/io.sed.in | 69 + .../VBoxDTrace/onnv/lib/libdtrace/common/ip.d.in | 374 + .../VBoxDTrace/onnv/lib/libdtrace/common/ip.sed.in | 78 + .../VBoxDTrace/onnv/lib/libdtrace/common/iscsit.d | 454 + .../onnv/lib/libdtrace/common/llib-ldtrace | 32 + .../onnv/lib/libdtrace/common/mapfile-vers | 127 + .../onnv/lib/libdtrace/common/mkerrno.sh | 40 + .../onnv/lib/libdtrace/common/mkerrtags.sed | 33 + .../onnv/lib/libdtrace/common/mkerrtags.sh | 61 + .../onnv/lib/libdtrace/common/mknames.sed | 38 + .../onnv/lib/libdtrace/common/mknames.sh | 53 + .../onnv/lib/libdtrace/common/mksignal.sh | 40 + .../VBoxDTrace/onnv/lib/libdtrace/common/net.d.in | 44 + .../onnv/lib/libdtrace/common/net.sed.in | 41 + .../VBoxDTrace/onnv/lib/libdtrace/common/nfs.d | 138 + .../onnv/lib/libdtrace/common/procfs.d.in | 365 + .../onnv/lib/libdtrace/common/procfs.sed.in | 163 + .../VBoxDTrace/onnv/lib/libdtrace/common/sched.d | 82 + .../VBoxDTrace/onnv/lib/libdtrace/common/scsi.d | 89 + .../VBoxDTrace/onnv/lib/libdtrace/common/srp.d | 168 + .../onnv/lib/libdtrace/common/sysevent.d.in | 50 + .../onnv/lib/libdtrace/common/sysevent.sed.in | 34 + .../VBoxDTrace/onnv/lib/libdtrace/common/tcp.d.in | 269 + .../onnv/lib/libdtrace/common/tcp.sed.in | 53 + .../VBoxDTrace/onnv/lib/libdtrace/common/udp.d.in | 73 + .../onnv/lib/libdtrace/common/udp.sed.in | 29 + .../VBoxDTrace/onnv/lib/libdtrace/common/unistd.d | 56 + .../VBoxDTrace/onnv/lib/libdtrace/i386/Makefile | 54 + .../onnv/lib/libdtrace/i386/Makefile.kup | 0 .../VBoxDTrace/onnv/lib/libdtrace/i386/dt_isadep.c | 488 + .../VBoxDTrace/onnv/lib/libdtrace/i386/regs.d.in | 117 + .../VBoxDTrace/onnv/lib/libdtrace/i386/regs.sed.in | 82 + .../VBoxDTrace/onnv/lib/libdtrace/sparc/Makefile | 33 + .../onnv/lib/libdtrace/sparc/Makefile.kup | 0 .../onnv/lib/libdtrace/sparc/dt_isadep.c | 338 + .../VBoxDTrace/onnv/lib/libdtrace/sparc/regs.d | 120 + .../VBoxDTrace/onnv/lib/libdtrace/sparcv9/Makefile | 36 + .../onnv/lib/libdtrace/sparcv9/Makefile.kup | 0 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/Makefile.kup | 0 .../VBoxDTrace/onnv/uts/common/Makefile.kup | 0 .../VBoxDTrace/onnv/uts/common/dtrace/Makefile.kup | 0 .../VBoxDTrace/onnv/uts/common/dtrace/dcpc.c | 1214 ++ .../VBoxDTrace/onnv/uts/common/dtrace/dcpc.conf | 33 + .../VBoxDTrace/onnv/uts/common/dtrace/dtrace.c | 16292 +++++++++++++++++++ .../VBoxDTrace/onnv/uts/common/dtrace/dtrace.conf | 28 + .../VBoxDTrace/onnv/uts/common/dtrace/fasttrap.c | 2378 +++ .../VBoxDTrace/onnv/uts/common/dtrace/lockstat.c | 343 + .../onnv/uts/common/dtrace/lockstat.conf | 28 + .../VBoxDTrace/onnv/uts/common/dtrace/profile.c | 577 + .../VBoxDTrace/onnv/uts/common/dtrace/profile.conf | 28 + .../VBoxDTrace/onnv/uts/common/dtrace/sdt_subr.c | 1191 ++ .../VBoxDTrace/onnv/uts/common/dtrace/systrace.c | 374 + .../onnv/uts/common/dtrace/systrace.conf | 28 + .../VBoxDTrace/onnv/uts/common/os/Makefile.kup | 0 .../VBoxDTrace/onnv/uts/common/os/dtrace_subr.c | 337 + .../VBoxDTrace/onnv/uts/common/sys/Makefile.kup | 0 .../ExtPacks/VBoxDTrace/onnv/uts/common/sys/ctf.h | 364 + .../VBoxDTrace/onnv/uts/common/sys/ctf_api.h | 251 + .../VBoxDTrace/onnv/uts/common/sys/dtrace.h | 2276 +++ .../VBoxDTrace/onnv/uts/common/sys/dtrace_impl.h | 1304 ++ .../VBoxDTrace/onnv/uts/i86pc/Makefile.kup | 0 .../VBoxDTrace/onnv/uts/i86pc/os/Makefile.kup | 0 .../VBoxDTrace/onnv/uts/i86pc/os/dtrace_subr.c | 400 + .../VBoxDTrace/onnv/uts/intel/Makefile.kup | 0 .../VBoxDTrace/onnv/uts/intel/dtrace/Makefile | 76 + .../VBoxDTrace/onnv/uts/intel/dtrace/Makefile.kup | 0 .../VBoxDTrace/onnv/uts/intel/dtrace/dtrace_asm.s | 457 + .../VBoxDTrace/onnv/uts/intel/dtrace/dtrace_isa.c | 746 + .../VBoxDTrace/onnv/uts/intel/dtrace/fasttrap.conf | 39 + .../onnv/uts/intel/dtrace/fasttrap_isa.c | 1745 ++ .../VBoxDTrace/onnv/uts/intel/dtrace/fbt.c | 849 + .../VBoxDTrace/onnv/uts/intel/dtrace/fbt.conf | 28 + .../VBoxDTrace/onnv/uts/intel/dtrace/sdt.c | 557 + .../VBoxDTrace/onnv/uts/intel/dtrace/sdt.conf | 28 + src/VBox/ExtPacks/VNC/ExtPack.xml | 10 + src/VBox/ExtPacks/VNC/Makefile.kmk | 174 + src/VBox/ExtPacks/VNC/VBoxVNC.cpp | 1373 ++ src/VBox/ExtPacks/VNC/VBoxVNCMain.cpp | 127 + 1956 files changed, 193681 insertions(+) create mode 100644 src/VBox/ExtPacks/.scm-settings create mode 100644 src/VBox/ExtPacks/BusMouseSample/.scm-settings create mode 100644 src/VBox/ExtPacks/BusMouseSample/DevBusMouse.cpp create mode 100644 src/VBox/ExtPacks/BusMouseSample/ExtPack.xml create mode 100644 src/VBox/ExtPacks/BusMouseSample/Makefile.kmk create mode 100644 src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp create mode 100644 src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMainVM.cpp create mode 100644 src/VBox/ExtPacks/Makefile.kmk create mode 100644 src/VBox/ExtPacks/Skeleton/.scm-settings create mode 100644 src/VBox/ExtPacks/Skeleton/ExtPack.xml create mode 100644 src/VBox/ExtPacks/Skeleton/Makefile.kmk create mode 100644 src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp create mode 100644 src/VBox/ExtPacks/Skeleton/VBoxSkeletonMainVM.cpp create mode 100644 src/VBox/ExtPacks/VBoxDTrace/.scm-settings create mode 100644 src/VBox/ExtPacks/VBoxDTrace/CDDL-ONLY create mode 100644 src/VBox/ExtPacks/VBoxDTrace/COPYING create mode 100644 src/VBox/ExtPacks/VBoxDTrace/ExtPack.xml create mode 100644 src/VBox/ExtPacks/VBoxDTrace/Makefile.kmk create mode 100644 src/VBox/ExtPacks/VBoxDTrace/Samples/Hello.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp create mode 100644 src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0.cpp create mode 100644 src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0A.asm create mode 100644 src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceWrapper.cpp create mode 100644 src/VBox/ExtPacks/VBoxDTrace/generated/dt_grammar.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/generated/dt_grammar.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceLibCWrappers.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/COPYING create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile.com create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/amd64/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/amd64/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/act/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/act/time.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/clear.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/dateprof.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/denorm.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/lquantize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/normalize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/renormalize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/trunc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writes.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writesbycmd.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writesbycmdfd.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writetime.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writetimeq.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/anon/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/anon/iprb.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/buf/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/buf/ring.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/chapters create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/begin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/end.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/error.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/delay.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/putnext.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/ssd.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/xioctl.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/countdown.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/counter.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/hello.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/rwtime.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/trussrw.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/applicat.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iocpu.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iosnoop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iothrough.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iotime.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whoio.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whowrite.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/ipio.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/ipproto.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/tcprst.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/lockstat/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/lockstat/whatlock.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/mkdemo.pl create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/out/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/out/printa.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/lwptime.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/progtime.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/sig.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/whoexec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/prof.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/profpri.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/restest.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/firebird.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/howlong.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/nscd.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/pri.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/pritime.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/qlen.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/qtime.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/tick.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/ticktime.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whatfor.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/where.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whererun.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whofor.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whopreempt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whoqueue.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whosteal.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/xterm.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/xwork.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/interp.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/syscall.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/tracewrite.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/callout.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/interval.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/intr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/spec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/specopen.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/kstat.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/ksyms.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/rwinfo.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sysinfo/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sysinfo/find.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/Makefile.kup create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcp1stbyte.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpbytes.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpbytesstat.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpconnlat.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpio.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpioflags.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpsnoop.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpstate.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcptop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/Makefile.kup create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpbytes.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpbytesstat.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpio.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpsnoop.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udptop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/badopen.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/errorpath.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/libc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/userfunc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/clause.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/rtime.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vminfo/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vminfo/soffice.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/dtrace.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/i386/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/i386/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparc/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparc/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparcv9/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparcv9/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile.subdirs create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/README create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/baddof.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/badioctl/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/badioctl/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/badioctl/badioctl.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile.com create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/amd64/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/amd64/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/chkargs.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/i386/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/i386/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparc/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparc/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparcv9/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparcv9/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/Getopt.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/JDTrace.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/exception.lst create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/jdtrace.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/manifest/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/manifest/jdtrace.jar-manifest create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/Makefile.kup create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/dstyle.pl create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/dtest.pl create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile.com create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_FUNC.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_MDIM.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_NULL.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_REDEF.redef.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.avgtoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.maxnoarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.mintoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.quantizetoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.sumtoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_AGGARG.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_PROTO.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_IDENT.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_UNDEF.badaggfunc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badexpr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badkey3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.noeffect.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey4.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqbad1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqshort.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASEVAL.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMTYPE.lqbad1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMVAL.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.order.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.order.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHSTEP.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MISMATCH.lqbadarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPLARGE.lqtoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPSMALL.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPTYPE.lqbadinc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPVAL.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_AGGARG.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_PROTO.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_SCALAR.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_ARG.lquantizetoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgnoarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgtoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.counttoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizenoarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizetoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxnoarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxtoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.minnoarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.mintoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizenoarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizetoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumnoarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumtoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_AGGARG.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badmany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badnone.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_SCALAR.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.allquant.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.allquant.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clear.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clear.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count2.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.forms.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.forms.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.goodkey.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.keysort.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.keysort.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negorder.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negorder.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negquant.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negquant.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.normalize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.normalize.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.order.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.order.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantize.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantround.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantround.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signature.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.stddev.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.subr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.sum.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.sum.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.modby0.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.addmin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.divmin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muladd.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muldiv.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_ARR_BADREF.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRBIG.toobig.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRNULL.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRSUB.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_PROTO_TYPE.badtuple.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_IDENT_UNDEF.badureg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic4.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic5.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic6.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.uregsarray.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.this.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_ARG.badsig.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_SYNTAX.errassign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.tupoflow.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.cpyarray.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.diffprofile.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.initialize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.invalidref.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.misc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.this.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.valassign.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.begin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.tick.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.begin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.begin.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.multibegin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.multibegin.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_ADDROF_BITFIELD.BitfieldAddress.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.NegBitField.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.ZeroBitField.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.ExceedBaseType.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.GreaterThan64.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFTYPE.badtype.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_OFFSETOF_BITFIELD.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_SIZEOF_BITFIELD.SizeofBitfield.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/tst.BitFieldPromotion.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/tst.SizeofBitField.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.end.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.resize1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.resize2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.resize3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.zerobuf.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.alignring.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.cputime.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.dynvarsize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.fill1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.fill1.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.resize1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.resize2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.resize3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring2.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring3.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.smallring.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.switch1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.switch1.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.cpuusage.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.nice.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.priority.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.prsize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.rssize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg0.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg0clause.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8clause.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.caller.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.caller1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.epid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.epid1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.errno.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.errno1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.execname.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.hpriority.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.id.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.id1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.ipl.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.ipl1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.pid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.pid1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.tid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.tid1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.timestamp.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.vtimestamp.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggfun.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggtup.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.arrtup.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.body.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.both.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.pred.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.nopred.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.pred.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.predfirst.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.predlast.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.malformedoverflow.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.nonexistentevent.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart1.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart2.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cputrackfailtostart.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cputrackterminates.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.toomanyenablings.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.allcpus.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.genericevent.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.platformevent.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_LOCASSC.NonLocalAssoc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_LONGINT.LongStruct.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PARMCLASS.BadStorageClass.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_NAME.VoidName.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_TYPE.Dyn.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VARARGS.VarLenArgs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VOID.NonSoleVoid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_SIGNINT.UnsignedStruct.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_VOIDATTR.ShortVoidDecl.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.arrays.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.basics.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.funcs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.pointers.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.varargsfuncs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/badptr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/countdown.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/counter.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/errorpath.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/hello.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/kstat.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/ksyms.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/renormalize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rtime.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rw.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rwinfo.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rwtime.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/specopen.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/truss.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/trussrw.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/userfunc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_AGGREGATION.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DBLERROR.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DYNAMIC.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.end.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPEC.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPECUNAVAIL.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/err.D_PDESC_ZERO.InvalidDescription1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.APIVersion.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.AddSearchPath.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ELFGeneration.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.IncludedFilePath.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithFunctions create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithIDs create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithModules create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithNames create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithProviders create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ShowCompilerCode.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceFunctions create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceIDs create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceModule create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceNames create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceProvider create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.VerboseStabilityReport.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeGiga.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeKilo.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeMega.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeTera.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel32.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel64.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithoutW.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus1.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus2.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExtraneousProbeIds.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName1.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName2.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId1.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId2.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId3.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule1.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule2.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule3.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule4.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProbeIdentifier.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider1.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider2.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider3.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider4.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc1.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc2.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc3.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc4.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc5.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc6.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc8.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc9.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID1.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID2.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID3.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID4.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID5.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID6.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID7.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule1.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule2.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule3.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule4.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule5.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule6.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule7.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule8.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName1.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName2.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName3.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName4.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName5.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName6.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName7.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName8.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName9.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider1.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider2.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider3.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider4.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider5.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.MultipleInvalidProbeId.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.UnDefineNameWithCPP.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbeIdentfier.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbesWithoutZ.d.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/err.D_IDENT_UNDEF.timespent.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.end.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.endwithoutbegin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.multibeginend.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.multiend.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_BADADDR.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_DIVZERO.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_UNKNOWN.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.error.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.errorend.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/err.D_PROTO_LEN.noarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/err.exitarg1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/tst.basic1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/err.D_PDESC_ZERO.notreturn.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.basic.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.return.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_FUNC_UNDEF.progenyofbad1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_OP_VFPTR.badop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.chillbadarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.copyoutbadarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.mobadarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.raisebadarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.allocanoarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.badbreakpoint.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrbadarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrtoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.panicbadarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.progenyofbad2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.stopbadarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_STRINGOF_TYPE.badstringof.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_VAR_UNDEF.badvar.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badalloca.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badalloca2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy4.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy5.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy6.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badchill.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.chillbadarg.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.copyout.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.copyoutbadaddr.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.copyoutstrbadaddr.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntoa6badaddr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntoabadaddr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadaddr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.basename.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.bcopy.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.chill.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.copyin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.copyinto.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.ddi_pathname.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.default.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.freopen.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.hton.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.index.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.index.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.mutex_owned.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.progenyof.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.rand.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strchr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strchr.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strstr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strstr.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strtok.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strtok.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strtok_null.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substr.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.system.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.system.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/err.D_ADDROF_LVAL.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/err.D_EMPTY.empty.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/tst.clauses.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/tst.stmts.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_IDENT_UNDEF.recur.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineDataAssign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineExpression.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineTypedef.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineWritableAssign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/tst.fds.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/tst.fds.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/tst.fds.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/Makefile.kup create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/manifest/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/manifest/test.jar-manifest create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestAbort.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestBean.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestClose.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestDrop.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestEnable.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestMaxConsumers.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestMultiAggPrinta.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestProbeData.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestProbeDescription.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestStateMachine.java create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestStopLock.java create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.GetAggregate.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.printa.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.printa.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NL.char.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NULL.char.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_INT_DIGIT.InvalidDigit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_INT_OFLOW.BigInt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_STR_NL.string.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren3.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mdb/Makefile.kup create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.tcp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.udp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/err.D_PRAGMA_OPTSET.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.badopt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.boolopt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.boolopt.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.dynopt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.dynopt.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.enablerace.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.haslam.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.include.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.roch.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGKEY.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGPROTO.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.many.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.many.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.same.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.same.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call3.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.badtype.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.notsou.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.OffsetofNULL.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.badmemb.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofAlias.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofArith.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofUnion.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.struct.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.struct.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.union.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.union.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/tst.ternary.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/tst.ternary.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badproc1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_BADPID.badproc2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.addprobes.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.args1.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.args1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.coverage.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.coverage.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.d.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.float.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.float.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.fork.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.fork.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.gcc.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.gcc.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.killonerror.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.main.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.manypids.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.probemod.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret1.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret2.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.vfork.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.vfork.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak1.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak2.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.available.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.available.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.libmap.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.ArrayVar.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.DynamicVar.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.agg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_NONPTR.noptr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_VOID.VoidPointerDeref.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_ARRFUN.ArrayAssignment.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_INCOMPAT.VoidPointerArith.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_LVAL.AddressChange.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.NonPointerAccess.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.badpointer.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.BadPointerAccess.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.badpointer.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.GlobalVar.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.IntegerArithmetic1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerAssignment.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.VoidCast.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.basic1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.basic2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGERR.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_DEPEND.main.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_INVAL.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_MALFORM.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_UNUSED.UnusedPragma.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.circlibdep.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.invalidlibdep.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libdep.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libdepfullyconnected.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_IDENT_UNDEF.afterprobe.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_SYNTAX.withoutpound.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.defincomp.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefelsenotendif.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefincomp.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefnotendif.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.incompelse.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.mulelse.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.predicatedeclare.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.withinprobe.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badagg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badfmt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badval.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_PROTO.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.stack.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.basics.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.basics.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.def.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.def.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.fmt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.fmt.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.many.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.manyval.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.manyval.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.stack.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.tuple.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.tuple.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_AGG_CONV.aggfmt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.toomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.widths.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_FMT.badfmt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_PROTO.novalue.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.aggarg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.recursive.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.noprec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.nowidth.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badprec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badwidth.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PROTO_LEN.toofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.basics.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.basics.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.flags.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.flags.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.hello.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.hello.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.precs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.precs.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.print-f.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.print-f.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printT.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printT.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printY.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printY.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printcont.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printcont.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printeE.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printeE.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printgG.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printgG.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.str.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.str.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.sym.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.sym.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.uints.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.uints.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.wp.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.wp.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.op_access.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.unpriv_funcs.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probeqtn.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probestar.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.tickstar.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.assign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declare.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declarein.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.lbraces.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.probespec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.rbraces.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.recdec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.basic1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.check.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.declare.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.declareafter.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.emptyprobe.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragma.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmaaftertab.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmainside.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmaoutside.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.probestar.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.create.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.discard.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exec.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitexit.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.signal.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.sigwait.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.sigwait.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZERO.profile.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonens.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonensec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneus.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneusec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.basic.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.basic.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_INVAL.wrongdec4.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.nonprofile.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.basics.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.basics.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginexit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginprof.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginprof.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probattrs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probattrs.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probefunc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probefunc.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probemod.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probemod.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probename.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probename.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probprov.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probprov.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profend.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profend.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profexit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profexit.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.trace.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.trace.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.twoprof.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.twoprof.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise1.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise2.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise3.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.aggrate.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.aggrate.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.statusrate.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.switchrate.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.switchrate.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.basename.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.caller.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.cleanpath.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.copyin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.copyin2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ddi_pathname.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.dirname.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.errno.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.execname.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.gid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.hton.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.index.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.msgdsize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.msgsize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.null.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.pid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ppid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.progenyof.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.random.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.rw.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.shortstr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stack.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stackdepth.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stddev.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strchr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strjoin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strstr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strtok.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.substr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ucaller.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.uid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.unalign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.uregs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ustack.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ustackdepth.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.vahole.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.zonename.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_ARR_LOCAL.thisarray.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.selfthis.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.thisself.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_IDRED.errval.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dec.err.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_SYNTAX.declare.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.localvar.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.misc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.self.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfarray.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfarray2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfthis.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.this.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.thisself.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.enqueue.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.oncpu.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.stackdepth.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_MACRO_UNDEF.invalidargs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_OP_LVAL.rdonly.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_OP_WRITE.usepidmacro.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.concat.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.desc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.inval.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.pid.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.arg0.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.assign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.basic.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.egid.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.euid.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.gid.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.pgid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.pid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.ppid.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.projid.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.quite.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.sid.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.taskid.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.trace.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.uid.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_BADREF.SizeofAssoc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_SYNTAX.SizeofBadType.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofArray.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofDataTypes.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofExpression.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofNULL.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/bug.1001148.SpecSizeVariations.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_COMM.AggAftCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithAvg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithCount.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithLquant.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMax.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithSum.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.CommitAftCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.DisjointCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_DREC.CommitAftDataRec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.DataRecAftCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.ExitAfterCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_EXIT_SPEC.ExitAftSpec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_MALFORM.NspecExpr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.HugeNspecValue.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.InvalidSpecSize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PROTO_LEN.SpecNoId.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_COMM.SpecAftCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_DREC.SpecAftDataRec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_SPEC.SpecAftSpec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeBufSize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeNspec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeSpecSize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.CommitAfterDiscard.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.CommitWithZero.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DataRecAftDiscard.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDataRec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDiscard.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardWithZero.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.ExitAftDiscard.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculateWithRandom.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationDiscard.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationID.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationWithZero.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.TwoSpecBuffers.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.negcommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.negspec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.zerosize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stability/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stability/err.D_ATTR_MIN.MinAttributes.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_STACK_PROTO.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_STACK_SIZE.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_FRAMES.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_PROTO.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_STRSIZE.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/tst.default.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stackdepth/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stackdepth/tst.default.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop1.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop2.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/strlen/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/strlen/tst.strlen1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_ADDROF_VAR.StructPointer.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.circular.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.recursive.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.simple.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_VOIDOBJ.baddec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_PROTO_ARG.DupStructAssoc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructAssoc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructDataTypes.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructInside.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.args.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.args.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.openret.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZERO.tick.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonens.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonensec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneus.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneusec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickarg0.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.misc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.qstring.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.qstring.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.string.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_ARG.badsize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toofew.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toomany.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.negsize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.zerosize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/tst.rootvp.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_DECL_TYPERED.BadTransDecl.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_OP_INCOMPLETE.NonExistentInput1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl4.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_TYPE_MEMBER.NonExistentInput2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_INCOMPAT.BadInputType1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_MEMB.NonExistentOutput2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_NONE.BadTransDecl6.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_REDECL.RepeatTransDecl.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransDecl8.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransInt.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.NonExistentOutput1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.CircularTransDecl.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.EmptyTransDecl.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.ForwardTag.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.InputAliasTrans.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.InputIntTrans.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.OutputAliasTrans.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.PartialDereferencing.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.PartialOutputTransDefn.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.ProcModelTrans.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.RepeatDeclaration.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.SimultaneousTranslators.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.StructureAssignment.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransNonPointer.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransOutputPointer.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransPointer.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TranslateSelf.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.UnionInputTrans.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.UnionOutputTrans.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_DECL_IDRED.DupTypeDef.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.BadExistingTypedef.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.TypedefInClause.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/tst.ChainTypedef.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/tst.TypedefDataAssign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CAST_INVAL.badcast.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CG_DYN.ResultDynType.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CHR_OFLOW.charconst.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_BADCLASS.bad.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_CHARATTR.badtype3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype4.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype5.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENCONST.badeval.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enoflow.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enuflow.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_SCOPE.scopeop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_USELESS.baddec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_ACT.badcond.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_ARITH.badoperand.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INCOMPAT.badassign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badbitop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badshift.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badcond.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badincop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badlogop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_PROTO_LEN.badcond1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badenum.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badstruct.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupenum.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupstruct.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.assignops.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.badshiftops.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.basics.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.basics.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.bitops.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.charconstants.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.complex.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.condexpr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.constants.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.conv.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.enum.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.intincop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.intops.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.inttypes.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.ptrincop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.ptrops.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.relenum.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.relstring.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.shiftops.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.stringconstants.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.struct.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.typedef.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.unaryop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_ADDROF_VAR.UnionPointer.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.circular.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.order.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.recursive.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.simple.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_PROTO_ARG.DupUnionAssoc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionAssoc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionDataTypes.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionInside.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/argmap.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/args.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/forker.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.andpid.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.argmap.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.argmap.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.args.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.args.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.forker.c create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.forker.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.header.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.include.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh.out create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.user.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.user.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.bigstack.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.depth.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.spin.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.gid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.nullassign.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ppid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.uid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.walltimestamp.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/version/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/version/tst.1.0.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/arrays/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/arrays/tst.uregsarray.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyinstr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyout.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/funcs/tst.badcopyoutstr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.branch.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.embedded.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.ret.s create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/pid/tst.retlist.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/annotated_helper.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/helper_helper.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.annotated.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.circstack.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i386/ustack/tst.helper.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i86xpv/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i86xpv/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i86xpv/xdt/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i86xpv/xdt/tst.basic.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i86xpv/xdt/tst.hvmenable.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i86xpv/xdt/tst.memenable.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedenable.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/arrays/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/arrays/tst.uregsarray.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/pid/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.d create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.exe create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/pid/tst.br.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/pid/tst.br.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/pid/tst.br.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/pid/tst.branch.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/pid/tst.branch.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/pid/tst.embedded.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/pid/tst.embedded.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/usdt/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/annotated_helper.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/helper_helper.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/tst.annotated.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/tst.helper.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/tst.helper.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/sparc/ustack/tst.trapstat.ksh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_create.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_decl.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_error.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_hash.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_impl.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_labels.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_lookup.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_open.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_types.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_util.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/dtrace/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/common/dtrace/dtrace_data.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/Makefile.com create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/amd64/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/common/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/common/ctf_lib.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/common/ctf_subr.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/common/libctf.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/common/llib-lctf create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/common/mapfile-vers create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/i386/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/sparc/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libctf/sparcv9/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/Makefile.com create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/amd64/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/amd64/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/drti.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_aggregate.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_as.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_as.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_buf.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_buf.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_cc.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_cg.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_consume.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_decl.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_decl.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_dis.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_dof.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_dof.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_error.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_errtags.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_grammar.y create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_handle.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_ident.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_ident.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_impl.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_inttab.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_inttab.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_lex.l create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_link.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_list.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_list.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_map.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_module.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_module.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_open.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_options.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_parser.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_parser.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_pcb.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_pcb.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_pid.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_pid.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_pragma.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_printf.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_printf.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_proc.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_proc.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_program.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_program.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_provider.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_provider.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_regset.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_regset.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_string.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_string.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_strtab.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_strtab.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_subr.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_work.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_xlator.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_xlator.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dtrace.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/fc.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/io.d.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/io.sed.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/ip.d.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/ip.sed.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/iscsit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/llib-ldtrace create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/mapfile-vers create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/mkerrno.sh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/mkerrtags.sed create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/mkerrtags.sh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/mknames.sed create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/mknames.sh create mode 100755 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/mksignal.sh create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/net.d.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/net.sed.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/nfs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/procfs.d.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/procfs.sed.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/sched.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/scsi.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/srp.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/sysevent.d.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/sysevent.sed.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/tcp.d.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/tcp.sed.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/udp.d.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/udp.sed.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/unistd.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/i386/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/i386/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/i386/dt_isadep.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/i386/regs.d.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/i386/regs.sed.in create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/sparc/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/sparc/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/sparc/dt_isadep.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/sparc/regs.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/sparcv9/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/sparcv9/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/dcpc.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/dcpc.conf create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/dtrace.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/dtrace.conf create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/fasttrap.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/lockstat.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/lockstat.conf create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/profile.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/profile.conf create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/sdt_subr.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/systrace.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/systrace.conf create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/os/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/os/dtrace_subr.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/sys/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/sys/ctf.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/sys/ctf_api.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/sys/dtrace.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/sys/dtrace_impl.h create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/i86pc/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/i86pc/os/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/i86pc/os/dtrace_subr.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/dtrace/Makefile create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/dtrace/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/dtrace/dtrace_asm.s create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/dtrace/dtrace_isa.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/dtrace/fasttrap.conf create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/dtrace/fasttrap_isa.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/dtrace/fbt.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/dtrace/fbt.conf create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/dtrace/sdt.c create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/uts/intel/dtrace/sdt.conf create mode 100644 src/VBox/ExtPacks/VNC/ExtPack.xml create mode 100644 src/VBox/ExtPacks/VNC/Makefile.kmk create mode 100644 src/VBox/ExtPacks/VNC/VBoxVNC.cpp create mode 100644 src/VBox/ExtPacks/VNC/VBoxVNCMain.cpp (limited to 'src/VBox/ExtPacks') diff --git a/src/VBox/ExtPacks/.scm-settings b/src/VBox/ExtPacks/.scm-settings new file mode 100644 index 00000000..a38ed0b7 --- /dev/null +++ b/src/VBox/ExtPacks/.scm-settings @@ -0,0 +1,32 @@ +# $Id: .scm-settings $ +## @file +# Source code massager settings for extension packs. +# + +# +# Copyright (C) 2010-2023 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# SPDX-License-Identifier: GPL-3.0-only +# + + +# The ExtPack.xml files doesn't include any license or copyright. +*/ExtPack.xml: --no-update-copyright-year --no-update-license +/*.h: --guard-relative-to-dir . + diff --git a/src/VBox/ExtPacks/BusMouseSample/.scm-settings b/src/VBox/ExtPacks/BusMouseSample/.scm-settings new file mode 100644 index 00000000..637f87d2 --- /dev/null +++ b/src/VBox/ExtPacks/BusMouseSample/.scm-settings @@ -0,0 +1,33 @@ +# $Id: .scm-settings $ +## @file +# Source code massager settings for BusMouse sample. +# + +# +# Copyright (C) 2010-2023 Oracle and/or its affiliates. +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# + +# This directory contains sample code and are therefore under MIT license. +--license-mit + diff --git a/src/VBox/ExtPacks/BusMouseSample/DevBusMouse.cpp b/src/VBox/ExtPacks/BusMouseSample/DevBusMouse.cpp new file mode 100644 index 00000000..da480986 --- /dev/null +++ b/src/VBox/ExtPacks/BusMouseSample/DevBusMouse.cpp @@ -0,0 +1,901 @@ +/* $Id: DevBusMouse.cpp $ */ +/** @file + * BusMouse - Microsoft Bus (parallel) mouse controller device. + */ + +/* + * Copyright (C) 2006-2023 Oracle and/or its affiliates. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +/********************************************************************************************************************************* +* Header Files * +*********************************************************************************************************************************/ +#define LOG_GROUP LOG_GROUP_DEV_KBD +#include +#ifndef IN_RING3 +# include +#endif +#include +#include +#include +#include + +/** @page pg_busmouse DevBusMouse - Microsoft Bus Mouse Emulation + * + * The Microsoft Bus Mouse was an early mouse sold by Microsoft, originally + * introduced in 1983. The mouse had a D-shaped 9-pin connector which plugged + * into a small ISA add-in board. + * + * The mouse itself was very simple (compared to a serial mouse) and most of the + * logic was located on the ISA board. Later, Microsoft sold an InPort mouse, + * which was also called a "bus mouse", but used a different interface. + * + * Microsoft part numbers for the Bus Mouse were 037-099 (100 ppi) + * and 037-199 (200 ppi). + * + * The Bus Mouse adapter included IRQ configuration jumpers (ref. MS article + * Q12230). The IRQ could be set to one of 2, 3, 4, 5. The typical setting + * would be IRQ 2 for a PC/XT and IRQ 5 for an AT compatible. Because IRQ 5 + * may conflict with a SoundBlaster or a PCI device, this device defaults to + * IRQ 3. Note that IRQ 3 is also used by the COM 2 device, not often needed. + * + * The ISA adapter was built around an Intel 8255A compatible chip (ref. + * MS article Q46369). Once enabled, the adapter raises the configured IRQ + * 30 times per second; the rate is not configurable. The interrupts + * occur regardless of whether the mouse state has changed or not. + * + * To function properly, the 8255A must be programmed as follows: + * - Port A: Input. Used to read motion deltas and button states. + * - Port B: Output. Not used except for mouse detection. + * - Port C: Split. Upper bits set as output, used for control purposes. + * Lower bits set as input, reflecting IRQ state. + * + * Detailed information was gleaned from Windows and OS/2 DDK mouse samples. + */ + + +/********************************************************************************************************************************* +* Defined Constants And Macros * +*********************************************************************************************************************************/ +/** The original bus mouse controller is fixed at I/O port 0x23C. */ +#define BMS_IO_BASE 0x23C +#define BMS_IO_SIZE 4 + +/** @name Offsets relative to the I/O base. + *@{ */ +#define BMS_PORT_DATA 0 /**< 8255 Port A. */ +#define BMS_PORT_SIG 1 /**< 8255 Port B. */ +#define BMS_PORT_CTRL 2 /**< 8255 Port C. */ +#define BMS_PORT_INIT 3 /**< 8255 Control Port. */ +/** @} */ + +/** @name Port C bits (control port). + * @{ */ +#define BMS_CTL_INT_DIS RT_BIT(4) /**< Disable IRQ (else enabled). */ +#define BMS_CTL_SEL_HIGH RT_BIT(5) /**< Select hi nibble (else lo). */ +#define BMS_CTL_SEL_Y RT_BIT(6) /**< Select X to read (else Y). */ +#define BMS_CTL_HOLD RT_BIT(7) /**< Hold counter (else clear). */ +/** @} */ + +/** @name Port A bits (data port). + * @{ */ +#define BMS_DATA_DELTA 0x0F /**< Motion delta in lower nibble. */ +#define BMS_DATA_B3_UP RT_BIT(5) /**< Button 3 (right) is up. */ +#define BMS_DATA_B2_UP RT_BIT(6) /**< Button 2 (middle) is up. */ +#define BMS_DATA_B1_UP RT_BIT(7) /**< Button 1 (left) is up. */ +/** @} */ + +/** Convert IRQ level (2/3/4/5) to a bit in the control register. */ +#define BMS_IRQ_BIT(a) (1 << (5 - a)) + +/** IRQ period, corresponds to approx. 30 Hz. */ +#define BMS_IRQ_PERIOD_MS 34 + +/** Default IRQ setting. */ +#define BMS_DEFAULT_IRQ 3 + +/** The saved state version. */ +#define BMS_SAVED_STATE_VERSION 1 + + +/********************************************************************************************************************************* +* Structures and Typedefs * +*********************************************************************************************************************************/ +/** + * The shared Bus Mouse device state. + */ +typedef struct MouState +{ + /** @name 8255A state + * @{ */ + uint8_t port_a; + uint8_t port_b; + uint8_t port_c; + uint8_t ctrl_port; + uint8_t cnt_held; /**< Counters held for reading. */ + uint8_t held_dx; + uint8_t held_dy; + uint8_t irq; /**< The "jumpered" IRQ level. */ + int32_t irq_toggle_counter; + /** Timer period in milliseconds. */ + uint32_t cTimerPeriodMs; + /** Mouse timer handle. */ + TMTIMERHANDLE hMouseTimer; + /** @} */ + + /** @name mouse state + * @{ */ + int32_t disable_counter; + int32_t mouse_dx; /* current values, needed for 'poll' mode */ + int32_t mouse_dy; + uint8_t mouse_enabled; + uint8_t mouse_buttons; + uint8_t mouse_buttons_reported; + uint8_t bAlignment; + /** @} */ + + /** The I/O ports registration. */ + IOMIOPORTHANDLE hIoPorts; + +} MouState, BMSSTATE; +/** Pointer to the shared Bus Mouse device state. */ +typedef BMSSTATE *PBMSSTATE; + + +/** + * The ring-3 Bus Mouse device state. + */ +typedef struct BMSSTATER3 +{ + /** Pointer to the device instance. + * @note Only for getting our bearings in an interface method. */ + PPDMDEVINSR3 pDevIns; + + /** + * Mouse port - LUN#0. + * + * @implements PDMIBASE + * @implements PDMIMOUSEPORT + */ + struct + { + /** The base interface for the mouse port. */ + PDMIBASE IBase; + /** The mouse port base interface. */ + PDMIMOUSEPORT IPort; + + /** The base interface of the attached mouse driver. */ + R3PTRTYPE(PPDMIBASE) pDrvBase; + /** The mouse interface of the attached mouse driver. */ + R3PTRTYPE(PPDMIMOUSECONNECTOR) pDrv; + } Mouse; +} BMSSTATER3; +/** Pointer to the ring-3 Bus Mouse device state. */ +typedef BMSSTATER3 *PBMSSTATER3; + + +#ifndef VBOX_DEVICE_STRUCT_TESTCASE + +# ifdef IN_RING3 + +/** + * Report a change in status down the driver chain. + * + * We want to report the mouse as enabled if and only if the guest is "using" + * it. That way, other devices (e.g. a PS/2 or USB mouse) can receive mouse + * events when the bus mouse is disabled. Enabling interrupts constitutes + * enabling the bus mouse. The mouse is considered disabled if interrupts are + * disabled for several consecutive mouse timer ticks; this is because the + * interrupt handler in the guest typically temporarily disables interrupts and + * we do not want to toggle the enabled/disabled state more often than + * necessary. + */ +static void bmsR3UpdateDownstreamStatus(PBMSSTATE pThis, PBMSSTATER3 pThisCC) +{ + PPDMIMOUSECONNECTOR pDrv = pThisCC->Mouse.pDrv; + bool fEnabled = !!pThis->mouse_enabled; + if (pDrv) /* pDrv may be NULL if no mouse interface attached. */ + pDrv->pfnReportModes(pDrv, fEnabled, false, false, false); +} + +/** + * Process a mouse event coming from the host. + */ +static void bmsR3MouseEvent(PBMSSTATE pThis, int dx, int dy, int dz, int dw, int buttons_state) +{ + LogRel3(("%s: dx=%d, dy=%d, dz=%d, dw=%d, buttons_state=0x%x\n", + __PRETTY_FUNCTION__, dx, dy, dz, dw, buttons_state)); + + /* Only record X/Y movement and buttons. */ + pThis->mouse_dx += dx; + pThis->mouse_dy += dy; + pThis->mouse_buttons = buttons_state; +} + +/** + * @callback_method_impl{FNTMTIMERDEV} + */ +static DECLCALLBACK(void) bmsR3TimerCallback(PPDMDEVINS pDevIns, TMTIMERHANDLE hTimer, void *pvUser) +{ + PBMSSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE); + PBMSSTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PBMSSTATER3); + uint8_t irq_bit; + RT_NOREF(pvUser); + Assert(hTimer == pThis->hMouseTimer); + + /* Toggle the IRQ line if interrupts are enabled. */ + irq_bit = BMS_IRQ_BIT(pThis->irq); + + if (pThis->port_c & irq_bit) + { + if (!(pThis->port_c & BMS_CTL_INT_DIS)) + PDMDevHlpISASetIrq(pDevIns, pThis->irq, PDM_IRQ_LEVEL_LOW); + pThis->port_c &= ~irq_bit; + } + else + { + pThis->port_c |= irq_bit; + if (!(pThis->port_c & BMS_CTL_INT_DIS)) + PDMDevHlpISASetIrq(pDevIns, pThis->irq, PDM_IRQ_LEVEL_HIGH); + } + + /* Handle enabling/disabling of the mouse interface. */ + if (pThis->port_c & BMS_CTL_INT_DIS) + { + if (pThis->disable_counter) + --pThis->disable_counter; + + if (pThis->disable_counter == 0 && pThis->mouse_enabled) + { + pThis->mouse_enabled = false; + bmsR3UpdateDownstreamStatus(pThis, pThisCC); + } + } + else + { + pThis->disable_counter = 8; /* Re-arm the disable countdown. */ + if (!pThis->mouse_enabled) + { + pThis->mouse_enabled = true; + bmsR3UpdateDownstreamStatus(pThis, pThisCC); + } + } + + /* Re-arm the timer. */ + PDMDevHlpTimerSetMillies(pDevIns, hTimer, pThis->cTimerPeriodMs); +} + +# endif /* IN_RING3 */ + +static void bmsSetReportedButtons(PBMSSTATE pThis, unsigned fButtons, unsigned fButtonMask) +{ + pThis->mouse_buttons_reported |= (fButtons & fButtonMask); + pThis->mouse_buttons_reported &= (fButtons | ~fButtonMask); +} + +/** + * Update the internal state after a write to port C. + */ +static void bmsUpdateCtrl(PPDMDEVINS pDevIns, PBMSSTATE pThis) +{ + int32_t dx, dy; + + /* If the controller is in hold state, transfer data from counters. */ + if (pThis->port_c & BMS_CTL_HOLD) + { + if (!pThis->cnt_held) + { + pThis->cnt_held = true; + dx = pThis->mouse_dx < 0 ? RT_MAX(pThis->mouse_dx, -128) + : RT_MIN(pThis->mouse_dx, 127); + dy = pThis->mouse_dy < 0 ? RT_MAX(pThis->mouse_dy, -128) + : RT_MIN(pThis->mouse_dy, 127); + pThis->mouse_dx -= dx; + pThis->mouse_dy -= dy; + bmsSetReportedButtons(pThis, pThis->mouse_buttons & 0x07, 0x07); + + /* Force type conversion. */ + pThis->held_dx = dx; + pThis->held_dy = dy; + } + } + else + pThis->cnt_held = false; + + /* Move the appropriate nibble into port A. */ + if (pThis->cnt_held) + { + if (pThis->port_c & BMS_CTL_SEL_Y) + { + if (pThis->port_c & BMS_CTL_SEL_HIGH) + pThis->port_a = pThis->held_dy >> 4; + else + pThis->port_a = pThis->held_dy & 0xF; + } + else + { + if (pThis->port_c & BMS_CTL_SEL_HIGH) + pThis->port_a = pThis->held_dx >> 4; + else + pThis->port_a = pThis->held_dx & 0xF; + } + /* And update the button bits. */ + pThis->port_a |= pThis->mouse_buttons & 1 ? 0 : BMS_DATA_B1_UP; + pThis->port_a |= pThis->mouse_buttons & 2 ? 0 : BMS_DATA_B3_UP; + pThis->port_a |= pThis->mouse_buttons & 4 ? 0 : BMS_DATA_B2_UP; + } + /* Immediately clear the IRQ if necessary. */ + if (pThis->port_c & BMS_CTL_INT_DIS) + { + PDMDevHlpISASetIrq(pDevIns, pThis->irq, PDM_IRQ_LEVEL_LOW); + pThis->port_c &= ~BMS_IRQ_BIT(pThis->irq); + } +} + +/** + * @callback_method_impl{FNIOMIOPORTNEWIN} + */ +static DECLCALLBACK(VBOXSTRICTRC) bmsIoPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t *pu32, unsigned cb) +{ + RT_NOREF(pvUser); + if (cb == 1) + { + PBMSSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE); + uint32_t uValue; + + switch (offPort) + { + case BMS_PORT_DATA: + /* Read port A. */ + uValue = pThis->port_a; + break; + case BMS_PORT_SIG: + /* Read port B. */ + uValue = pThis->port_b; + break; + case BMS_PORT_CTRL: + /* Read port C. */ + uValue = pThis->port_c; + /* Some Microsoft driver code reads the control port 10,000 times when + * determining the IRQ level. This can occur faster than the IRQ line + * transitions and the detection fails. To work around this, we force + * the IRQ bit to toggle every once in a while. + */ + if (pThis->irq_toggle_counter) + pThis->irq_toggle_counter--; + else + { + pThis->irq_toggle_counter = 1000; + uValue ^= BMS_IRQ_BIT(pThis->irq); + } + break; + case BMS_PORT_INIT: + /* Read the 8255A control port. */ + uValue = pThis->ctrl_port; + break; + default: + ASSERT_GUEST_MSG_FAILED(("invalid port %#x\n", offPort)); + uValue = 0xff; + break; + } + + *pu32 = uValue; + Log2(("mouIoPortRead: offPort=%#x+%x cb=%d *pu32=%#x\n", BMS_IO_BASE, offPort, cb, uValue)); + LogRel3(("mouIoPortRead: read port %u: %#04x\n", offPort, uValue)); + return VINF_SUCCESS; + } + ASSERT_GUEST_MSG_FAILED(("offPort=%#x cb=%d\n", offPort, cb)); + return VERR_IOM_IOPORT_UNUSED; +} + +/** + * @callback_method_impl{FNIOMIOPORTNEWOUT} + */ +static DECLCALLBACK(VBOXSTRICTRC) bmsIoPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT offPort, uint32_t u32, unsigned cb) +{ + RT_NOREF(pvUser); + if (cb == 1) + { + PBMSSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE); + LogRel3(("mouIoPortWrite: write port %u: %#04x\n", offPort, u32)); + + switch (offPort) + { + case BMS_PORT_SIG: + /* Update port B. */ + pThis->port_b = u32; + break; + case BMS_PORT_DATA: + /* Do nothing, port A is not writable. */ + break; + case BMS_PORT_INIT: + pThis->ctrl_port = u32; + break; + case BMS_PORT_CTRL: + /* Update the high nibble of port C. */ + pThis->port_c = (u32 & 0xF0) | (pThis->port_c & 0x0F); + bmsUpdateCtrl(pDevIns, pThis); + break; + default: + ASSERT_GUEST_MSG_FAILED(("invalid port %#x\n", offPort)); + break; + } + + Log2(("mouIoPortWrite: offPort=%#x+%u cb=%d u32=%#x\n", BMS_IO_BASE, offPort, cb, u32)); + } + else + ASSERT_GUEST_MSG_FAILED(("offPort=%#x cb=%d\n", offPort, cb)); + return VINF_SUCCESS; +} + +# ifdef IN_RING3 + +/** + * @callback_method_impl{FNSSMDEVSAVEEXEC} + */ +static DECLCALLBACK(int) bmsR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle) +{ + PBMSSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE); + PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; + + /* 8255A state. */ + pHlp->pfnSSMPutU8(pSSMHandle, pThis->port_a); + pHlp->pfnSSMPutU8(pSSMHandle, pThis->port_b); + pHlp->pfnSSMPutU8(pSSMHandle, pThis->port_c); + pHlp->pfnSSMPutU8(pSSMHandle, pThis->ctrl_port); + /* Other device state. */ + pHlp->pfnSSMPutU8(pSSMHandle, pThis->cnt_held); + pHlp->pfnSSMPutU8(pSSMHandle, pThis->held_dx); + pHlp->pfnSSMPutU8(pSSMHandle, pThis->held_dy); + pHlp->pfnSSMPutU8(pSSMHandle, pThis->irq); + pHlp->pfnSSMPutU32(pSSMHandle, pThis->cTimerPeriodMs); + /* Current mouse state deltas. */ + pHlp->pfnSSMPutS32(pSSMHandle, pThis->mouse_dx); + pHlp->pfnSSMPutS32(pSSMHandle, pThis->mouse_dy); + pHlp->pfnSSMPutU8(pSSMHandle, pThis->mouse_buttons_reported); + /* Timer. */ + return PDMDevHlpTimerSave(pDevIns, pThis->hMouseTimer, pSSMHandle); +} + +/** + * @callback_method_impl{FNSSMDEVLOADEXEC} + */ +static DECLCALLBACK(int) bmsR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPass) +{ + PBMSSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE); + PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; + + Assert(uPass == SSM_PASS_FINAL); NOREF(uPass); + + if (uVersion > BMS_SAVED_STATE_VERSION) + return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; + + /* 8255A state. */ + pHlp->pfnSSMGetU8(pSSMHandle, &pThis->port_a); + pHlp->pfnSSMGetU8(pSSMHandle, &pThis->port_b); + pHlp->pfnSSMGetU8(pSSMHandle, &pThis->port_c); + pHlp->pfnSSMGetU8(pSSMHandle, &pThis->ctrl_port); + /* Other device state. */ + pHlp->pfnSSMGetU8(pSSMHandle, &pThis->cnt_held); + pHlp->pfnSSMGetU8(pSSMHandle, &pThis->held_dx); + pHlp->pfnSSMGetU8(pSSMHandle, &pThis->held_dy); + pHlp->pfnSSMGetU8(pSSMHandle, &pThis->irq); + pHlp->pfnSSMGetU32(pSSMHandle, &pThis->cTimerPeriodMs); + /* Current mouse state deltas. */ + pHlp->pfnSSMGetS32(pSSMHandle, &pThis->mouse_dx); + pHlp->pfnSSMGetS32(pSSMHandle, &pThis->mouse_dy); + pHlp->pfnSSMGetU8(pSSMHandle, &pThis->mouse_buttons_reported); + /* Timer. */ + return PDMDevHlpTimerLoad(pDevIns, pThis->hMouseTimer, pSSMHandle); +} + +/** + * Reset notification. + * + * @returns VBox status code. + * @param pDevIns The device instance data. + */ +static DECLCALLBACK(void) bmsR3Reset(PPDMDEVINS pDevIns) +{ + PBMSSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE); + PBMSSTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PBMSSTATER3); + + /* Reinitialize the timer. */ + pThis->cTimerPeriodMs = BMS_IRQ_PERIOD_MS / 2; + PDMDevHlpTimerSetMillies(pDevIns, pThis->hMouseTimer, pThis->cTimerPeriodMs); + + /* Clear the device setup. */ + pThis->port_a = pThis->port_b = 0; + pThis->port_c = BMS_CTL_INT_DIS; /* Interrupts disabled. */ + pThis->ctrl_port = 0x91; /* Default 8255A setup. */ + + /* Clear motion/button state. */ + pThis->cnt_held = false; + pThis->mouse_dx = pThis->mouse_dy = 0; + pThis->mouse_buttons = 0; + pThis->mouse_buttons_reported = 0; + pThis->disable_counter = 0; + pThis->irq_toggle_counter = 1000; + + if (pThis->mouse_enabled) + { + pThis->mouse_enabled = false; + bmsR3UpdateDownstreamStatus(pThis, pThisCC); + } +} + + +/* -=-=-=-=-=- Mouse: IBase -=-=-=-=-=- */ + +/** + * @interface_method_impl{PDMIBASE,pfnQueryInterface} + */ +static DECLCALLBACK(void *) bmsR3Base_QueryMouseInterface(PPDMIBASE pInterface, const char *pszIID) +{ + PBMSSTATER3 pThisCC = RT_FROM_MEMBER(pInterface, BMSSTATER3, Mouse.IBase); + PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pThisCC->Mouse.IBase); + PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMOUSEPORT, &pThisCC->Mouse.IPort); + return NULL; +} + + +/* -=-=-=-=-=- Mouse: IMousePort -=-=-=-=-=- */ + +/** + * @interface_method_impl{PDMIMOUSEPORT,pfnPutEvent} + */ +static DECLCALLBACK(int) bmsR3MousePort_PutEvent(PPDMIMOUSEPORT pInterface, int32_t dx, + int32_t dy, int32_t dz, int32_t dw, + uint32_t fButtons) +{ + PBMSSTATER3 pThisCC = RT_FROM_MEMBER(pInterface, BMSSTATER3, Mouse.IPort); + PPDMDEVINS pDevIns = pThisCC->pDevIns; + PBMSSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE); + int rc = PDMDevHlpCritSectEnter(pDevIns, pDevIns->CTX_SUFF(pCritSectRo), VERR_SEM_BUSY); + PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, pDevIns->CTX_SUFF(pCritSectRo), rc); + + bmsR3MouseEvent(pThis, dx, dy, dz, dw, fButtons); + + PDMDevHlpCritSectLeave(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)); + return VINF_SUCCESS; +} + +/** + * @interface_method_impl{PDMIMOUSEPORT,pfnPutEventAbs} + */ +static DECLCALLBACK(int) bmsR3MousePort_PutEventAbs(PPDMIMOUSEPORT pInterface, uint32_t x, uint32_t y, + int32_t dz, int32_t dw, uint32_t fButtons) +{ + RT_NOREF(pInterface, x, y, dz, dw, fButtons); + AssertFailedReturn(VERR_NOT_SUPPORTED); +} + +/** + * @interface_method_impl{PDMIMOUSEPORT,pfnPutEventMultiTouch} + */ +static DECLCALLBACK(int) bmsR3MousePort_PutEventMultiTouch(PPDMIMOUSEPORT pInterface, uint8_t cContacts, + const uint64_t *pau64Contacts, uint32_t u32ScanTime) +{ + RT_NOREF(pInterface, cContacts, pau64Contacts, u32ScanTime); + AssertFailedReturn(VERR_NOT_SUPPORTED); +} + +/* -=-=-=-=-=- setup code -=-=-=-=-=- */ + + +/** + * @interface_method_impl{PDMDEVREGR3,pfnAttach} + */ +static DECLCALLBACK(int) bmsR3Attach(PPDMDEVINS pDevIns, unsigned iLUN, uint32_t fFlags) +{ + PBMSSTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PBMSSTATER3); + int rc; + + AssertMsgReturn(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG, + ("Bus mouse device does not support hotplugging\n"), + VERR_INVALID_PARAMETER); + + switch (iLUN) + { + /* LUN #0: mouse */ + case 0: + rc = PDMDevHlpDriverAttach(pDevIns, iLUN, &pThisCC->Mouse.IBase, &pThisCC->Mouse.pDrvBase, "Bus Mouse Port"); + if (RT_SUCCESS(rc)) + { + pThisCC->Mouse.pDrv = PDMIBASE_QUERY_INTERFACE(pThisCC->Mouse.pDrvBase, PDMIMOUSECONNECTOR); + if (!pThisCC->Mouse.pDrv) + { + AssertLogRelMsgFailed(("LUN #0 doesn't have a mouse interface! rc=%Rrc\n", rc)); + rc = VERR_PDM_MISSING_INTERFACE; + } + } + else if (rc == VERR_PDM_NO_ATTACHED_DRIVER) + { + LogRel(("%s/%d: Warning: no driver attached to LUN #0!\n", pDevIns->pReg->szName, pDevIns->iInstance)); + rc = VINF_SUCCESS; + } + else + AssertLogRelMsgFailed(("Failed to attach LUN #0! rc=%Rrc\n", rc)); + break; + + default: + AssertMsgFailed(("Invalid LUN #%d\n", iLUN)); + return VERR_PDM_NO_SUCH_LUN; + } + + return rc; +} + + +/** + * @interface_method_impl{PDMDEVREGR3,pfnDetach} + */ +static DECLCALLBACK(void) bmsR3Detach(PPDMDEVINS pDevIns, unsigned iLUN, uint32_t fFlags) +{ +# if 0 + /* + * Reset the interfaces and update the controller state. + */ + PBMSSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE); + switch (iLUN) + { + /* LUN #0: mouse */ + case 0: + pThis->Mouse.pDrv = NULL; + pThis->Mouse.pDrvBase = NULL; + break; + + default: + AssertMsgFailed(("Invalid LUN #%d\n", iLUN)); + break; + } +# else + RT_NOREF(pDevIns, iLUN, fFlags); +# endif +} + + +/** + * @interface_method_impl{PDMDEVREG,pfnConstruct} + */ +static DECLCALLBACK(int) bmsR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg) +{ + PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); + PBMSSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE); + PBMSSTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PBMSSTATER3); + PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; + int rc; + RT_NOREF(iInstance); + + Assert(iInstance == 0); + + /* + * Validate and read the configuration. + */ + PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "IRQ", ""); + + rc = pHlp->pfnCFGMQueryU8Def(pCfg, "IRQ", &pThis->irq, BMS_DEFAULT_IRQ); + if (RT_FAILURE(rc)) + return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to query \"IRQ\" from the config")); + if (pThis->irq < 2 || pThis->irq > 5) + return PDMDEV_SET_ERROR(pDevIns, rc, N_("Invalid \"IRQ\" config setting")); + + Log(("busmouse: IRQ=%u fRCEnabled=%RTbool fR0Enabled=%RTbool\n", pThis->irq, pDevIns->fRCEnabled, pDevIns->fR0Enabled)); + + /* + * Initialize the interfaces. + */ + pThisCC->pDevIns = pDevIns; + pThisCC->Mouse.IBase.pfnQueryInterface = bmsR3Base_QueryMouseInterface; + pThisCC->Mouse.IPort.pfnPutEvent = bmsR3MousePort_PutEvent; + pThisCC->Mouse.IPort.pfnPutEventAbs = bmsR3MousePort_PutEventAbs; + pThisCC->Mouse.IPort.pfnPutEventTouchScreen = bmsR3MousePort_PutEventMultiTouch; + pThisCC->Mouse.IPort.pfnPutEventTouchPad = bmsR3MousePort_PutEventMultiTouch; + + /* + * Create the interrupt timer. + */ + rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL, bmsR3TimerCallback, pThis, + TMTIMER_FLAGS_DEFAULT_CRIT_SECT | TMTIMER_FLAGS_NO_RING0, "Bus Mouse", &pThis->hMouseTimer); + AssertRCReturn(rc, rc); + + /* + * Register I/O ports. + */ + static const IOMIOPORTDESC s_aDescs[] = + { + { "DATA", "DATA", NULL, NULL }, + { "SIG", "SIG", NULL, NULL }, + { "CTRL", "CTRL", NULL, NULL }, + { "INIT", "INIT", NULL, NULL }, + { NULL, NULL, NULL, NULL } + }; + rc = PDMDevHlpIoPortCreateAndMap(pDevIns, BMS_IO_BASE, BMS_IO_SIZE, bmsIoPortWrite, bmsIoPortRead, + "Bus Mouse", s_aDescs, &pThis->hIoPorts); + AssertRCReturn(rc, rc); + + /* + * Register saved state. + */ + rc = PDMDevHlpSSMRegister(pDevIns, BMS_SAVED_STATE_VERSION, sizeof(*pThis), bmsR3SaveExec, bmsR3LoadExec); + AssertRCReturn(rc, rc); + + /* + * Attach to the mouse driver. + */ + rc = bmsR3Attach(pDevIns, 0, PDM_TACH_FLAGS_NOT_HOT_PLUG); + AssertRCReturn(rc, rc); + + /* + * Initialize the device state. + */ + bmsR3Reset(pDevIns); + + return VINF_SUCCESS; +} + +# else /* !IN_RING3 */ + +/** + * @callback_method_impl{PDMDEVREGR0,pfnConstruct} + */ +static DECLCALLBACK(int) bmsRZConstruct(PPDMDEVINS pDevIns) +{ + PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); + PBMSSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PBMSSTATE); + + int rc = PDMDevHlpIoPortSetUpContext(pDevIns, pThis->hIoPorts, bmsIoPortWrite, bmsIoPortRead, NULL /*pvUser*/); + AssertRCReturn(rc, rc); + + return VINF_SUCCESS; +} + +# endif /* !IN_RING3 */ + + +/** + * The device registration structure. + */ +static const PDMDEVREG g_DeviceBusMouse = +{ + /* .u32Version = */ PDM_DEVREG_VERSION, + /* .uReserved0 = */ 0, + /* .szName = */ "busmouse", + /* .fFlags = */ PDM_DEVREG_FLAGS_DEFAULT_BITS /** @todo | PDM_DEVREG_FLAGS_RZ */ | PDM_DEVREG_FLAGS_NEW_STYLE, + /* .fClass = */ PDM_DEVREG_CLASS_INPUT, + /* .cMaxInstances = */ 1, + /* .uSharedVersion = */ 42, + /* .cbInstanceShared = */ sizeof(BMSSTATE), + /* .cbInstanceCC = */ CTX_EXPR(sizeof(BMSSTATER3), 0, 0), + /* .cbInstanceRC = */ 0, + /* .cMaxPciDevices = */ 0, + /* .cMaxMsixVectors = */ 0, + /* .pszDescription = */ "Microsoft Bus Mouse controller. LUN #0 is the mouse connector.", +# if defined(IN_RING3) + /* .pszRCMod = */ "VBoxDDRC.rc", + /* .pszR0Mod = */ "VBoxDDR0.r0", + /* .pfnConstruct = */ bmsR3Construct, + /* .pfnDestruct = */ NULL, + /* .pfnRelocate = */ NULL, + /* .pfnMemSetup = */ NULL, + /* .pfnPowerOn = */ NULL, + /* .pfnReset = */ bmsR3Reset, + /* .pfnSuspend = */ NULL, + /* .pfnResume = */ NULL, + /* .pfnAttach = */ bmsR3Attach, + /* .pfnDetach = */ bmsR3Detach, + /* .pfnQueryInterface = */ NULL, + /* .pfnInitComplete = */ NULL, + /* .pfnPowerOff = */ NULL, + /* .pfnSoftReset = */ NULL, + /* .pfnReserved0 = */ NULL, + /* .pfnReserved1 = */ NULL, + /* .pfnReserved2 = */ NULL, + /* .pfnReserved3 = */ NULL, + /* .pfnReserved4 = */ NULL, + /* .pfnReserved5 = */ NULL, + /* .pfnReserved6 = */ NULL, + /* .pfnReserved7 = */ NULL, +# elif defined(IN_RING0) + /* .pfnEarlyConstruct = */ NULL, + /* .pfnConstruct = */ bmsRZConstruct, + /* .pfnDestruct = */ NULL, + /* .pfnFinalDestruct = */ NULL, + /* .pfnRequest = */ NULL, + /* .pfnReserved0 = */ NULL, + /* .pfnReserved1 = */ NULL, + /* .pfnReserved2 = */ NULL, + /* .pfnReserved3 = */ NULL, + /* .pfnReserved4 = */ NULL, + /* .pfnReserved5 = */ NULL, + /* .pfnReserved6 = */ NULL, + /* .pfnReserved7 = */ NULL, +# elif defined(IN_RC) + /* .pfnConstruct = */ bmsRZConstruct, + /* .pfnReserved0 = */ NULL, + /* .pfnReserved1 = */ NULL, + /* .pfnReserved2 = */ NULL, + /* .pfnReserved3 = */ NULL, + /* .pfnReserved4 = */ NULL, + /* .pfnReserved5 = */ NULL, + /* .pfnReserved6 = */ NULL, + /* .pfnReserved7 = */ NULL, +# else +# error "Not in IN_RING3, IN_RING0 or IN_RC!" +# endif + /* .u32VersionEnd = */ PDM_DEVREG_VERSION +}; + +# ifdef VBOX_IN_EXTPACK_R3 + +/** + * @callback_method_impl{FNPDMVBOXDEVICESREGISTER} + */ +extern "C" DECLEXPORT(int) VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version) +{ + AssertLogRelMsgReturn(u32Version >= VBOX_VERSION, + ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION), + VERR_EXTPACK_VBOX_VERSION_MISMATCH); + AssertLogRelMsgReturn(pCallbacks->u32Version == PDM_DEVREG_CB_VERSION, + ("pCallbacks->u32Version=%#x PDM_DEVREG_CB_VERSION=%#x\n", pCallbacks->u32Version, PDM_DEVREG_CB_VERSION), + VERR_VERSION_MISMATCH); + + return pCallbacks->pfnRegister(pCallbacks, &g_DeviceBusMouse); +} + +# else /* !VBOX_IN_EXTPACK_R3 */ + +/** Pointer to the ring-0 device registrations for the Bus Mouse. */ +static PCPDMDEVREGR0 g_apDevRegs[] = +{ + &g_DeviceBusMouse, +}; + +/** Module device registration record for the Bus Mouse. */ +static PDMDEVMODREGR0 g_ModDevReg = +{ + /* .u32Version = */ PDM_DEVMODREGR0_VERSION, + /* .cDevRegs = */ RT_ELEMENTS(g_apDevRegs), + /* .papDevRegs = */ &g_apDevRegs[0], + /* .hMod = */ NULL, + /* .ListEntry = */ { NULL, NULL }, +}; + +DECLEXPORT(int) ModuleInit(void *hMod) +{ + LogFlow(("VBoxBusMouseRZ/ModuleInit: %p\n", hMod)); + return PDMR0DeviceRegisterModule(hMod, &g_ModDevReg); +} + +DECLEXPORT(void) ModuleTerm(void *hMod) +{ + LogFlow(("VBoxBusMouseRZ/ModuleTerm: %p\n", hMod)); + PDMR0DeviceDeregisterModule(hMod, &g_ModDevReg); +} + +# endif /* !VBOX_IN_EXTPACK_R3 */ + +#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */ + diff --git a/src/VBox/ExtPacks/BusMouseSample/ExtPack.xml b/src/VBox/ExtPacks/BusMouseSample/ExtPack.xml new file mode 100644 index 00000000..0ceba0a5 --- /dev/null +++ b/src/VBox/ExtPacks/BusMouseSample/ExtPack.xml @@ -0,0 +1,10 @@ + + + BusMouse + The bus mouse sample extension pack. + @VBOX_VERSION_STRING@ + VBoxBusMouseMain + VBoxBusMouseMainVM + + + diff --git a/src/VBox/ExtPacks/BusMouseSample/Makefile.kmk b/src/VBox/ExtPacks/BusMouseSample/Makefile.kmk new file mode 100644 index 00000000..16118996 --- /dev/null +++ b/src/VBox/ExtPacks/BusMouseSample/Makefile.kmk @@ -0,0 +1,203 @@ +# $Id: Makefile.kmk $ +## @file +# Sub-Makefile for the Bus Mouse Extension Pack Sample. +# + +# +# Copyright (C) 2010-2023 Oracle and/or its affiliates. +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# + +SUB_DEPTH = ../../../.. +include $(KBUILD_PATH)/subheader.kmk + +# +# Extend the extension pack templates. +# +TEMPLATE_VBoxR3ExtPackBusMouse = For the ring-3 context modules in the Bus Mouse extension pack. +TEMPLATE_VBoxR3ExtPackBusMouse_EXTENDS = VBoxR3ExtPack +TEMPLATE_VBoxR3ExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ + +TEMPLATE_VBoxR0ExtPackBusMouse = For the ring-0 context modules in the Bus Mouse extension pack. +TEMPLATE_VBoxR0ExtPackBusMouse_EXTENDS = VBoxR0ExtPack +TEMPLATE_VBoxR0ExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ + +TEMPLATE_VBoxRcExtPackBusMouse = For the raw-mode context modules in the Bus Mouse extension pack. +TEMPLATE_VBoxRcExtPackBusMouse_EXTENDS = VBoxRcExtPack +TEMPLATE_VBoxRcExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ + +TEMPLATE_VBoxInsExtPackBusMouse = For the install targets of an extension pack. +TEMPLATE_VBoxInsExtPackBusMouse_EXTENDS = VBoxR0ExtPack +TEMPLATE_VBoxInsExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/ + +# +# Globals. +# +VBOX_BUSMOUSE_NAME = BusMouse +VBOX_BUSMOUSE_MANGLED_NAME = BusMouse +VBOX_PATH_EXTPACK_BUSMOUSE = $(PATH_STAGE)/$(INST_EXTPACK)BusMouse + + +# +# VBoxBusMouseMain - The module which the VirtualBox Main API talks to. +# +DLLS += VBoxBusMouseMain +VBoxBusMouseMain_TEMPLATE = VBoxR3ExtPackBusMouse +VBoxBusMouseMain_SOURCES = VBoxBusMouseMain.cpp +VBoxBusMouseMain_DEFS = + + +# +# VBoxBusMouseMainVM - The module in a VM which the VirtualBox Main API talks to. +# +DLLS += VBoxBusMouseMainVM +VBoxBusMouseMainVM_TEMPLATE = VBoxR3ExtPackBusMouse +VBoxBusMouseMainVM_SOURCES = VBoxBusMouseMainVM.cpp +VBoxBusMouseMainVM_DEFS = + + +# +# The device code. +# +DLLS += VBoxBusMouseR3 +VBoxBusMouseR3_TEMPLATE = VBoxR3ExtPackBusMouse +VBoxBusMouseR3_SOURCES = DevBusMouse.cpp + +ifdef VBOX_WITH_R0_MODULES + ifdef VBOX_WITH_VBOXR0_AS_DLL + DLLS += VBoxBusMouseR0 + else + SYSMODS += VBoxBusMouseR0 + endif + VBoxBusMouseR0_TEMPLATE = VBoxR0ExtPackBusMouse + VBoxBusMouseR0_SOURCES = DevBusMouse.cpp +endif + +ifdef VBOX_WITH_RAW_MODE + SYSMODS += VBoxBusMouseRC + VBoxBusMouseRC_TEMPLATE = VBoxRcExtPackBusMouse + VBoxBusMouseRC_SOURCES = DevBusMouse.cpp +endif + + +# +# Install the description. +# +INSTALLS += VBoxBusMouseIns +VBoxBusMouseIns_TEMPLATE = VBoxInsExtPackBusMouse +VBoxBusMouseIns_SOURCES = \ + $(VBoxBusMouseIns_0_OUTDIR)/ExtPack.xml +$(call VBOX_EDIT_VERSION_RULE_FN,VBoxBusMouseIns,ExtPack.xml) + + +# +# Packing. +# +ifndef VBOX_WITHOUT_EXTPACK_BUSMOUSE_PACKING + PACKING += $(VBOX_PATH_PACKAGES)/$(VBOX_BUSMOUSE_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack +endif + +ifndef VBOX_WITH_EXTPACK_OS_ARCHS + ifeq ($(USER),bird) # for now + VBOX_WITH_EXTPACK_OS_ARCHS = $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) + endif +endif + +# Build the file list. The macro takes 1=darwin.x86, 2=dist/VirtualBox.app/Contents/MacOS, 3=dylib +VBOX_BUSMOUSE_FILES_MACRO = \ + $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseMain.$(3)=>$(1)/VBoxBusMouseMain.$(3) \ + $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseMainVM.$(3)=>$(1)/VBoxBusMouseMainVM.$(3) \ + $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseR3.$(3)=>$(1)/VBoxBusMouseR3.$(3) \ + $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseR0.r0=>$(1)/VBoxBusMouseR0.r0 +ifdef VBOX_WITH_RAW_MODE + VBOX_BUSMOUSE_FILES_MACRO += \ + $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseRC.rc=>$(1)/VBoxBusMouseRC.rc +endif + +VBOX_BUSMOUSE_FILES := \ + $(VBOX_PATH_EXTPACK_BUSMOUSE)/ExtPack.xml=>ExtPack.xml + +if1of (darwin.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,darwin.amd64,dist/VirtualBox.app/Contents/MacOS,dylib) +endif +if1of (darwin.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,darwin.x86,dist/VirtualBox.app/Contents/MacOS,dylib) +endif +if1of (freebsd.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,freebsd.amd64,bin,so) +endif +if1of (freebsd.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,freebsd.x86,bin,so) +endif +if1of (linux.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,linux.amd64,bin,so) +endif +if1of (linux.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,linux.x86,bin,so) +endif +if1of (os2.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,os2.x86,bin,so) +endif +if1of (solaris.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,solaris.amd64,bin,so) +endif +if1of (solaris.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,solaris.x86,bin,so) +endif +if1of (win.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,win.amd64,bin,dll) +endif +if1of (win.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,win.x86,bin,dll) +endif + +# Pack it all up using a temporary staging directory. +$(VBOX_PATH_PACKAGES)/$(VBOX_BUSMOUSE_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack: \ + $$(foreach file, $$(VBOX_BUSMOUSE_FILES), $$(firstword $$(subst =>,$$(SP),$$(file)))) \ + | $(VBOX_PATH_PACKAGES)/ + $(RM) -f $(wildcard $(VBOX_PATH_PACKAGES)/$(VBOX_BUSMOUSE_MANGLED_NAME)-*.vbox-extpack) \ + $(VBoxBusMouseIns_0_OUTDIR)/ExtPack.manifest \ + $(VBoxBusMouseIns_0_OUTDIR)/ExtPack.signature +# Stage all the files + $(RM) -Rf $(VBoxBusMouseIns_0_OUTDIR)/Stage/ + $(foreach file, $(VBOX_BUSMOUSE_FILES),\ + $(NLTAB)$(MKDIR) -p $(dir $(lastword $(subst =>,$(SP)$(VBoxBusMouseIns_0_OUTDIR)/Stage/,$(file)))) \ + $(NLTAB)$(CP) $(subst =>,$(SP)$(VBoxBusMouseIns_0_OUTDIR)/Stage/,$(file)) ) +# Create the manifest + $(VBOX_RTMANIFEST) \ + --manifest $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.manifest \ + --chdir $(VBoxBusMouseIns_0_OUTDIR)/Stage/ \ + $(foreach file, $(VBOX_BUSMOUSE_FILES), $(lastword $(subst =>,$(SP),$(file)))) + $(APPEND) $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.signature "todo" + $(CHMOD) a+r \ + $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.manifest \ + $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.signature +# Tar it up. + tar -cvf - -C $(VBoxBusMouseIns_0_OUTDIR)/Stage/ . | gzip -9c > $@ +# Clean up + $(RM) -Rf $(VBoxBusMouseIns_0_OUTDIR)/Stage/ + +BLDDIRS += $(VBOX_PATH_PACKAGES)/ + +include $(FILE_KBUILD_SUB_FOOTER) + diff --git a/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp b/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp new file mode 100644 index 00000000..4a4e0100 --- /dev/null +++ b/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp @@ -0,0 +1,130 @@ +/* $Id: VBoxBusMouseMain.cpp $ */ +/** @file + * Bus Mouse main module. + */ + +/* + * Copyright (C) 2010-2023 Oracle and/or its affiliates. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +/********************************************************************************************************************************* +* Header Files * +*********************************************************************************************************************************/ +#include + +#include +#include +#include +#include +#include + + +/********************************************************************************************************************************* +* Global Variables * +*********************************************************************************************************************************/ +/** Pointer to the extension pack helpers. */ +static PCVBOXEXTPACKHLP g_pHlp; + + +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnInstalled} +// */ +// static DECLCALLBACK(void) vboxBusMouseExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, PRTERRINFO pErrInfo); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnUninstall} +// */ +// static DECLCALLBACK(int) vboxBusMouseExtPack_Uninstall(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnVirtualBoxReady} +// */ +// static DECLCALLBACK(void) vboxBusMouseExtPack_VirtualBoxReady(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnUnload} +// */ +// static DECLCALLBACK(void) vboxBusMouseExtPack_Unload(PCVBOXEXTPACKREG pThis); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnVMCreated} +// */ +// static DECLCALLBACK(int) vboxBusMouseExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, VBOXEXTPACK_IF_CS(IMachine) *pMachine); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnQueryObject} +// */ +// static DECLCALLBACK(void) vboxBusMouseExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); + + +static const VBOXEXTPACKREG g_vboxBusMouseExtPackReg = +{ + VBOXEXTPACKREG_VERSION, + /* .uVBoxFullVersion = */ VBOX_FULL_VERSION, + /* .pszNlsBaseName = */ NULL, + /* .pfnInstalled = */ NULL, + /* .pfnUninstall = */ NULL, + /* .pfnVirtualBoxReady =*/ NULL, + /* .pfnUnload = */ NULL, + /* .pfnVMCreated = */ NULL, + /* .pfnQueryObject = */ NULL, + /* .pfnReserved1 = */ NULL, + /* .pfnReserved2 = */ NULL, + /* .pfnReserved3 = */ NULL, + /* .pfnReserved4 = */ NULL, + /* .pfnReserved5 = */ NULL, + /* .pfnReserved6 = */ NULL, + /* .uReserved7 = */ 0, + VBOXEXTPACKREG_VERSION +}; + + +/** @callback_method_impl{FNVBOXEXTPACKREGISTER} */ +extern "C" DECLEXPORT(int) VBoxExtPackRegister(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKREG *ppReg, PRTERRINFO pErrInfo) +{ + /* + * Check the VirtualBox version. + */ + if (!VBOXEXTPACK_IS_VER_COMPAT(pHlp->u32Version, VBOXEXTPACKHLP_VERSION)) + return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH, + "Helper version mismatch - expected %#x got %#x", + VBOXEXTPACKHLP_VERSION, pHlp->u32Version); + if ( VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MAJOR + || VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MINOR) + return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH, + "VirtualBox version mismatch - expected %u.%u got %u.%u", + VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, + VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion), + VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion)); + + /* + * We're good, save input and return the registration structure. + */ + g_pHlp = pHlp; + *ppReg = &g_vboxBusMouseExtPackReg; + + return VINF_SUCCESS; +} + diff --git a/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMainVM.cpp b/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMainVM.cpp new file mode 100644 index 00000000..1f661a2f --- /dev/null +++ b/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMainVM.cpp @@ -0,0 +1,175 @@ +/* $Id: VBoxBusMouseMainVM.cpp $ */ +/** @file + * Bus Mouse main VM module. + */ + +/* + * Copyright (C) 2010-2023 Oracle and/or its affiliates. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +/********************************************************************************************************************************* +* Header Files * +*********************************************************************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include + + +/********************************************************************************************************************************* +* Global Variables * +*********************************************************************************************************************************/ +/** Pointer to the extension pack helpers. */ +static PCVBOXEXTPACKHLP g_pHlp; + + +// /** +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnConsoleReady} +// */ +// static DECLCALLBACK(void) vboxBusMouseExtPackVM_ConsoleReady(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole); +// +// /** +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnUnload} +// */ +// static DECLCALLBACK(void) vboxBusMouseExtPackVM_Unload(PCVBOXEXTPACKVMREG pThis); + +/** + * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMConfigureVMM + */ +static DECLCALLBACK(int) vboxBusMouseExtPackVM_VMConfigureVMM(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, + PVM pVM, PCVMMR3VTABLE pVMM) +{ + RT_NOREF(pThis, pConsole); + + /* + * Find the bus mouse module and tell PDM to load it. + * ASSUME /PDM/Devices exists. + */ + char szPath[RTPATH_MAX]; + int rc = g_pHlp->pfnFindModule(g_pHlp, "VBoxBusMouseR3", NULL, VBOXEXTPACKMODKIND_R3, szPath, sizeof(szPath), NULL); + if (RT_FAILURE(rc)) + return rc; + + PCFGMNODE pCfgRoot = pVMM->pfnCFGMR3GetRoot(pVM); + AssertReturn(pCfgRoot, VERR_INTERNAL_ERROR_3); + + PCFGMNODE pCfgDevices = pVMM->pfnCFGMR3GetChild(pCfgRoot, "PDM/Devices"); + AssertReturn(pCfgDevices, VERR_INTERNAL_ERROR_3); + + PCFGMNODE pCfgMine; + rc = pVMM->pfnCFGMR3InsertNode(pCfgDevices, "VBoxBusMouse", &pCfgMine); + AssertRCReturn(rc, rc); + rc = pVMM->pfnCFGMR3InsertString(pCfgMine, "Path", szPath); + AssertRCReturn(rc, rc); + + /* + * Tell PDM where to find the R0 and RC modules for the bus mouse device. + */ +#ifdef VBOX_WITH_RAW_MODE + rc = g_pHlp->pfnFindModule(g_pHlp, "VBoxBusMouseRC", NULL, VBOXEXTPACKMODKIND_RC, szPath, sizeof(szPath), NULL); + AssertRCReturn(rc, rc); + RTPathStripFilename(szPath); + rc = pVMM->pfnCFGMR3InsertString(pCfgMine, "RCSearchPath", szPath); + AssertRCReturn(rc, rc); +#endif + + rc = g_pHlp->pfnFindModule(g_pHlp, "VBoxBusMouseR0", NULL, VBOXEXTPACKMODKIND_R0, szPath, sizeof(szPath), NULL); + AssertRCReturn(rc, rc); + RTPathStripFilename(szPath); + rc = pVMM->pfnCFGMR3InsertString(pCfgMine, "R0SearchPath", szPath); + AssertRCReturn(rc, rc); + + return VINF_SUCCESS; +} + +// /** +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMPowerOn} +// */ +// static DECLCALLBACK(int) vboxBusMouseExtPackVM_VMPowerOn(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); +// +// /** +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMPowerOff} +// */ +// static DECLCALLBACK(void) vboxBusMouseExtPackVM_VMPowerOff(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); +// +// /** +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnQueryObject} +// */ +// static DECLCALLBACK(void) vboxBusMouseExtPackVM_QueryObject(PCVBOXEXTPACKVMREG pThis, PCRTUUID pObjectId); + + +static const VBOXEXTPACKVMREG g_vboxBusMouseExtPackVMReg = +{ + VBOXEXTPACKVMREG_VERSION, + /* .uVBoxFullVersion = */ VBOX_FULL_VERSION, + /* .pszNlsBaseName = */ NULL, + /* .pfnConsoleReady = */ NULL, + /* .pfnUnload = */ NULL, + /* .pfnVMConfigureVMM = */ vboxBusMouseExtPackVM_VMConfigureVMM, + /* .pfnVMPowerOn = */ NULL, + /* .pfnVMPowerOff = */ NULL, + /* .pfnQueryObject = */ NULL, + /* .pfnReserved1 = */ NULL, + /* .pfnReserved2 = */ NULL, + /* .pfnReserved3 = */ NULL, + /* .pfnReserved4 = */ NULL, + /* .pfnReserved5 = */ NULL, + /* .pfnReserved6 = */ NULL, + /* .uReserved7 = */ 0, + VBOXEXTPACKVMREG_VERSION +}; + + +/** @callback_method_impl{FNVBOXEXTPACKVMREGISTER} */ +extern "C" DECLEXPORT(int) VBoxExtPackVMRegister(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKVMREG *ppReg, PRTERRINFO pErrInfo) +{ + /* + * Check the VirtualBox version. + */ + if (!VBOXEXTPACK_IS_VER_COMPAT(pHlp->u32Version, VBOXEXTPACKHLP_VERSION)) + return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH, + "Helper version mismatch - expected %#x got %#x", + VBOXEXTPACKHLP_VERSION, pHlp->u32Version); + if ( VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MAJOR + || VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MINOR) + return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH, + "VirtualBox version mismatch - expected %u.%u got %u.%u", + VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, + VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion), + VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion)); + + /* + * We're good, save input and return the registration structure. + */ + g_pHlp = pHlp; + *ppReg = &g_vboxBusMouseExtPackVMReg; + + return VINF_SUCCESS; +} + diff --git a/src/VBox/ExtPacks/Makefile.kmk b/src/VBox/ExtPacks/Makefile.kmk new file mode 100644 index 00000000..63c06c6b --- /dev/null +++ b/src/VBox/ExtPacks/Makefile.kmk @@ -0,0 +1,45 @@ +# $Id: Makefile.kmk $ +## @file +# Sub-Makefile for the Extension Packs. +# + +# +# Copyright (C) 2010-2023 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# SPDX-License-Identifier: GPL-3.0-only +# + +SUB_DEPTH = ../../.. +include $(KBUILD_PATH)/subheader.kmk + +ifdef VBOX_WITH_EXTPACK_PUEL_BUILD + include $(PATH_SUB_CURRENT)/Puel/Makefile.kmk +endif +if defined(VBOX_WITH_R0_MODULES) && (defined(VBOX_WITH_EXTPACK_VBOXDTRACE) || defined(VBOX_WITH_DTRACE)) + include $(PATH_SUB_CURRENT)/VBoxDTrace/Makefile.kmk +endif +ifdef VBOX_WITH_EXTPACK_VNC + include $(PATH_SUB_CURRENT)/VNC/Makefile.kmk +endif +ifdef VBOX_WITH_EXTPACK_BUSMOUSESAMPLE + include $(PATH_SUB_CURRENT)/BusMouseSample/Makefile.kmk +endif + +include $(FILE_KBUILD_SUB_FOOTER) + diff --git a/src/VBox/ExtPacks/Skeleton/.scm-settings b/src/VBox/ExtPacks/Skeleton/.scm-settings new file mode 100644 index 00000000..14dcf95b --- /dev/null +++ b/src/VBox/ExtPacks/Skeleton/.scm-settings @@ -0,0 +1,33 @@ +# $Id: .scm-settings $ +## @file +# Source code massager settings for extension pack skeleton. +# + +# +# Copyright (C) 2010-2023 Oracle and/or its affiliates. +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# + +# This directory contains sample code and are therefore under MIT license. +--license-mit + diff --git a/src/VBox/ExtPacks/Skeleton/ExtPack.xml b/src/VBox/ExtPacks/Skeleton/ExtPack.xml new file mode 100644 index 00000000..a8e8726b --- /dev/null +++ b/src/VBox/ExtPacks/Skeleton/ExtPack.xml @@ -0,0 +1,11 @@ + + + Skeleton + The extension pack skeleton sample. + @VBOX_VERSION_STRING@ + VBoxSkeletonMain + VBoxSkeletonMainVM + + + + diff --git a/src/VBox/ExtPacks/Skeleton/Makefile.kmk b/src/VBox/ExtPacks/Skeleton/Makefile.kmk new file mode 100644 index 00000000..1dd4ba8c --- /dev/null +++ b/src/VBox/ExtPacks/Skeleton/Makefile.kmk @@ -0,0 +1,171 @@ +# $Id: Makefile.kmk $ +## @file +# Sub-Makefile for the Skeleton Extension Pack Sample. +# + +# +# Copyright (C) 2010-2023 Oracle and/or its affiliates. +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# + +SUB_DEPTH = ../../../.. +include $(KBUILD_PATH)/subheader.kmk + +# +# Extend the extension pack templates. +# +TEMPLATE_VBoxR3ExtPackSkeleton = For the ring-3 context modules in the Skeleton extension pack. +TEMPLATE_VBoxR3ExtPackSkeleton_EXTENDS = VBoxR3ExtPack +TEMPLATE_VBoxR3ExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ + +TEMPLATE_VBoxR0ExtPackSkeleton = For the ring-0 context modules in the Skeleton extension pack. +TEMPLATE_VBoxR0ExtPackSkeleton_EXTENDS = VBoxR0ExtPack +TEMPLATE_VBoxR0ExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ + +TEMPLATE_VBoxRcExtPackSkeleton = For the raw-mode context modules in the Skeleton extension pack. +TEMPLATE_VBoxRcExtPackSkeleton_EXTENDS = VBoxRcExtPack +TEMPLATE_VBoxRcExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ + +TEMPLATE_VBoxInsExtPackSkeleton = For the install targets of an extension pack. +TEMPLATE_VBoxInsExtPackSkeleton_EXTENDS = VBoxR0ExtPack +TEMPLATE_VBoxInsExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/ + +# +# Globals. +# +VBOX_SKELETON_NAME = Skeleton +VBOX_SKELETON_MANGLED_NAME = Skeleton +VBOX_PATH_EXTPACK_SKELETON = $(PATH_STAGE)/$(INST_EXTPACK)Skeleton + + +# +# VBoxSkeletonMain - The module which the VirtualBox Main API talks to. +# +DLLS += VBoxSkeletonMain +VBoxSkeletonMain_TEMPLATE = VBoxR3ExtPackSkeleton +VBoxSkeletonMain_SOURCES = VBoxSkeletonMain.cpp +VBoxSkeletonMain_DEFS = + +# +# VBoxSkeletonMainVM - The module in a VM which the VirtualBox Main API talks to. +# +DLLS += VBoxSkeletonMainVM +VBoxSkeletonMainVM_TEMPLATE = VBoxR3ExtPackSkeleton +VBoxSkeletonMainVM_SOURCES = VBoxSkeletonMainVM.cpp +VBoxSkeletonMainVM_DEFS = + +# +# Install the description. +# +INSTALLS += VBoxSkeletonIns +VBoxSkeletonIns_TEMPLATE = VBoxInsExtPackSkeleton +VBoxSkeletonIns_SOURCES = \ + $(VBoxSkeletonIns_0_OUTDIR)/ExtPack.xml +$(call VBOX_EDIT_VERSION_RULE_FN,VBoxSkeletonIns,ExtPack.xml) + + +# +# Packing. +# +ifndef VBOX_WITHOUT_EXTPACK_SKELETON_PACKING + PACKING += $(VBOX_PATH_PACKAGES)/$(VBOX_SKELETON_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack +endif + +ifndef VBOX_WITH_EXTPACK_OS_ARCHS + ifeq ($(USER),bird) # for now + VBOX_WITH_EXTPACK_OS_ARCHS = $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) + endif +endif + +# Build the file list. The macro takes 1=darwin.x86, 2=dist/VirtualBox.app/Contents/MacOS, 3=dylib +VBOX_SKELETON_FILES_MACRO = \ + $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_SKELETON_MANGLED_NAME)/$(1)/VBoxSkeletonMain.$(3)=>$(1)/VBoxSkeletonMain.$(3) \ + $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_SKELETON_MANGLED_NAME)/$(1)/VBoxSkeletonMainVM.$(3)=>$(1)/VBoxSkeletonMainVM.$(3) + +VBOX_SKELETON_FILES := \ + $(VBOX_PATH_EXTPACK_SKELETON)/ExtPack.xml=>ExtPack.xml + +if1of (darwin.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,darwin.amd64,dist/VirtualBox.app/Contents/MacOS,dylib) +endif +if1of (darwin.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,darwin.x86,dist/VirtualBox.app/Contents/MacOS,dylib) +endif +if1of (freebsd.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,freebsd.amd64,bin,so) +endif +if1of (freebsd.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,freebsd.x86,bin,so) +endif +if1of (linux.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,linux.amd64,bin,so) +endif +if1of (linux.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,linux.x86,bin,so) +endif +if1of (os2.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,os2.x86,bin,so) +endif +if1of (solaris.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,solaris.amd64,bin,so) +endif +if1of (solaris.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,solaris.x86,bin,so) +endif +if1of (win.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,win.amd64,bin,dll) +endif +if1of (win.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,win.x86,bin,dll) +endif + +# Pack it all up using a temporary staging directory. +$(VBOX_PATH_PACKAGES)/$(VBOX_SKELETON_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack: \ + $$(foreach file, $$(VBOX_SKELETON_FILES), $$(firstword $$(subst =>,$$(SP),$$(file)))) \ + | $(VBOX_PATH_PACKAGES)/ + $(RM) -f $(wildcard $(VBOX_PATH_PACKAGES)/$(VBOX_SKELETON_MANGLED_NAME)-*.vbox-extpack) \ + $(VBoxSkeletonIns_0_OUTDIR)/ExtPack.manifest \ + $(VBoxSkeletonIns_0_OUTDIR)/ExtPack.signature +# Stage all the files + $(RM) -Rf $(VBoxSkeletonIns_0_OUTDIR)/Stage/ + $(foreach file, $(VBOX_SKELETON_FILES),\ + $(NLTAB)$(MKDIR) -p $(dir $(lastword $(subst =>,$(SP)$(VBoxSkeletonIns_0_OUTDIR)/Stage/,$(file)))) \ + $(NLTAB)$(CP) $(subst =>,$(SP)$(VBoxSkeletonIns_0_OUTDIR)/Stage/,$(file)) ) +# Create the manifest + $(VBOX_RTMANIFEST) \ + --manifest $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.manifest \ + --chdir $(VBoxSkeletonIns_0_OUTDIR)/Stage/ \ + $(foreach file, $(VBOX_SKELETON_FILES), $(lastword $(subst =>,$(SP),$(file)))) + $(APPEND) $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.signature "todo" + $(CHMOD) a+r \ + $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.manifest \ + $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.signature +# Tar it up. + tar -cvf - -C $(VBoxSkeletonIns_0_OUTDIR)/Stage/ . | gzip -9c > $@ +# Clean up + $(RM) -Rf $(VBoxSkeletonIns_0_OUTDIR)/Stage/ + +BLDDIRS += $(VBOX_PATH_PACKAGES)/ + +include $(FILE_KBUILD_SUB_FOOTER) + diff --git a/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp b/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp new file mode 100644 index 00000000..9d7d8d5b --- /dev/null +++ b/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp @@ -0,0 +1,130 @@ +/* $Id: VBoxSkeletonMain.cpp $ */ +/** @file + * Skeleton main module. + */ + +/* + * Copyright (C) 2010-2023 Oracle and/or its affiliates. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +/********************************************************************************************************************************* +* Header Files * +*********************************************************************************************************************************/ +#include + +#include +#include +#include +#include +#include + + +/********************************************************************************************************************************* +* Global Variables * +*********************************************************************************************************************************/ +/** Pointer to the extension pack helpers. */ +static PCVBOXEXTPACKHLP g_pHlp; + + +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnInstalled} +// */ +// static DECLCALLBACK(void) vboxSkeletonExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, PRTERRINFO pErrInfo); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnUninstall} +// */ +// static DECLCALLBACK(int) vboxSkeletonExtPack_Uninstall(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnVirtualBoxReady} +// */ +// static DECLCALLBACK(void) vboxSkeletonExtPack_VirtualBoxReady(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnUnload} +// */ +// static DECLCALLBACK(void) vboxSkeletonExtPack_Unload(PCVBOXEXTPACKREG pThis); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnVMCreated} +// */ +// static DECLCALLBACK(int) vboxSkeletonExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, VBOXEXTPACK_IF_CS(IMachine) *pMachine); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnQueryObject} +// */ +// static DECLCALLBACK(int) vboxSkeletonExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); + + +static const VBOXEXTPACKREG g_vboxSkeletonExtPackReg = +{ + VBOXEXTPACKREG_VERSION, + /* .uVBoxFullVersion = */ VBOX_FULL_VERSION, + /* .pszNlsBaseName = */ NULL, + /* .pfnInstalled = */ NULL, + /* .pfnUninstall = */ NULL, + /* .pfnVirtualBoxReady =*/ NULL, + /* .pfnUnload = */ NULL, + /* .pfnVMCreated = */ NULL, + /* .pfnQueryObject = */ NULL, + /* .pfnReserved1 = */ NULL, + /* .pfnReserved2 = */ NULL, + /* .pfnReserved3 = */ NULL, + /* .pfnReserved4 = */ NULL, + /* .pfnReserved5 = */ NULL, + /* .pfnReserved6 = */ NULL, + /* .uReserved7 = */ 0, + VBOXEXTPACKREG_VERSION +}; + + +/** @callback_method_impl{FNVBOXEXTPACKREGISTER} */ +extern "C" DECLEXPORT(int) VBoxExtPackRegister(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKREG *ppReg, PRTERRINFO pErrInfo) +{ + /* + * Check the VirtualBox version. + */ + if (!VBOXEXTPACK_IS_VER_COMPAT(pHlp->u32Version, VBOXEXTPACKHLP_VERSION)) + return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH, + "Helper version mismatch - expected %#x got %#x", + VBOXEXTPACKHLP_VERSION, pHlp->u32Version); + if ( VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MAJOR + || VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MINOR) + return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH, + "VirtualBox version mismatch - expected %u.%u got %u.%u", + VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, + VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion), + VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion)); + + /* + * We're good, save input and return the registration structure. + */ + g_pHlp = pHlp; + *ppReg = &g_vboxSkeletonExtPackReg; + + return VINF_SUCCESS; +} + diff --git a/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMainVM.cpp b/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMainVM.cpp new file mode 100644 index 00000000..56063db1 --- /dev/null +++ b/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMainVM.cpp @@ -0,0 +1,130 @@ +/* $Id: VBoxSkeletonMainVM.cpp $ */ +/** @file + * Skeleton main VM module. + */ + +/* + * Copyright (C) 2010-2023 Oracle and/or its affiliates. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +/********************************************************************************************************************************* +* Header Files * +*********************************************************************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include + + +/********************************************************************************************************************************* +* Global Variables * +*********************************************************************************************************************************/ +/** Pointer to the extension pack helpers. */ +static PCVBOXEXTPACKHLP g_pHlp; + + +// /** +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnConsoleReady} +// */ +// static DECLCALLBACK(void) vboxSkeletonExtPackVM_ConsoleReady(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole); +// +// /** +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnUnload} +// */ +// static DECLCALLBACK(void) vboxSkeletonExtPackVM_Unload(PCVBOXEXTPACKVMREG pThis); +// +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMConfigureVMM} +// */ +// static DECLCALLBACK(int) vboxSkeletonExtPackVM_VMConfigureVMM(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); +// +// /** +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMPowerOn} +// */ +// static DECLCALLBACK(int) vboxSkeletonExtPackVM_VMPowerOn(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); +// +// /** +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnVMPowerOff} +// */ +// static DECLCALLBACK(void) vboxSkeletonExtPackVM_VMPowerOff(PCVBOXEXTPACKVMREG pThis, VBOXEXTPACK_IF_CS(IConsole) *pConsole, PVM pVM); +// +// /** +// * @interface_method_impl{VBOXEXTPACKVMREG,pfnQueryObject} +// */ +// static DECLCALLBACK(void) vboxSkeletonExtPackVM_QueryObject(PCVBOXEXTPACKVMREG pThis, PCRTUUID pObjectId); + + +static const VBOXEXTPACKVMREG g_vboxSkeletonExtPackVMReg = +{ + VBOXEXTPACKVMREG_VERSION, + /* .uVBoxFullVersion = */ VBOX_FULL_VERSION, + /* .pszNlsBaseName = */ NULL, + /* .pfnConsoleReady = */ NULL, + /* .pfnUnload = */ NULL, + /* .pfnVMConfigureVMM = */ NULL, + /* .pfnVMPowerOn = */ NULL, + /* .pfnVMPowerOff = */ NULL, + /* .pfnQueryObject = */ NULL, + /* .pfnReserved1 = */ NULL, + /* .pfnReserved2 = */ NULL, + /* .pfnReserved3 = */ NULL, + /* .pfnReserved4 = */ NULL, + /* .pfnReserved5 = */ NULL, + /* .pfnReserved6 = */ NULL, + /* .uReserved7 = */ 0, + VBOXEXTPACKVMREG_VERSION +}; + + +/** @callback_method_impl{FNVBOXEXTPACKVMREGISTER} */ +extern "C" DECLEXPORT(int) VBoxExtPackVMRegister(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKVMREG *ppReg, PRTERRINFO pErrInfo) +{ + /* + * Check the VirtualBox version. + */ + if (!VBOXEXTPACK_IS_VER_COMPAT(pHlp->u32Version, VBOXEXTPACKHLP_VERSION)) + return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH, + "Helper version mismatch - expected %#x got %#x", + VBOXEXTPACKHLP_VERSION, pHlp->u32Version); + if ( VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MAJOR + || VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MINOR) + return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH, + "VirtualBox version mismatch - expected %u.%u got %u.%u", + VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, + VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion), + VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion)); + + /* + * We're good, save input and return the registration structure. + */ + g_pHlp = pHlp; + *ppReg = &g_vboxSkeletonExtPackVMReg; + + return VINF_SUCCESS; +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/.scm-settings b/src/VBox/ExtPacks/VBoxDTrace/.scm-settings new file mode 100644 index 00000000..0dc13d36 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/.scm-settings @@ -0,0 +1,34 @@ +# $Id: .scm-settings $ +## @file +# Source code massager settings for VBoxDTrace. +# + +# +# Copyright (C) 2010-2023 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from http://www.virtualbox.org. +# +# The contents of this file are subject to the terms of the Common +# Development and Distribution License Version 1.0 (CDDL) only, as it +# comes in the "COPYING.CDDL" file of the VirtualBox distribution. +# +# SPDX-License-Identifier: CDDL-1.0 +# + + +--filter-out-dirs "/onnv/cmd/." +--filter-out-dirs "/onnv/common/." +--filter-out-dirs "/onnv/lib/." +--filter-out-dirs "/onnv/uts/." + +--filter-out-files "/generated/dt_*" +--filter-out-files "/CDDL-ONLY" + +# This is CDDL licensed +--license-ose-cddl +VBoxDTraceMain.cpp: --license-mit + +# MIT license on the samples. +/Samples/*: --license-mit + diff --git a/src/VBox/ExtPacks/VBoxDTrace/CDDL-ONLY b/src/VBox/ExtPacks/VBoxDTrace/CDDL-ONLY new file mode 100644 index 00000000..b36dbc60 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/CDDL-ONLY @@ -0,0 +1,2 @@ +The ExtPacks/VBoxDTrace sources are only licensed under the Common Development +and Distribution License, Version 1.0 (CDDL), see ExtPacks/COPYING for details. diff --git a/src/VBox/ExtPacks/VBoxDTrace/COPYING b/src/VBox/ExtPacks/VBoxDTrace/COPYING new file mode 100644 index 00000000..11f71082 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/COPYING @@ -0,0 +1,378 @@ +The ExtPacks/VBoxDTrace sources are licensed under the Common Development +and Distribution License, Version 1.0 (CDDL), as shown below. + +--- + + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0 + +1. Definitions. + + 1.1. "Contributor" means each individual or entity that creates + or contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Software, prior Modifications used by a Contributor (if any), + and the Modifications made by that particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or (b) + Modifications, or (c) the combination of files containing + Original Software with files containing Modifications, in + each case including portions thereof. + + 1.4. "Executable" means the Covered Software in any form other + than Source Code. + + 1.5. "Initial Developer" means the individual or entity that first + makes Original Software available under this License. + + 1.6. "Larger Work" means a work which combines Covered Software or + portions thereof with code not governed by the terms of this + License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed + herein. + + 1.9. "Modifications" means the Source Code and Executable form of + any of the following: + + A. Any file that results from an addition to, deletion from or + modification of the contents of a file containing Original + Software or previous Modifications; + + B. Any new file that contains any part of the Original + Software or previous Modifications; or + + C. Any new file that is contributed or otherwise made + available under the terms of this License. + + 1.10. "Original Software" means the Source Code and Executable + form of computer software code that is originally released + under this License. + + 1.11. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, + process, and apparatus claims, in any patent Licensable by + grantor. + + 1.12. "Source Code" means (a) the common form of computer software + code in which modifications are made and (b) associated + documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms + of, this License. For legal entities, "You" includes any + entity which controls, is controlled by, or is under common + control with You. For purposes of this definition, + "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by + contract or otherwise, or (b) ownership of more than fifty + percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, the Initial + Developer hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer, to use, + reproduce, modify, display, perform, sublicense and + distribute the Original Software (or portions thereof), + with or without Modifications, and/or as part of a Larger + Work; and + + (b) under Patent Claims infringed by the making, using or + selling of Original Software, to make, have made, use, + practice, sell, and offer for sale, and/or otherwise + dispose of the Original Software (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are + effective on the date Initial Developer first distributes + or otherwise makes the Original Software available to a + third party under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: (1) for code that You delete from the Original + Software, or (2) for infringements caused by: (i) the + modification of the Original Software, or (ii) the + combination of the Original Software with other software + or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, each + Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor to use, reproduce, + modify, display, perform, sublicense and distribute the + Modifications created by such Contributor (or portions + thereof), either on an unmodified basis, with other + Modifications, as Covered Software and/or as part of a + Larger Work; and + + (b) under Patent Claims infringed by the making, using, or + selling of Modifications made by that Contributor either + alone and/or in combination with its Contributor Version + (or portions of such combination), to make, use, sell, + offer for sale, have made, and/or otherwise dispose of: + (1) Modifications made by that Contributor (or portions + thereof); and (2) the combination of Modifications made by + that Contributor with its Contributor Version (or portions + of such combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are + effective on the date Contributor first distributes or + otherwise makes the Modifications available to a third + party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: (1) for any code that Contributor has deleted + from the Contributor Version; (2) for infringements caused + by: (i) third party modifications of Contributor Version, + or (ii) the combination of Modifications made by that + Contributor with other software (except as part of the + Contributor Version) or other devices; or (3) under Patent + Claims infringed by Covered Software in the absence of + Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make + available in Executable form must also be made available in Source + Code form and that Source Code form must be distributed only under + the terms of this License. You must include a copy of this + License with every copy of the Source Code form of the Covered + Software You distribute or otherwise make available. You must + inform recipients of any such Covered Software in Executable form + as to how they can obtain such Covered Software in Source Code + form in a reasonable manner on or through a medium customarily + used for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You contribute are + governed by the terms of this License. You represent that You + believe Your Modifications are Your original creation(s) and/or + You have sufficient rights to grant the rights conveyed by this + License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications that + identifies You as the Contributor of the Modification. You may + not remove or alter any copyright, patent or trademark notices + contained within the Covered Software, or any notices of licensing + or any descriptive text giving attribution to any Contributor or + the Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered Software in + Source Code form that alters or restricts the applicable version + of this License or the recipients' rights hereunder. You may + choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of + Covered Software. However, you may do so only on Your own behalf, + and not on behalf of the Initial Developer or any Contributor. + You must make it absolutely clear that any such warranty, support, + indemnity or liability obligation is offered by You alone, and You + hereby agree to indemnify the Initial Developer and every + Contributor for any liability incurred by the Initial Developer or + such Contributor as a result of warranty, support, indemnity or + liability terms You offer. + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered Software + under the terms of this License or under the terms of a license of + Your choice, which may contain terms different from this License, + provided that You are in compliance with the terms of this License + and that the license for the Executable form does not attempt to + limit or alter the recipient's rights in the Source Code form from + the rights set forth in this License. If You distribute the + Covered Software in Executable form under a different license, You + must make it absolutely clear that any terms which differ from + this License are offered by You alone, not by the Initial + Developer or Contributor. You hereby agree to indemnify the + Initial Developer and every Contributor for any liability incurred + by the Initial Developer or such Contributor as a result of any + such terms You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software with + other code not governed by the terms of this License and + distribute the Larger Work as a single product. In such a case, + You must make sure the requirements of this License are fulfilled + for the Covered Software. + +4. Versions of the License. + + 4.1. New Versions. + + Sun Microsystems, Inc. is the initial license steward and may + publish revised and/or new versions of this License from time to + time. Each version will be given a distinguishing version number. + Except as provided in Section 4.3, no one other than the license + steward has the right to modify this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise make the + Covered Software available under the terms of the version of the + License under which You originally received the Covered Software. + If the Initial Developer includes a notice in the Original + Software prohibiting it from being distributed or otherwise made + available under any subsequent version of the License, You must + distribute and make the Covered Software available under the terms + of the version of the License under which You originally received + the Covered Software. Otherwise, You may also choose to use, + distribute or otherwise make the Covered Software available under + the terms of any subsequent version of the License published by + the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a new + license for Your Original Software, You may create and use a + modified version of this License if You: (a) rename the license + and remove any references to the name of the license steward + (except to note that the license differs from this License); and + (b) otherwise make it clear that the license contains terms which + differ from this License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" + BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED + SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR + PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY + COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE + INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY + NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF + WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS + DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to + cure such breach within 30 days of becoming aware of the breach. + Provisions which, by their nature, must remain in effect beyond + the termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding + declaratory judgment actions) against Initial Developer or a + Contributor (the Initial Developer or Contributor against whom You + assert such claim is referred to as "Participant") alleging that + the Participant Software (meaning the Contributor Version where + the Participant is a Contributor or the Original Software where + the Participant is the Initial Developer) directly or indirectly + infringes any patent, then any and all rights granted directly or + indirectly to You by such Participant, the Initial Developer (if + the Initial Developer is not the Participant) and all Contributors + under Sections 2.1 and/or 2.2 of this License shall, upon 60 days + notice from Participant terminate prospectively and automatically + at the expiration of such 60 day notice period, unless if within + such 60 day period You withdraw Your claim with respect to the + Participant Software against such Participant either unilaterally + or pursuant to a written agreement with Participant. + + 6.3. In the event of termination under Sections 6.1 or 6.2 above, + all end user licenses that have been validly granted by You or any + distributor hereunder prior to termination (excluding licenses + granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE + INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF + COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE + LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK + STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL + INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT + APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO + NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR + CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT + APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is + defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial + computer software" (as that term is defined at 48 + C.F.R. 252.227-7014(a)(1)) and "commercial computer software + documentation" as such terms are used in 48 C.F.R. 12.212 + (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 + C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all + U.S. Government End Users acquire Covered Software with only those + rights set forth herein. This U.S. Government Rights clause is in + lieu of, and supersedes, any other FAR, DFAR, or other clause or + provision that addresses Government rights in computer software + under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed + by the law of the jurisdiction specified in a notice contained + within the Original Software (except to the extent applicable law, + if any, provides otherwise), excluding such jurisdiction's + conflict-of-law provisions. Any litigation relating to this + License shall be subject to the jurisdiction of the courts located + in the jurisdiction and venue specified in a notice contained + within the Original Software, with the losing party responsible + for costs, including, without limitation, court costs and + reasonable attorneys' fees and expenses. The application of the + United Nations Convention on Contracts for the International Sale + of Goods is expressly excluded. Any law or regulation which + provides that the language of a contract shall be construed + against the drafter shall not apply to this License. You agree + that You alone are responsible for compliance with the United + States export administration regulations (and the export control + laws and regulation of any other countries) when You use, + distribute or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or + indirectly, out of its utilization of rights under this License + and You agree to work with Initial Developer and Contributors to + distribute such responsibility on an equitable basis. Nothing + herein is intended or shall be deemed to constitute any admission + of liability. + +-------------------------------------------------------------------- + +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND +DISTRIBUTION LICENSE (CDDL) + +For Covered Software in this distribution, this License shall be +governed by the laws of Germany. Legal venue shall be Stuttgart, +Germany. diff --git a/src/VBox/ExtPacks/VBoxDTrace/ExtPack.xml b/src/VBox/ExtPacks/VBoxDTrace/ExtPack.xml new file mode 100644 index 00000000..178a5349 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/ExtPack.xml @@ -0,0 +1,8 @@ + + + Oracle VBoxDTrace Extension Pack + Experimental and unsupported extension pack providing DTrace features to VirtualBox. + @VBOX_VERSION_STRING@ + VBoxDTraceMain + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/Makefile.kmk b/src/VBox/ExtPacks/VBoxDTrace/Makefile.kmk new file mode 100644 index 00000000..081f02b0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/Makefile.kmk @@ -0,0 +1,367 @@ +# $Id: Makefile.kmk $ +## @file +# Sub-makefile for VBoxDTrace. +# +# Contributed by: bird +# + +# +# Copyright (C) 2012-2023 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from http://www.virtualbox.org. +# +# The contents of this file are subject to the terms of the Common +# Development and Distribution License Version 1.0 (CDDL) only, as it +# comes in the "COPYING.CDDL" file of the VirtualBox distribution. +# +# SPDX-License-Identifier: CDDL-1.0 +# + +SUB_DEPTH = ../../../../ +include $(KBUILD_PATH)/subheader.kmk + + +# +# Globals. +# +VBOX_EXTPACK_VBOXDTRACE_NAME := Oracle VBoxDTrace Extension Pack +VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME := Oracle_VBoxDTrace_Extension_Pack +VBOX_PATH_EXTPACK_VBOXDTRACE = $(PATH_STAGE)/$(INST_EXTPACK)$(VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME) +INST_EXTPACK_VBOXDTRACE = $(INST_EXTPACK)$(VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME)/ + +VBOXDT_PATH := $(PATH_ROOT)/src/VBox/ExtPacks/VBoxDTrace +VBOXDT_PATH_ONNV := $(VBOXDT_PATH)/onnv +VBOXDT_PATH_UTS := $(VBOXDT_PATH_ONNV)/uts +VBOXDT_PATH_CMD := $(VBOXDT_PATH_ONNV)/cmd +VBOXDT_PATH_LIBCTF := $(VBOXDT_PATH_ONNV)/lib/libctf +VBOXDT_PATH_CMN_CTF := $(VBOXDT_PATH_ONNV)/common/ctf +VBOXDT_PATH_LIBDTRACE := $(VBOXDT_PATH_ONNV)/lib/libdtrace +VBOXDT_PATH_CMN_DTRACE := $(VBOXDT_PATH_ONNV)/common/dtrace + + +ifndef VBOX_ONLY_EXTPACKS + # + # The generic wrapper that selects native or extpack dtrace cmd and adds our + # library path to the command line. + # + # Note! This is not installed as part of the extension pack, but always shipped + # with the base VBox installation. + # + PROGRAMS += VBoxDTrace + VBoxDTrace_TEMPLATE := VBoxR3Exe + VBoxDTrace_SOURCES := VBoxDTraceWrapper.cpp + VBoxDTrace_LIBS = $(LIB_RUNTIME) + $(call VBOX_SET_VER_INFO_DLL,VBoxDTrace,VirtualBox DTrace Chooser) +endif + + +if defined(VBOX_WITH_EXTPACK_VBOXDTRACE) && defined(VBOX_WITH_EXTPACK) + + # + # Extend the extension pack templates. + # + TEMPLATE_VBoxR3ExtPackDTrace = For the ring-3 context modules in the VBoxDTrace extension pack. + TEMPLATE_VBoxR3ExtPackDTrace_EXTENDS = VBoxR3ExtPack + TEMPLATE_VBoxR3ExtPackDTrace_INST = $(INST_EXTPACK_VBOXDTRACE)$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ + TEMPLATE_VBoxR3ExtPackDTrace_DEFS = $(TEMPLATE_VBoxR3ExtPack_DEFS) VBOX_IN_DTRACE_EXTPACK + if "$(VBOX_VCC_TOOL_STEM)" >= "VCC140" + # -wd4456: declaration of 'rval' hides previous local declaration + # -wd4477: 'fprintf' : format string '%02lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'ulong_t' + # -wd4457: warning C4457: declaration of 'arg' hides function parameter + TEMPLATE_VBoxR3ExtPackDTrace_CFLAGS.win = $(TEMPLATE_VBoxR3ExtPack_CFLAGS.win) -wd4456 -wd4477 -wd4457 + endif + + TEMPLATE_VBoxR0ExtPackDTrace = For the ring-0 context modules in the VBoxDTrace extension pack. + TEMPLATE_VBoxR0ExtPackDTrace_EXTENDS = VBoxR0ExtPack + TEMPLATE_VBoxR0ExtPackDTrace_INST = $(INST_EXTPACK_VBOXDTRACE)$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ + TEMPLATE_VBoxR0ExtPackDTrace_DEFS = $(TEMPLATE_VBoxR0ExtPack_DEFS) VBOX_IN_DTRACE_EXTPACK + + TEMPLATE_VBoxInsExtPackDTrace = For the install targets for the VBoxDTrace extension pack. + TEMPLATE_VBoxInsExtPackDTrace_EXTENDS = VBoxR0ExtPack + TEMPLATE_VBoxInsExtPackDTrace_INST = $(INST_EXTPACK_VBOXDTRACE) + + + # + # Install the description. + # + INSTALLS += VBoxDTraceIns + VBoxDTraceIns_TEMPLATE = VBoxInsExtPackDTrace + VBoxDTraceIns_SOURCES = \ + $(VBoxDTraceIns_0_OUTDIR)/ExtPack.xml \ + COPYING=>ExtPack-SourceCodeLicense.txt + $(call VBOX_EDIT_VERSION_RULE_FN,VBoxDTraceIns,ExtPack.xml) + + + # + # VBoxDTraceMain - The module which the VirtualBox Main API talks to. + # + DLLS += VBoxDTraceMain + VBoxDTraceMain_TEMPLATE = VBoxR3ExtPackDTrace + VBoxDTraceMain_SOURCES = VBoxDTraceMain.cpp + $(call VBOX_SET_VER_INFO_DLL,VBoxDTraceMain,VBoxDTrace Main module) + + + # + # The ring-3 VBoxDTrace command implementation (library). + # + ifneq ($(KBUILD_TARGET),solaris) # Temporarily disabled on Solaris (not really needed)... + DLLS += VBoxDTraceCmd + VBoxDTraceCmd_TEMPLATE = VBoxR3ExtPackDTrace + ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING + VBoxDTraceCmd_DEFS = RTMEM_WRAP_TO_EF_APIS VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME="$(VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME)" + else + VBoxDTraceCmd_DEFS = RTMEM_WRAP_TO_EF_APIS VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME=\"$(VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME)\" + endif + #VBoxDTraceCmd_DEFS += YYDEBUG + VBoxDTraceCmd_DEFS.linux = _XOPEN_SOURCE=700 _LARGEFILE64_SOURCE + VBoxDTraceCmd_DEFS.win = YY_USE_PROTOS=1 YYENABLE_NLS=0 YYLTYPE_IS_TRIVIAL=0 + VBoxDTraceCmd_SDKS = VBoxZlib + ifn1of ($(KBUILD_TARGET), win) + VBoxDTraceCmd_CFLAGS = -Wno-format $(VBOX_GCC_Wno-overlength-strings) -Wno-sign-compare -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-shadow + endif + VBoxDTraceCmd_INCS = \ + include \ + $(VBOXDT_PATH_UTS)/common \ + $(VBOXDT_PATH_LIBCTF)/common \ + $(VBOXDT_PATH_LIBDTRACE)/common \ + $(VBOXDT_PATH_CMN_CTF) + VBoxDTraceCmd_SOURCES = \ + $(VBOXDT_PATH_CMD)/dtrace/dtrace.c \ + \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_as.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_aggregate.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_buf.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_cc.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_cg.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_consume.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_decl.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_dis.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_dof.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_error.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_handle.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_ident.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_inttab.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_list.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_map.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_module.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_program.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_open.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_options.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_parser.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_pcb.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_pragma.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_printf.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_proc.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_provider.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_regset.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_string.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_strtab.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_subr.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_work.c \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_xlator.c \ + \ + $(VBoxDTraceCmd_0_OUTDIR)/dt_errtags.c \ + $(VBoxDTraceCmd_0_OUTDIR)/dt_names.c \ + \ + $(VBOXDT_PATH_CMN_CTF)/ctf_create.c \ + $(VBOXDT_PATH_CMN_CTF)/ctf_error.c \ + $(VBOXDT_PATH_CMN_CTF)/ctf_decl.c \ + $(VBOXDT_PATH_CMN_CTF)/ctf_hash.c \ + $(VBOXDT_PATH_CMN_CTF)/ctf_labels.c \ + $(VBOXDT_PATH_CMN_CTF)/ctf_lookup.c \ + $(VBOXDT_PATH_CMN_CTF)/ctf_open.c \ + $(VBOXDT_PATH_CMN_CTF)/ctf_types.c \ + $(VBOXDT_PATH_CMN_CTF)/ctf_util.c \ + \ + $(VBOXDT_PATH_LIBCTF)/common/ctf_subr.c \ + $(VBOXDT_PATH_LIBCTF)/common/ctf_lib.c + + # Source not used or wanted: + # $(VBOXDT_PATH_LIBDTRACE)/common/dt_link.c + # $(VBOXDT_PATH_LIBDTRACE)/common/dt_pid.c + + # Generate sources + VBoxDTraceCmd_CLEAN = \ + $(VBoxDTraceCmd_0_OUTDIR)/dt_errtags.c \ + $(VBoxDTraceCmd_0_OUTDIR)/dt_names.c + + $$(VBoxDTraceCmd_0_OUTDIR)/dt_errtags.c: \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_errtags.h \ + $(VBOXDT_PATH_LIBDTRACE)/common/mkerrtags.sed \ + | $$(dir $$@) + $(MSG_GENERATE,VBoxDTraceCmd,$@,$<) + $(SED) -n -f $(VBOXDT_PATH_LIBDTRACE)/common/mkerrtags.sed --output $@ $< + + $$(VBoxDTraceCmd_0_OUTDIR)/dt_names.c: \ + $(VBOXDT_PATH_UTS)/common/sys/dtrace.h \ + $(VBOXDT_PATH_LIBDTRACE)/common/mknames.sed \ + | $$(dir $$@) + $(MSG_GENERATE,VBoxDTraceCmd,$@,$<) + $(SED) -n -f $(VBOXDT_PATH_LIBDTRACE)/common/mknames.sed --output $@ $< + + ifdef VBOX_HAVE_BISON + USES += yacc + VBoxDTraceCmd_USES += yacc + VBoxDTraceCmd_YACCTOOL = BISON + VBoxDTraceCmd_YACCFLAGS = -d -y + VBoxDTraceCmd_SOURCES += \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_grammar.y + VBoxDTraceCmd_INCS += $(VBoxDTraceCmd_0_OUTDIR)/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common + else + VBoxDTraceCmd_SOURCES += \ + $(VBOXDT_PATH)/generated/dt_grammar.c + VBoxDTraceCmd_INCS += \ + $(VBOXDT_PATH)/generated/ + endif + + ifdef VBOX_HAVE_FLEX + USES += lex + VBoxDTraceCmd_USES += lex + VBoxDTraceCmd_LEXTOOL = FLEX + VBoxDTraceCmd_LEXFLAGS = -l -B #-d -T + VBoxDTraceCmd_SOURCES += \ + $(VBOXDT_PATH_LIBDTRACE)/common/dt_lex.l + else + VBoxDTraceCmd_SOURCES += \ + $(VBOXDT_PATH)/generated/dt_lex.c + endif + ifeq ($(KBUILD_HOST),linux) + if $(VBOX_GCC_VERSION_CXX) >= 70000 + VBoxDTraceCmd_CFLAGS += -Wno-implicit-fallthrough + endif + endif + VBoxDTraceCmd_DEFS += USING_FLEX + $(call VBOX_SET_VER_INFO_DLL,VBoxDTraceCmd,VBoxDTrace Command Implementation) + + # + # Updates the sources generated by flex and biosn. + # The SED processing removes the paths the from #line statements. + # + vboxdtrace-update-generated-sources: \ + $$(VBoxDTraceCmd_0_OUTDIR)/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_grammar.c \ + $$(VBoxDTraceCmd_0_OUTDIR)/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_grammar.h \ + $$(VBoxDTraceCmd_0_OUTDIR)/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_lex.c + $(foreach file,dt_grammar.c dt_grammar.h dt_lex.c \ + ,$(NLTAB)$(SED) -e 's,$(VBOXDT_PATH_LIBDTRACE)/common/,,g'\ + -e 's,$(VBoxDTraceCmd_0_OUTDIR)/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/,,g' \ + --output $(VBOXDT_PATH)/generated/$(file) \ + $(VBoxDTraceCmd_0_OUTDIR)/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/$(file)) + endif # Temporarily disabled on Solaris. + + # + # The ring-0 part of VBoxDTrace. + # + ifneq ($(KBUILD_TARGET),solaris) # disabled on solaris - neiter needed nor currently able to build it here. + $(if-expr defined(VBOX_WITH_VBOXR0_AS_DLL),DLLS,SYSMODS) += VBoxDTraceR0 + endif + VBoxDTraceR0_TEMPLATE = VBoxR0ExtPackDTrace + VBoxDTraceR0_DEFS = IN_VBOXDTRACE_R0 IN_RT_R0 + ifeq ($(VBOX_LDR_FMT),elf) + VBoxDTraceR0_LDFLAGS = -e ModuleInit + endif + VBoxDTraceR0_INCS = \ + include \ + $(VBOXDT_PATH_UTS)/common + VBoxDTraceR0_SOURCES = \ + VBoxDTraceR0.cpp \ + VBoxDTraceR0A.asm \ + $(VBOXDT_PATH_UTS)/common/dtrace/dtrace.c + VBoxDTraceR0_LIBS = \ + $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) \ + $(VBOX_LIB_SUPR0) + $(call VBOX_SET_VER_INFO_R0,VBoxDTraceR0,VBoxDTrace Core (ring-0)) + + + # + # Packing. + # + ifndef VBOX_WITHOUT_EXTPACK_VBOXDTRACE_PACKING + PACKING += $(VBOX_PATH_PACKAGES)/$(VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack + endif + + ifndef VBOX_WITH_EXTPACK_OS_ARCHS + ifeq ($(USER),bird) # for now + VBOX_WITH_EXTPACK_OS_ARCHS = $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) + endif + endif + + # Build the file list. The macro takes 1=darwin.x86, 2=dist/VirtualBox.app/Contents/MacOS, 3=dylib + VBOX_VBOXDTRACE_FILES_MACRO = \ + $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME)/$(1)/VBoxDTraceMain.$(3)=>$(1)/VBoxDTraceMain.$(3) \ + $(if $(intersects $1, solaris.x86 solaris.amd64),, \ + $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME)/$(1)/VBoxDTraceCmd.$(3)=>$(1)/VBoxDTraceCmd.$(3) \ + $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME)/$(1)/VBoxDTraceR0.r0=>$(1)/VBoxDTraceR0.r0 \ + ) + + VBOX_VBOXDTRACE_FILES := \ + $(VBOX_PATH_EXTPACK_VBOXDTRACE)/ExtPack.xml=>ExtPack.xml \ + $(VBOX_PATH_EXTPACK_VBOXDTRACE)/ExtPack-SourceCodeLicense.txt=>ExtPack-SourceCodeLicense.txt + + if1of (darwin.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,darwin.amd64,dist/VirtualBox.app/Contents/MacOS,dylib) + endif + if1of (darwin.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,darwin.x86,dist/VirtualBox.app/Contents/MacOS,dylib) + endif + if1of (freebsd.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,freebsd.amd64,bin,so) + endif + if1of (freebsd.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,freebsd.x86,bin,so) + endif + if1of (linux.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,linux.amd64,bin,so) + endif + if1of (linux.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,linux.x86,bin,so) + endif + if1of (os2.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,os2.x86,bin,so) + endif + if1of (solaris.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,solaris.amd64,bin,so) + endif + if1of (solaris.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,solaris.x86,bin,so) + endif + if1of (win.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,win.amd64,bin,dll) + endif + if1of (win.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS)) + VBOX_VBOXDTRACE_FILES += $(call VBOX_VBOXDTRACE_FILES_MACRO,win.x86,bin,dll) + endif + + # Pack it all up using a temporary staging directory. + $(VBOX_PATH_PACKAGES)/$(VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack: \ + $$(foreach file, $$(VBOX_VBOXDTRACE_FILES), $$(firstword $$(subst =>,$$(SP),$$(file)))) \ + | $(VBOX_PATH_PACKAGES)/ + $(RM) -f $(wildcard $(VBOX_PATH_PACKAGES)/$(VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME)-*.vbox-extpack) \ + $(VBoxDTraceIns_0_OUTDIR)/ExtPack.manifest \ + $(VBoxDTraceIns_0_OUTDIR)/ExtPack.signature + # Stage all the files + $(RM) -Rf $(VBoxDTraceIns_0_OUTDIR)/Stage/ + $(foreach file, $(VBOX_VBOXDTRACE_FILES),\ + $(NLTAB)$(MKDIR) -p $(dir $(lastword $(subst =>,$(SP)$(VBoxDTraceIns_0_OUTDIR)/Stage/,$(file)))) \ + $(NLTAB)$(CP) $(subst =>,$(SP)$(VBoxDTraceIns_0_OUTDIR)/Stage/,$(file)) ) + # Create the manifest + $(VBOX_RTMANIFEST) \ + --manifest $(VBoxDTraceIns_0_OUTDIR)/Stage/ExtPack.manifest \ + --chdir $(VBoxDTraceIns_0_OUTDIR)/Stage/ \ + $(foreach file, $(VBOX_VBOXDTRACE_FILES), $(lastword $(subst =>,$(SP),$(file)))) + $(APPEND) $(VBoxDTraceIns_0_OUTDIR)/Stage/ExtPack.signature "todo" + $(CHMOD) a+r \ + $(VBoxDTraceIns_0_OUTDIR)/Stage/ExtPack.manifest \ + $(VBoxDTraceIns_0_OUTDIR)/Stage/ExtPack.signature + # Tar it up. + tar -cvf - -C $(VBoxDTraceIns_0_OUTDIR)/Stage/ . | gzip -9c > $@ + # Clean up + $(RM) -Rf $(VBoxDTraceIns_0_OUTDIR)/Stage/ + + BLDDIRS += $(VBOX_PATH_PACKAGES)/ + +endif # VBOX_WITH_EXTPACK_VBOXDTRACE + + +include $(FILE_KBUILD_SUB_FOOTER) + diff --git a/src/VBox/ExtPacks/VBoxDTrace/Samples/Hello.d b/src/VBox/ExtPacks/VBoxDTrace/Samples/Hello.d new file mode 100644 index 00000000..1f925756 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/Samples/Hello.d @@ -0,0 +1,38 @@ +/* $Id: Hello.d $ */ +/** @file + * VBoxDTrace - Hello world sample. + */ + +/* + * Copyright (C) 2010-2023 Oracle and/or its affiliates. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +/* This works by matching the dtrace:::BEGIN probe, printing the greeting and + then quitting immediately. */ +BEGIN { + trace("Hello VBox World!"); + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp new file mode 100644 index 00000000..4db3c737 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp @@ -0,0 +1,130 @@ +/* $Id: VBoxDTraceMain.cpp $ */ +/** @file + * VBoxDTrace main module. + */ + +/* + * Copyright (C) 2010-2023 Oracle and/or its affiliates. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +/********************************************************************************************************************************* +* Header Files * +*********************************************************************************************************************************/ +#include + +#include +#include +#include +#include +#include + + +/********************************************************************************************************************************* +* Global Variables * +*********************************************************************************************************************************/ +/** Pointer to the extension pack helpers. */ +static PCVBOXEXTPACKHLP g_pHlp; + + +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnInstalled} +// */ +// static DECLCALLBACK(void) vboxDTraceExtPack_Installed(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, PRTERRINFO pErrInfo); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnUninstall} +// */ +// static DECLCALLBACK(int) vboxDTraceExtPack_Uninstall(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnVirtualBoxReady} +// */ +// static DECLCALLBACK(void) vboxDTraceExtPack_VirtualBoxReady(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnUnload} +// */ +// static DECLCALLBACK(void) vboxDTraceExtPack_Unload(PCVBOXEXTPACKREG pThis); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnVMCreated} +// */ +// static DECLCALLBACK(int) vboxDTraceExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, VBOXEXTPACK_IF_CS(IMachine) *pMachine); +// +// /** +// * @interface_method_impl{VBOXEXTPACKREG,pfnQueryObject} +// */ +// static DECLCALLBACK(void) vboxDTraceExtPack_QueryObject(PCVBOXEXTPACKREG pThis, PCRTUUID pObjectId); + + +static const VBOXEXTPACKREG g_vboxDTraceExtPackReg = +{ + VBOXEXTPACKREG_VERSION, + /* .uVBoxFullVersion = */ VBOX_FULL_VERSION, + /* .pszNlsBaseName = */ NULL, + /* .pfnInstalled = */ NULL, + /* .pfnUninstall = */ NULL, + /* .pfnVirtualBoxReady =*/ NULL, + /* .pfnUnload = */ NULL, + /* .pfnVMCreated = */ NULL, + /* .pfnQueryObject = */ NULL, + /* .pfnReserved1 = */ NULL, + /* .pfnReserved2 = */ NULL, + /* .pfnReserved3 = */ NULL, + /* .pfnReserved4 = */ NULL, + /* .pfnReserved5 = */ NULL, + /* .pfnReserved6 = */ NULL, + /* .uReserved7 = */ 0, + VBOXEXTPACKREG_VERSION +}; + + +/** @callback_method_impl{FNVBOXEXTPACKREGISTER} */ +extern "C" DECLEXPORT(int) VBoxExtPackRegister(PCVBOXEXTPACKHLP pHlp, PCVBOXEXTPACKREG *ppReg, PRTERRINFO pErrInfo) +{ + /* + * Check the VirtualBox version. + */ + if (!VBOXEXTPACK_IS_VER_COMPAT(pHlp->u32Version, VBOXEXTPACKHLP_VERSION)) + return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH, + "Helper version mismatch - expected %#x got %#x", + VBOXEXTPACKHLP_VERSION, pHlp->u32Version); + if ( VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MAJOR + || VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion) != VBOX_VERSION_MINOR) + return RTErrInfoSetF(pErrInfo, VERR_VERSION_MISMATCH, + "VirtualBox version mismatch - expected %u.%u got %u.%u", + VBOX_VERSION_MAJOR, VBOX_VERSION_MINOR, + VBOX_FULL_VERSION_GET_MAJOR(pHlp->uVBoxFullVersion), + VBOX_FULL_VERSION_GET_MINOR(pHlp->uVBoxFullVersion)); + + /* + * We're good, save input and return the registration structure. + */ + g_pHlp = pHlp; + *ppReg = &g_vboxDTraceExtPackReg; + + return VINF_SUCCESS; +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0.cpp b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0.cpp new file mode 100644 index 00000000..8f4e3542 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0.cpp @@ -0,0 +1,2174 @@ +/* $Id: VBoxDTraceR0.cpp $ */ +/** @file + * VBoxDTraceR0. + * + * Contributed by: bird + */ + +/* + * Copyright (C) 2012-2023 Oracle and/or its affiliates. + * + * This file is part of VirtualBox base platform packages, as + * available from http://www.virtualbox.org. + * + * The contents of this file are subject to the terms of the Common + * Development and Distribution License Version 1.0 (CDDL) only, as it + * comes in the "COPYING.CDDL" file of the VirtualBox distribution. + * + * SPDX-License-Identifier: CDDL-1.0 + */ + + +/********************************************************************************************************************************* +* Header Files * +*********************************************************************************************************************************/ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + + +/********************************************************************************************************************************* +* Defined Constants And Macros * +*********************************************************************************************************************************/ +//#if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2) +//# define HAVE_RTMEMALLOCEX_FEATURES +//#endif + + +/********************************************************************************************************************************* +* Structures and Typedefs * +*********************************************************************************************************************************/ + +/** Caller indicator. */ +typedef enum VBOXDTCALLER +{ + kVBoxDtCaller_Invalid = 0, + kVBoxDtCaller_Generic, + kVBoxDtCaller_ProbeFireUser, + kVBoxDtCaller_ProbeFireKernel +} VBOXDTCALLER; + +/** + * Stack data used for thread structure and such. + * + * This is planted in every external entry point and used to emulate solaris + * curthread, CRED, curproc and similar. It is also used to get at the + * uncached probe arguments. + */ +typedef struct VBoxDtStackData +{ + /** Eyecatcher no. 1 (VBDT_STACK_DATA_MAGIC2). */ + uint32_t u32Magic1; + /** Eyecatcher no. 2 (VBDT_STACK_DATA_MAGIC2). */ + uint32_t u32Magic2; + /** The format of the caller specific data. */ + VBOXDTCALLER enmCaller; + /** Caller specific data. */ + union + { + /** kVBoxDtCaller_ProbeFireKernel. */ + struct + { + /** The caller. */ + uintptr_t uCaller; + /** Pointer to the stack arguments of a probe function call. */ + uintptr_t *pauStackArgs; + } ProbeFireKernel; + /** kVBoxDtCaller_ProbeFireUser. */ + struct + { + /** The user context. */ + PCSUPDRVTRACERUSRCTX pCtx; + /** The argument displacement caused by 64-bit arguments passed directly to + * dtrace_probe. */ + int offArg; + } ProbeFireUser; + } u; + /** Credentials allocated by VBoxDtGetCurrentCreds. */ + struct VBoxDtCred *pCred; + /** Thread structure currently being held by this thread. */ + struct VBoxDtThread *pThread; + /** Pointer to this structure. + * This is the final bit of integrity checking. */ + struct VBoxDtStackData *pSelf; +} VBDTSTACKDATA; +/** Pointer to the on-stack thread specific data. */ +typedef VBDTSTACKDATA *PVBDTSTACKDATA; + +/** The first magic value. */ +#define VBDT_STACK_DATA_MAGIC1 RT_MAKE_U32_FROM_U8('V', 'B', 'o', 'x') +/** The second magic value. */ +#define VBDT_STACK_DATA_MAGIC2 RT_MAKE_U32_FROM_U8('D', 'T', 'r', 'c') + +/** The alignment of the stack data. + * The data doesn't require more than sizeof(uintptr_t) alignment, but the + * greater alignment the quicker lookup. */ +#define VBDT_STACK_DATA_ALIGN 32 + +/** Plants the stack data. */ +#define VBDT_SETUP_STACK_DATA(a_enmCaller) \ + uint8_t abBlob[sizeof(VBDTSTACKDATA) + VBDT_STACK_DATA_ALIGN - 1]; \ + PVBDTSTACKDATA pStackData = (PVBDTSTACKDATA)( (uintptr_t)&abBlob[VBDT_STACK_DATA_ALIGN - 1] \ + & ~(uintptr_t)(VBDT_STACK_DATA_ALIGN - 1)); \ + pStackData->u32Magic1 = VBDT_STACK_DATA_MAGIC1; \ + pStackData->u32Magic2 = VBDT_STACK_DATA_MAGIC2; \ + pStackData->enmCaller = a_enmCaller; \ + pStackData->pCred = NULL; \ + pStackData->pThread = NULL; \ + pStackData->pSelf = pStackData + +/** Passifies the stack data and frees up resource held within it. */ +#define VBDT_CLEAR_STACK_DATA() \ + do \ + { \ + pStackData->u32Magic1 = 0; \ + pStackData->u32Magic2 = 0; \ + pStackData->pSelf = NULL; \ + if (pStackData->pCred) \ + crfree(pStackData->pCred); \ + if (pStackData->pThread) \ + VBoxDtReleaseThread(pStackData->pThread); \ + } while (0) + + +/** Simple SUPR0Printf-style logging. */ +#if 0 /*def DEBUG_bird*/ +# define LOG_DTRACE(a) SUPR0Printf a +#else +# define LOG_DTRACE(a) do { } while (0) +#endif + + +/********************************************************************************************************************************* +* Global Variables * +*********************************************************************************************************************************/ +/** Per CPU information */ +cpucore_t g_aVBoxDtCpuCores[RTCPUSET_MAX_CPUS]; +/** Dummy mutex. */ +struct VBoxDtMutex g_DummyMtx; +/** Pointer to the tracer helpers provided by VBoxDrv. */ +static PCSUPDRVTRACERHLP g_pVBoxDTraceHlp; + +dtrace_cacheid_t dtrace_predcache_id = DTRACE_CACHEIDNONE + 1; + +#if 0 +void (*dtrace_cpu_init)(processorid_t); +void (*dtrace_modload)(struct modctl *); +void (*dtrace_modunload)(struct modctl *); +void (*dtrace_helpers_cleanup)(void); +void (*dtrace_helpers_fork)(proc_t *, proc_t *); +void (*dtrace_cpustart_init)(void); +void (*dtrace_cpustart_fini)(void); +void (*dtrace_cpc_fire)(uint64_t); +void (*dtrace_debugger_init)(void); +void (*dtrace_debugger_fini)(void); +#endif + + +/** + * Gets the stack data. + * + * @returns Pointer to the stack data. Never NULL. + */ +static PVBDTSTACKDATA vboxDtGetStackData(void) +{ + int volatile iDummy = 1; /* use this to get the stack address. */ + PVBDTSTACKDATA pData = (PVBDTSTACKDATA)( ((uintptr_t)&iDummy + VBDT_STACK_DATA_ALIGN - 1) + & ~(uintptr_t)(VBDT_STACK_DATA_ALIGN - 1)); + for (;;) + { + if ( pData->u32Magic1 == VBDT_STACK_DATA_MAGIC1 + && pData->u32Magic2 == VBDT_STACK_DATA_MAGIC2 + && pData->pSelf == pData) + return pData; + pData = (PVBDTSTACKDATA)((uintptr_t)pData + VBDT_STACK_DATA_ALIGN); + } +} + + +void dtrace_toxic_ranges(void (*pfnAddOne)(uintptr_t uBase, uintptr_t cbRange)) +{ + /** @todo ? */ + RT_NOREF_PV(pfnAddOne); +} + + + +/** + * Dummy callback used by dtrace_sync. + */ +static DECLCALLBACK(void) vboxDtSyncCallback(RTCPUID idCpu, void *pvUser1, void *pvUser2) +{ + NOREF(idCpu); NOREF(pvUser1); NOREF(pvUser2); +} + + +/** + * Synchronzie across all CPUs (expensive). + */ +void dtrace_sync(void) +{ + int rc = RTMpOnAll(vboxDtSyncCallback, NULL, NULL); + AssertRC(rc); +} + + +/** + * Fetch a 8-bit "word" from userland. + * + * @return The byte value. + * @param pvUserAddr The userland address. + */ +uint8_t dtrace_fuword8( void *pvUserAddr) +{ + uint8_t u8; + int rc = RTR0MemUserCopyFrom(&u8, (uintptr_t)pvUserAddr, sizeof(u8)); + if (RT_FAILURE(rc)) + { + RTCPUID iCpu = VBDT_GET_CPUID(); + cpu_core[iCpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[iCpu].cpuc_dtrace_illval = (uintptr_t)pvUserAddr; + u8 = 0; + } + return u8; +} + + +/** + * Fetch a 16-bit word from userland. + * + * @return The word value. + * @param pvUserAddr The userland address. + */ +uint16_t dtrace_fuword16(void *pvUserAddr) +{ + uint16_t u16; + int rc = RTR0MemUserCopyFrom(&u16, (uintptr_t)pvUserAddr, sizeof(u16)); + if (RT_FAILURE(rc)) + { + RTCPUID iCpu = VBDT_GET_CPUID(); + cpu_core[iCpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[iCpu].cpuc_dtrace_illval = (uintptr_t)pvUserAddr; + u16 = 0; + } + return u16; +} + + +/** + * Fetch a 32-bit word from userland. + * + * @return The dword value. + * @param pvUserAddr The userland address. + */ +uint32_t dtrace_fuword32(void *pvUserAddr) +{ + uint32_t u32; + int rc = RTR0MemUserCopyFrom(&u32, (uintptr_t)pvUserAddr, sizeof(u32)); + if (RT_FAILURE(rc)) + { + RTCPUID iCpu = VBDT_GET_CPUID(); + cpu_core[iCpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[iCpu].cpuc_dtrace_illval = (uintptr_t)pvUserAddr; + u32 = 0; + } + return u32; +} + + +/** + * Fetch a 64-bit word from userland. + * + * @return The qword value. + * @param pvUserAddr The userland address. + */ +uint64_t dtrace_fuword64(void *pvUserAddr) +{ + uint64_t u64; + int rc = RTR0MemUserCopyFrom(&u64, (uintptr_t)pvUserAddr, sizeof(u64)); + if (RT_FAILURE(rc)) + { + RTCPUID iCpu = VBDT_GET_CPUID(); + cpu_core[iCpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; + cpu_core[iCpu].cpuc_dtrace_illval = (uintptr_t)pvUserAddr; + u64 = 0; + } + return u64; +} + + +/** copyin implementation */ +int VBoxDtCopyIn(void const *pvUser, void *pvDst, size_t cb) +{ + int rc = RTR0MemUserCopyFrom(pvDst, (uintptr_t)pvUser, cb); + return RT_SUCCESS(rc) ? 0 : -1; +} + + +/** copyout implementation */ +int VBoxDtCopyOut(void const *pvSrc, void *pvUser, size_t cb) +{ + int rc = RTR0MemUserCopyTo((uintptr_t)pvUser, pvSrc, cb); + return RT_SUCCESS(rc) ? 0 : -1; +} + + +/** + * Copy data from userland into the kernel. + * + * @param uUserAddr The userland address. + * @param uKrnlAddr The kernel buffer address. + * @param cb The number of bytes to copy. + * @param pfFlags Pointer to the relevant cpuc_dtrace_flags. + */ +void dtrace_copyin( uintptr_t uUserAddr, uintptr_t uKrnlAddr, size_t cb, volatile uint16_t *pfFlags) +{ + int rc = RTR0MemUserCopyFrom((void *)uKrnlAddr, uUserAddr, cb); + if (RT_FAILURE(rc)) + { + *pfFlags |= CPU_DTRACE_BADADDR; + cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_illval = uUserAddr; + } +} + + +/** + * Copy data from the kernel into userland. + * + * @param uKrnlAddr The kernel buffer address. + * @param uUserAddr The userland address. + * @param cb The number of bytes to copy. + * @param pfFlags Pointer to the relevant cpuc_dtrace_flags. + */ +void dtrace_copyout( uintptr_t uKrnlAddr, uintptr_t uUserAddr, size_t cb, volatile uint16_t *pfFlags) +{ + int rc = RTR0MemUserCopyTo(uUserAddr, (void const *)uKrnlAddr, cb); + if (RT_FAILURE(rc)) + { + *pfFlags |= CPU_DTRACE_BADADDR; + cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_illval = uUserAddr; + } +} + + +/** + * Copy a string from userland into the kernel. + * + * @param uUserAddr The userland address. + * @param uKrnlAddr The kernel buffer address. + * @param cbMax The maximum number of bytes to copy. May stop + * earlier if zero byte is encountered. + * @param pfFlags Pointer to the relevant cpuc_dtrace_flags. + */ +void dtrace_copyinstr( uintptr_t uUserAddr, uintptr_t uKrnlAddr, size_t cbMax, volatile uint16_t *pfFlags) +{ + if (!cbMax) + return; + + char *pszDst = (char *)uKrnlAddr; + int rc = RTR0MemUserCopyFrom(pszDst, uUserAddr, cbMax); + if (RT_FAILURE(rc)) + { + /* Byte by byte - lazy bird! */ + size_t off = 0; + while (off < cbMax) + { + rc = RTR0MemUserCopyFrom(&pszDst[off], uUserAddr + off, 1); + if (RT_FAILURE(rc)) + { + *pfFlags |= CPU_DTRACE_BADADDR; + cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_illval = uUserAddr; + pszDst[off] = '\0'; + return; + } + if (!pszDst[off]) + return; + off++; + } + } + + pszDst[cbMax - 1] = '\0'; +} + + +/** + * Copy a string from the kernel and into user land. + * + * @param uKrnlAddr The kernel string address. + * @param uUserAddr The userland address. + * @param cbMax The maximum number of bytes to copy. Will stop + * earlier if zero byte is encountered. + * @param pfFlags Pointer to the relevant cpuc_dtrace_flags. + */ +void dtrace_copyoutstr(uintptr_t uKrnlAddr, uintptr_t uUserAddr, size_t cbMax, volatile uint16_t *pfFlags) +{ + const char *pszSrc = (const char *)uKrnlAddr; + size_t cbActual = RTStrNLen(pszSrc, cbMax); + cbActual += cbActual < cbMax; + dtrace_copyout(uKrnlAddr,uUserAddr, cbActual, pfFlags); +} + + +/** + * Get the caller @a cCallFrames call frames up the stack. + * + * @returns The caller's return address or ~(uintptr_t)0. + * @param cCallFrames The number of frames. + */ +uintptr_t dtrace_caller(int cCallFrames) +{ + PVBDTSTACKDATA pData = vboxDtGetStackData(); + if (pData->enmCaller == kVBoxDtCaller_ProbeFireKernel) + return pData->u.ProbeFireKernel.uCaller; + RT_NOREF_PV(cCallFrames); + return ~(uintptr_t)0; +} + + +/** + * Get argument number @a iArg @a cCallFrames call frames up the stack. + * + * @returns The caller's return address or ~(uintptr_t)0. + * @param iArg The argument to get. + * @param cCallFrames The number of frames. + */ +uint64_t dtrace_getarg(int iArg, int cCallFrames) +{ + PVBDTSTACKDATA pData = vboxDtGetStackData(); + AssertReturn(iArg >= 5, UINT64_MAX); + + if (pData->enmCaller == kVBoxDtCaller_ProbeFireKernel) + return pData->u.ProbeFireKernel.pauStackArgs[iArg - 5]; + RT_NOREF_PV(cCallFrames); + return UINT64_MAX; +} + + +/** + * Produce a traceback of the kernel stack. + * + * @param paPcStack Where to return the program counters. + * @param cMaxFrames The maximum number of PCs to return. + * @param cSkipFrames The number of artificial callstack frames to + * skip at the top. + * @param pIntr Not sure what this is... + */ +void dtrace_getpcstack(pc_t *paPcStack, int cMaxFrames, int cSkipFrames, uint32_t *pIntr) +{ + int iFrame = 0; + while (iFrame < cMaxFrames) + { + paPcStack[iFrame] = NULL; + iFrame++; + } + RT_NOREF_PV(pIntr); + RT_NOREF_PV(cSkipFrames); +} + + +/** + * Get the number of call frames on the stack. + * + * @returns The stack depth. + * @param cSkipFrames The number of artificial callstack frames to + * skip at the top. + */ +int dtrace_getstackdepth(int cSkipFrames) +{ + RT_NOREF_PV(cSkipFrames); + return 1; +} + + +/** + * Produce a traceback of the userland stack. + * + * @param paPcStack Where to return the program counters. + * @param paFpStack Where to return the frame pointers. + * @param cMaxFrames The maximum number of frames to return. + */ +void dtrace_getufpstack(uint64_t *paPcStack, uint64_t *paFpStack, int cMaxFrames) +{ + int iFrame = 0; + while (iFrame < cMaxFrames) + { + paPcStack[iFrame] = 0; + paFpStack[iFrame] = 0; + iFrame++; + } +} + + +/** + * Produce a traceback of the userland stack. + * + * @param paPcStack Where to return the program counters. + * @param cMaxFrames The maximum number of frames to return. + */ +void dtrace_getupcstack(uint64_t *paPcStack, int cMaxFrames) +{ + int iFrame = 0; + while (iFrame < cMaxFrames) + { + paPcStack[iFrame] = 0; + iFrame++; + } +} + + +/** + * Computes the depth of the userland stack. + */ +int dtrace_getustackdepth(void) +{ + return 0; +} + + +/** + * Get the current IPL/IRQL. + * + * @returns Current level. + */ +int dtrace_getipl(void) +{ +#ifdef RT_ARCH_AMD64 + /* CR8 is normally the same as IRQL / IPL on AMD64. */ + return ASMGetCR8(); +#else + /* Just fake it on x86. */ + return !ASMIntAreEnabled(); +#endif +} + + +/** + * Get current monotonic timestamp. + * + * @returns Timestamp, nano seconds. + */ +hrtime_t dtrace_gethrtime(void) +{ + return RTTimeNanoTS(); +} + + +/** + * Get current walltime. + * + * @returns Timestamp, nano seconds. + */ +hrtime_t dtrace_gethrestime(void) +{ + /** @todo try get better resolution here somehow ... */ + RTTIMESPEC Now; + return RTTimeSpecGetNano(RTTimeNow(&Now)); +} + + +/** + * DTrace panic routine. + * + * @param pszFormat Panic message. + * @param va Arguments to the panic message. + */ +void dtrace_vpanic(const char *pszFormat, va_list va) +{ + RTAssertMsg1(NULL, __LINE__, __FILE__, __FUNCTION__); + RTAssertMsg2WeakV(pszFormat, va); + RTR0AssertPanicSystem(); + for (;;) + { + ASMBreakpoint(); + volatile char *pchCrash = (volatile char *)~(uintptr_t)0; + *pchCrash = '\0'; + } +} + + +/** + * DTrace panic routine. + * + * @param pszFormat Panic message. + * @param ... Arguments to the panic message. + */ +void VBoxDtPanic(const char *pszFormat, ...) +{ + va_list va; + va_start(va, pszFormat); + dtrace_vpanic(pszFormat, va); + /*va_end(va); - unreachable */ +} + + +/** + * DTrace kernel message routine. + * + * @param pszFormat Kernel message. + * @param ... Arguments to the panic message. + */ +void VBoxDtCmnErr(int iLevel, const char *pszFormat, ...) +{ + va_list va; + va_start(va, pszFormat); + SUPR0Printf("%N", pszFormat, va); + va_end(va); + RT_NOREF_PV(iLevel); +} + + +/** uprintf implementation */ +void VBoxDtUPrintf(const char *pszFormat, ...) +{ + va_list va; + va_start(va, pszFormat); + VBoxDtUPrintfV(pszFormat, va); + va_end(va); +} + + +/** vuprintf implementation */ +void VBoxDtUPrintfV(const char *pszFormat, va_list va) +{ + SUPR0Printf("%N", pszFormat, va); +} + + +/* CRED implementation. */ +cred_t *VBoxDtGetCurrentCreds(void) +{ + PVBDTSTACKDATA pData = vboxDtGetStackData(); + if (!pData->pCred) + { + struct VBoxDtCred *pCred; +#ifdef HAVE_RTMEMALLOCEX_FEATURES + int rc = RTMemAllocEx(sizeof(*pCred), 0, RTMEMALLOCEX_FLAGS_ANY_CTX, (void **)&pCred); +#else + int rc = RTMemAllocEx(sizeof(*pCred), 0, 0, (void **)&pCred); +#endif + AssertFatalRC(rc); + pCred->cr_refs = 1; + /** @todo get the right creds on unix systems. */ + pCred->cr_uid = 0; + pCred->cr_ruid = 0; + pCred->cr_suid = 0; + pCred->cr_gid = 0; + pCred->cr_rgid = 0; + pCred->cr_sgid = 0; + pCred->cr_zone = 0; + pData->pCred = pCred; + } + + return pData->pCred; +} + + +/* crhold implementation */ +void VBoxDtCredHold(struct VBoxDtCred *pCred) +{ + int32_t cRefs = ASMAtomicIncS32(&pCred->cr_refs); + Assert(cRefs > 1); NOREF(cRefs); +} + + +/* crfree implementation */ +void VBoxDtCredFree(struct VBoxDtCred *pCred) +{ + int32_t cRefs = ASMAtomicDecS32(&pCred->cr_refs); + Assert(cRefs >= 0); + if (!cRefs) + RTMemFreeEx(pCred, sizeof(*pCred)); +} + +/** Spinlock protecting the thread structures. */ +static RTSPINLOCK g_hThreadSpinlock = NIL_RTSPINLOCK; +/** List of threads by usage age. */ +static RTLISTANCHOR g_ThreadAgeList; +/** Hash table for looking up thread structures. */ +static struct VBoxDtThread *g_apThreadsHash[16384]; +/** Fake kthread_t structures. + * The size of this array is making horrible ASSUMPTIONS about the number of + * thread in the system that will be subjected to DTracing. */ +static struct VBoxDtThread g_aThreads[8192]; + + +static int vboxDtInitThreadDb(void) +{ + int rc = RTSpinlockCreate(&g_hThreadSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "VBoxDtThreadDb"); + if (RT_FAILURE(rc)) + return rc; + + RTListInit(&g_ThreadAgeList); + for (uint32_t i = 0; i < RT_ELEMENTS(g_aThreads); i++) + { + g_aThreads[i].hNative = NIL_RTNATIVETHREAD; + g_aThreads[i].uPid = NIL_RTPROCESS; + RTListPrepend(&g_ThreadAgeList, &g_aThreads[i].AgeEntry); + } + + return VINF_SUCCESS; +} + + +static void vboxDtTermThreadDb(void) +{ + RTSpinlockDestroy(g_hThreadSpinlock); + g_hThreadSpinlock = NIL_RTSPINLOCK; + RTListInit(&g_ThreadAgeList); +} + + +/* curthread implementation, providing a fake kthread_t. */ +struct VBoxDtThread *VBoxDtGetCurrentThread(void) +{ + /* + * Once we've retrieved a thread, we hold on to it until the thread exits + * the VBoxDTrace module. + */ + PVBDTSTACKDATA pData = vboxDtGetStackData(); + if (pData->pThread) + { + AssertPtr(pData->pThread); + Assert(pData->pThread->hNative == RTThreadNativeSelf()); + Assert(pData->pThread->uPid == RTProcSelf()); + Assert(RTListIsEmpty(&pData->pThread->AgeEntry)); + return pData->pThread; + } + + /* + * Lookup the thread in the hash table. + */ + RTNATIVETHREAD hNativeSelf = RTThreadNativeSelf(); + RTPROCESS uPid = RTProcSelf(); + uintptr_t iHash = (hNativeSelf * 2654435761U) % RT_ELEMENTS(g_apThreadsHash); + + RTSpinlockAcquire(g_hThreadSpinlock); + + struct VBoxDtThread *pThread = g_apThreadsHash[iHash]; + while (pThread) + { + if (pThread->hNative == hNativeSelf) + { + if (pThread->uPid != uPid) + { + /* Re-initialize the reused thread. */ + pThread->uPid = uPid; + pThread->t_dtrace_vtime = 0; + pThread->t_dtrace_start = 0; + pThread->t_dtrace_stop = 0; + pThread->t_dtrace_scrpc = 0; + pThread->t_dtrace_astpc = 0; + pThread->t_predcache = 0; + } + + /* Hold the thread in the on-stack data, making sure it does not + get reused till the thread leaves VBoxDTrace. */ + RTListNodeRemove(&pThread->AgeEntry); + pData->pThread = pThread; + + RTSpinlockRelease(g_hThreadSpinlock); + return pThread; + } + + pThread = pThread->pNext; + } + + /* + * Unknown thread. Allocate a new entry, recycling unused or old ones. + */ + pThread = RTListGetLast(&g_ThreadAgeList, struct VBoxDtThread, AgeEntry); + AssertFatal(pThread); + RTListNodeRemove(&pThread->AgeEntry); + if (pThread->hNative != NIL_RTNATIVETHREAD) + { + uintptr_t iHash2 = (pThread->hNative * 2654435761U) % RT_ELEMENTS(g_apThreadsHash); + if (g_apThreadsHash[iHash2] == pThread) + g_apThreadsHash[iHash2] = pThread->pNext; + else + { + for (struct VBoxDtThread *pPrev = g_apThreadsHash[iHash2]; ; pPrev = pPrev->pNext) + { + AssertPtr(pPrev); + if (pPrev->pNext == pThread) + { + pPrev->pNext = pThread->pNext; + break; + } + } + } + } + + /* + * Initialize the data. + */ + pThread->t_dtrace_vtime = 0; + pThread->t_dtrace_start = 0; + pThread->t_dtrace_stop = 0; + pThread->t_dtrace_scrpc = 0; + pThread->t_dtrace_astpc = 0; + pThread->t_predcache = 0; + pThread->hNative = hNativeSelf; + pThread->uPid = uPid; + + /* + * Add it to the hash as well as the on-stack data. + */ + pThread->pNext = g_apThreadsHash[iHash]; + g_apThreadsHash[iHash] = pThread->pNext; + + pData->pThread = pThread; + + RTSpinlockRelease(g_hThreadSpinlock); + return pThread; +} + + +/** + * Called by the stack data destructor. + * + * @param pThread The thread to release. + * + */ +static void VBoxDtReleaseThread(struct VBoxDtThread *pThread) +{ + RTSpinlockAcquire(g_hThreadSpinlock); + + RTListAppend(&g_ThreadAgeList, &pThread->AgeEntry); + + RTSpinlockRelease(g_hThreadSpinlock); +} + + + + +/* + * + * Virtual Memory / Resource Allocator. + * Virtual Memory / Resource Allocator. + * Virtual Memory / Resource Allocator. + * + */ + + +/** The number of bits per chunk. + * @remarks The 32 bytes are for heap headers and such like. */ +#define VBOXDTVMEMCHUNK_BITS ( ((_64K - 32 - sizeof(uint32_t) * 2) / sizeof(uint32_t)) * 32) + +/** + * Resource allocator chunk. + */ +typedef struct VBoxDtVMemChunk +{ + /** The ordinal (unbased) of the first item. */ + uint32_t iFirst; + /** The current number of free items in this chunk. */ + uint32_t cCurFree; + /** The allocation bitmap. */ + uint32_t bm[VBOXDTVMEMCHUNK_BITS / 32]; +} VBOXDTVMEMCHUNK; +/** Pointer to a resource allocator chunk. */ +typedef VBOXDTVMEMCHUNK *PVBOXDTVMEMCHUNK; + + + +/** + * Resource allocator instance. + */ +typedef struct VBoxDtVMem +{ + /** Spinlock protecting the data (interrupt safe). */ + RTSPINLOCK hSpinlock; + /** Magic value. */ + uint32_t u32Magic; + /** The current number of free items in the chunks. */ + uint32_t cCurFree; + /** The current number of chunks that we have allocated. */ + uint32_t cCurChunks; + /** The configured resource base. */ + uint32_t uBase; + /** The configured max number of items. */ + uint32_t cMaxItems; + /** The size of the apChunks array. */ + uint32_t cMaxChunks; + /** Array of chunk pointers. + * (The size is determined at creation.) */ + PVBOXDTVMEMCHUNK apChunks[1]; +} VBOXDTVMEM; +/** Pointer to a resource allocator instance. */ +typedef VBOXDTVMEM *PVBOXDTVMEM; + +/** Magic value for the VBOXDTVMEM structure. */ +#define VBOXDTVMEM_MAGIC RT_MAKE_U32_FROM_U8('V', 'M', 'e', 'm') + + +/* vmem_create implementation */ +struct VBoxDtVMem *VBoxDtVMemCreate(const char *pszName, void *pvBase, size_t cb, size_t cbUnit, + PFNRT pfnAlloc, PFNRT pfnFree, struct VBoxDtVMem *pSrc, + size_t cbQCacheMax, uint32_t fFlags) +{ + /* + * Assert preconditions of this implementation. + */ + AssertMsgReturn((uintptr_t)pvBase <= UINT32_MAX, ("%p\n", pvBase), NULL); + AssertMsgReturn(cb <= UINT32_MAX, ("%zu\n", cb), NULL); + AssertMsgReturn((uintptr_t)pvBase + cb - 1 <= UINT32_MAX, ("%p %zu\n", pvBase, cb), NULL); + AssertMsgReturn(cbUnit == 1, ("%zu\n", cbUnit), NULL); + AssertReturn(!pfnAlloc, NULL); + AssertReturn(!pfnFree, NULL); + AssertReturn(!pSrc, NULL); + AssertReturn(!cbQCacheMax, NULL); + AssertReturn(fFlags & VM_SLEEP, NULL); + AssertReturn(fFlags & VMC_IDENTIFIER, NULL); + RT_NOREF_PV(pszName); + + /* + * Allocate the instance. + */ + uint32_t cChunks = (uint32_t)cb / VBOXDTVMEMCHUNK_BITS; + if (cb % VBOXDTVMEMCHUNK_BITS) + cChunks++; + PVBOXDTVMEM pThis = (PVBOXDTVMEM)RTMemAllocZ(RT_UOFFSETOF_DYN(VBOXDTVMEM, apChunks[cChunks])); + if (!pThis) + return NULL; + int rc = RTSpinlockCreate(&pThis->hSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "VBoxDtVMem"); + if (RT_FAILURE(rc)) + { + RTMemFree(pThis); + return NULL; + } + pThis->u32Magic = VBOXDTVMEM_MAGIC; + pThis->cCurFree = 0; + pThis->cCurChunks = 0; + pThis->uBase = (uint32_t)(uintptr_t)pvBase; + pThis->cMaxItems = (uint32_t)cb; + pThis->cMaxChunks = cChunks; + + return pThis; +} + + +/* vmem_destroy implementation */ +void VBoxDtVMemDestroy(struct VBoxDtVMem *pThis) +{ + if (!pThis) + return; + AssertPtrReturnVoid(pThis); + AssertReturnVoid(pThis->u32Magic == VBOXDTVMEM_MAGIC); + + /* + * Invalidate the instance. + */ + RTSpinlockAcquire(pThis->hSpinlock); /* paranoia */ + pThis->u32Magic = 0; + RTSpinlockRelease(pThis->hSpinlock); + RTSpinlockDestroy(pThis->hSpinlock); + + /* + * Free the chunks, then the instance. + */ + uint32_t iChunk = pThis->cCurChunks; + while (iChunk-- > 0) + { + RTMemFree(pThis->apChunks[iChunk]); + pThis->apChunks[iChunk] = NULL; + } + RTMemFree(pThis); +} + + +/* vmem_alloc implementation */ +void *VBoxDtVMemAlloc(struct VBoxDtVMem *pThis, size_t cbMem, uint32_t fFlags) +{ + /* + * Validate input. + */ + AssertReturn(fFlags & VM_BESTFIT, NULL); + AssertReturn(fFlags & VM_SLEEP, NULL); + AssertReturn(cbMem == 1, NULL); + AssertPtrReturn(pThis, NULL); + AssertReturn(pThis->u32Magic == VBOXDTVMEM_MAGIC, NULL); + + /* + * Allocation loop. + */ + RTSpinlockAcquire(pThis->hSpinlock); + for (;;) + { + PVBOXDTVMEMCHUNK pChunk; + uint32_t const cChunks = pThis->cCurChunks; + + if (RT_LIKELY(pThis->cCurFree > 0)) + { + for (uint32_t iChunk = 0; iChunk < cChunks; iChunk++) + { + pChunk = pThis->apChunks[iChunk]; + if (pChunk->cCurFree > 0) + { + int iBit = ASMBitFirstClear(pChunk->bm, VBOXDTVMEMCHUNK_BITS); + AssertMsgReturnStmt(iBit >= 0 && (unsigned)iBit < VBOXDTVMEMCHUNK_BITS, ("%d\n", iBit), + RTSpinlockRelease(pThis->hSpinlock), + NULL); + + ASMBitSet(pChunk->bm, iBit); + pChunk->cCurFree--; + pThis->cCurFree--; + + uint32_t iRet = (uint32_t)iBit + pChunk->iFirst + pThis->uBase; + RTSpinlockRelease(pThis->hSpinlock); + return (void *)(uintptr_t)iRet; + } + } + AssertFailedBreak(); + } + + /* Out of resources? */ + if (cChunks >= pThis->cMaxChunks) + break; + + /* + * Allocate another chunk. + */ + uint32_t const iFirstBit = cChunks > 0 ? pThis->apChunks[cChunks - 1]->iFirst + VBOXDTVMEMCHUNK_BITS : 0; + uint32_t const cFreeBits = cChunks + 1 == pThis->cMaxChunks + ? pThis->cMaxItems - (iFirstBit - pThis->uBase) + : VBOXDTVMEMCHUNK_BITS; + Assert(cFreeBits <= VBOXDTVMEMCHUNK_BITS); + + RTSpinlockRelease(pThis->hSpinlock); + + pChunk = (PVBOXDTVMEMCHUNK)RTMemAllocZ(sizeof(*pChunk)); + if (!pChunk) + return NULL; + + pChunk->iFirst = iFirstBit; + pChunk->cCurFree = cFreeBits; + if (cFreeBits != VBOXDTVMEMCHUNK_BITS) + { + /* lazy bird. */ + uint32_t iBit = cFreeBits; + while (iBit < VBOXDTVMEMCHUNK_BITS) + { + ASMBitSet(pChunk->bm, iBit); + iBit++; + } + } + + RTSpinlockAcquire(pThis->hSpinlock); + + /* + * Insert the new chunk. If someone raced us here, we'll drop it to + * avoid wasting resources. + */ + if (pThis->cCurChunks == cChunks) + { + pThis->apChunks[cChunks] = pChunk; + pThis->cCurFree += pChunk->cCurFree; + pThis->cCurChunks += 1; + } + else + { + RTSpinlockRelease(pThis->hSpinlock); + RTMemFree(pChunk); + RTSpinlockAcquire(pThis->hSpinlock); + } + } + RTSpinlockRelease(pThis->hSpinlock); + + return NULL; +} + +/* vmem_free implementation */ +void VBoxDtVMemFree(struct VBoxDtVMem *pThis, void *pvMem, size_t cbMem) +{ + /* + * Validate input. + */ + AssertReturnVoid(cbMem == 1); + AssertPtrReturnVoid(pThis); + AssertReturnVoid(pThis->u32Magic == VBOXDTVMEM_MAGIC); + + AssertReturnVoid((uintptr_t)pvMem < UINT32_MAX); + uint32_t uMem = (uint32_t)(uintptr_t)pvMem; + AssertReturnVoid(uMem >= pThis->uBase); + uMem -= pThis->uBase; + AssertReturnVoid(uMem < pThis->cMaxItems); + + + /* + * Free it. + */ + RTSpinlockAcquire(pThis->hSpinlock); + uint32_t const iChunk = uMem / VBOXDTVMEMCHUNK_BITS; + if (iChunk < pThis->cCurChunks) + { + PVBOXDTVMEMCHUNK pChunk = pThis->apChunks[iChunk]; + uint32_t iBit = uMem - pChunk->iFirst; + AssertReturnVoidStmt(iBit < VBOXDTVMEMCHUNK_BITS, RTSpinlockRelease(pThis->hSpinlock)); + AssertReturnVoidStmt(ASMBitTestAndClear(pChunk->bm, iBit), RTSpinlockRelease(pThis->hSpinlock)); + + pChunk->cCurFree++; + pThis->cCurFree++; + } + + RTSpinlockRelease(pThis->hSpinlock); +} + + +/* + * + * Memory Allocators. + * Memory Allocators. + * Memory Allocators. + * + */ + + +/* kmem_alloc implementation */ +void *VBoxDtKMemAlloc(size_t cbMem, uint32_t fFlags) +{ + void *pvMem; +#ifdef HAVE_RTMEMALLOCEX_FEATURES + uint32_t fMemAllocFlags = fFlags & KM_NOSLEEP ? RTMEMALLOCEX_FLAGS_ANY_CTX : 0; +#else + uint32_t fMemAllocFlags = 0; + RT_NOREF_PV(fFlags); +#endif + int rc = RTMemAllocEx(cbMem, 0, fMemAllocFlags, &pvMem); + AssertRCReturn(rc, NULL); + AssertPtr(pvMem); + return pvMem; +} + + +/* kmem_zalloc implementation */ +void *VBoxDtKMemAllocZ(size_t cbMem, uint32_t fFlags) +{ + void *pvMem; +#ifdef HAVE_RTMEMALLOCEX_FEATURES + uint32_t fMemAllocFlags = (fFlags & KM_NOSLEEP ? RTMEMALLOCEX_FLAGS_ANY_CTX : 0) | RTMEMALLOCEX_FLAGS_ZEROED; +#else + uint32_t fMemAllocFlags = RTMEMALLOCEX_FLAGS_ZEROED; + RT_NOREF_PV(fFlags); +#endif + int rc = RTMemAllocEx(cbMem, 0, fMemAllocFlags, &pvMem); + AssertRCReturn(rc, NULL); + AssertPtr(pvMem); + return pvMem; +} + + +/* kmem_free implementation */ +void VBoxDtKMemFree(void *pvMem, size_t cbMem) +{ + RTMemFreeEx(pvMem, cbMem); +} + + +/** + * Memory cache mockup structure. + * No slab allocator here! + */ +struct VBoxDtMemCache +{ + uint32_t u32Magic; + size_t cbBuf; + size_t cbAlign; +}; + + +/* Limited kmem_cache_create implementation. */ +struct VBoxDtMemCache *VBoxDtKMemCacheCreate(const char *pszName, size_t cbBuf, size_t cbAlign, + PFNRT pfnCtor, PFNRT pfnDtor, PFNRT pfnReclaim, + void *pvUser, void *pvVM, uint32_t fFlags) +{ + /* + * Check the input. + */ + AssertReturn(cbBuf > 0 && cbBuf < _1G, NULL); + AssertReturn(RT_IS_POWER_OF_TWO(cbAlign), NULL); + AssertReturn(!pfnCtor, NULL); + AssertReturn(!pfnDtor, NULL); + AssertReturn(!pfnReclaim, NULL); + AssertReturn(!pvUser, NULL); + AssertReturn(!pvVM, NULL); + AssertReturn(!fFlags, NULL); + RT_NOREF_PV(pszName); + + /* + * Create a parameter container. Don't bother with anything fancy here yet, + * just get something working. + */ + struct VBoxDtMemCache *pThis = (struct VBoxDtMemCache *)RTMemAlloc(sizeof(*pThis)); + if (!pThis) + return NULL; + + pThis->cbAlign = cbAlign; + pThis->cbBuf = cbBuf; + return pThis; +} + + +/* Limited kmem_cache_destroy implementation. */ +void VBoxDtKMemCacheDestroy(struct VBoxDtMemCache *pThis) +{ + RTMemFree(pThis); +} + + +/* kmem_cache_alloc implementation. */ +void *VBoxDtKMemCacheAlloc(struct VBoxDtMemCache *pThis, uint32_t fFlags) +{ + void *pvMem; +#ifdef HAVE_RTMEMALLOCEX_FEATURES + uint32_t fMemAllocFlags = (fFlags & KM_NOSLEEP ? RTMEMALLOCEX_FLAGS_ANY_CTX : 0) | RTMEMALLOCEX_FLAGS_ZEROED; +#else + uint32_t fMemAllocFlags = RTMEMALLOCEX_FLAGS_ZEROED; + RT_NOREF_PV(fFlags); +#endif + int rc = RTMemAllocEx(pThis->cbBuf, /*pThis->cbAlign*/0, fMemAllocFlags, &pvMem); + AssertRCReturn(rc, NULL); + AssertPtr(pvMem); + return pvMem; +} + + +/* kmem_cache_free implementation. */ +void VBoxDtKMemCacheFree(struct VBoxDtMemCache *pThis, void *pvMem) +{ + RTMemFreeEx(pvMem, pThis->cbBuf); +} + + +/* + * + * Mutex Semaphore Wrappers. + * + */ + + +/** Initializes a mutex. */ +int VBoxDtMutexInit(struct VBoxDtMutex *pMtx) +{ + AssertReturn(pMtx != &g_DummyMtx, -1); + AssertPtr(pMtx); + + pMtx->hOwner = NIL_RTNATIVETHREAD; + pMtx->hMtx = NIL_RTSEMMUTEX; + int rc = RTSemMutexCreate(&pMtx->hMtx); + if (RT_SUCCESS(rc)) + return 0; + return -1; +} + + +/** Deletes a mutex. */ +void VBoxDtMutexDelete(struct VBoxDtMutex *pMtx) +{ + AssertReturnVoid(pMtx != &g_DummyMtx); + AssertPtr(pMtx); + if (pMtx->hMtx == NIL_RTSEMMUTEX) + return; + + Assert(pMtx->hOwner == NIL_RTNATIVETHREAD); + int rc = RTSemMutexDestroy(pMtx->hMtx); AssertRC(rc); + pMtx->hMtx = NIL_RTSEMMUTEX; +} + + +/* mutex_enter implementation */ +void VBoxDtMutexEnter(struct VBoxDtMutex *pMtx) +{ + AssertPtr(pMtx); + if (pMtx == &g_DummyMtx) + return; + + RTNATIVETHREAD hSelf = RTThreadNativeSelf(); + + int rc = RTSemMutexRequest(pMtx->hMtx, RT_INDEFINITE_WAIT); + AssertFatalRC(rc); + + Assert(pMtx->hOwner == NIL_RTNATIVETHREAD); + pMtx->hOwner = hSelf; +} + + +/* mutex_exit implementation */ +void VBoxDtMutexExit(struct VBoxDtMutex *pMtx) +{ + AssertPtr(pMtx); + if (pMtx == &g_DummyMtx) + return; + + Assert(pMtx->hOwner == RTThreadNativeSelf()); + + pMtx->hOwner = NIL_RTNATIVETHREAD; + int rc = RTSemMutexRelease(pMtx->hMtx); + AssertFatalRC(rc); +} + + +/* MUTEX_HELD implementation */ +bool VBoxDtMutexIsOwner(struct VBoxDtMutex *pMtx) +{ + AssertPtrReturn(pMtx, false); + if (pMtx == &g_DummyMtx) + return true; + return pMtx->hOwner == RTThreadNativeSelf(); +} + + + +/* + * + * Helpers for handling VTG structures. + * Helpers for handling VTG structures. + * Helpers for handling VTG structures. + * + */ + + + +/** + * Converts an attribute from VTG description speak to DTrace. + * + * @param pDtAttr The DTrace attribute (dst). + * @param pVtgAttr The VTG attribute descriptor (src). + */ +static void vboxDtVtgConvAttr(dtrace_attribute_t *pDtAttr, PCVTGDESCATTR pVtgAttr) +{ + pDtAttr->dtat_name = pVtgAttr->u8Code - 1; + pDtAttr->dtat_data = pVtgAttr->u8Data - 1; + pDtAttr->dtat_class = pVtgAttr->u8DataDep - 1; +} + +/** + * Gets a string from the string table. + * + * @returns Pointer to the string. + * @param pVtgHdr The VTG object header. + * @param offStrTab The string table offset. + */ +static const char *vboxDtVtgGetString(PVTGOBJHDR pVtgHdr, uint32_t offStrTab) +{ + Assert(offStrTab < pVtgHdr->cbStrTab); + return (const char *)pVtgHdr + pVtgHdr->offStrTab + offStrTab; +} + + + +/* + * + * DTrace Provider Interface. + * DTrace Provider Interface. + * DTrace Provider Interface. + * + */ + + +/** + * @callback_method_impl{dtrace_pops_t,dtps_provide} + */ +static void vboxDtPOps_Provide(void *pvProv, const dtrace_probedesc_t *pDtProbeDesc) +{ + PSUPDRVVDTPROVIDERCORE pProv = (PSUPDRVVDTPROVIDERCORE)pvProv; + AssertPtrReturnVoid(pProv); + LOG_DTRACE(("%s: %p / %p pDtProbeDesc=%p\n", __FUNCTION__, pProv, pProv->TracerData.DTrace.idProvider, pDtProbeDesc)); + + if (pDtProbeDesc) + return; /* We don't generate probes, so never mind these requests. */ + + if (pProv->TracerData.DTrace.fZombie) + return; + + dtrace_provider_id_t const idProvider = pProv->TracerData.DTrace.idProvider; + AssertPtrReturnVoid(idProvider); + + AssertPtrReturnVoid(pProv->pHdr); + AssertReturnVoid(pProv->pHdr->offProbeLocs != 0); + uint32_t const cProbeLocs = pProv->pHdr->cbProbeLocs / sizeof(VTGPROBELOC); + + /* Need a buffer for extracting the function names and mangling them in + case of collision. */ + size_t const cbFnNmBuf = _4K + _1K; + char *pszFnNmBuf = (char *)RTMemAlloc(cbFnNmBuf); + if (!pszFnNmBuf) + return; + + /* + * Itereate the probe location list and register all probes related to + * this provider. + */ + uint16_t const idxProv = (uint16_t)((PVTGDESCPROVIDER)((uintptr_t)pProv->pHdr + pProv->pHdr->offProviders) - pProv->pDesc); + for (uint32_t idxProbeLoc = 0; idxProbeLoc < cProbeLocs; idxProbeLoc++) + { + /* Skip probe location belonging to other providers or once that + we've already reported. */ + PCVTGPROBELOC pProbeLocRO = &pProv->paProbeLocsRO[idxProbeLoc]; + PVTGDESCPROBE pProbeDesc = pProbeLocRO->pProbe; + if (pProbeDesc->idxProvider != idxProv) + continue; + + uint32_t *pidProbe; + if (!pProv->fUmod) + pidProbe = (uint32_t *)&pProbeLocRO->idProbe; + else + pidProbe = &pProv->paR0ProbeLocs[idxProbeLoc].idProbe; + if (*pidProbe != 0) + continue; + + /* The function name may need to be stripped since we're using C++ + compilers for most of the code. ASSUMES nobody are brave/stupid + enough to use function pointer returns without typedef'ing + properly them (e.g. signal). */ + const char *pszPrbName = vboxDtVtgGetString(pProv->pHdr, pProbeDesc->offName); + const char *pszFunc = pProbeLocRO->pszFunction; + const char *psz = strchr(pProbeLocRO->pszFunction, '('); + size_t cch; + if (psz) + { + /* skip blanks preceeding the parameter parenthesis. */ + while ( (uintptr_t)psz > (uintptr_t)pProbeLocRO->pszFunction + && RT_C_IS_BLANK(psz[-1])) + psz--; + + /* Find the start of the function name. */ + pszFunc = psz - 1; + while ((uintptr_t)pszFunc > (uintptr_t)pProbeLocRO->pszFunction) + { + char ch = pszFunc[-1]; + if (!RT_C_IS_ALNUM(ch) && ch != '_' && ch != ':') + break; + pszFunc--; + } + cch = psz - pszFunc; + } + else + cch = strlen(pszFunc); + RTStrCopyEx(pszFnNmBuf, cbFnNmBuf, pszFunc, cch); + + /* Look up the probe, if we have one in the same function, mangle + the function name a little to avoid having to deal with having + multiple location entries with the same probe ID. (lazy bird) */ + Assert(!*pidProbe); + if (dtrace_probe_lookup(idProvider, pProv->pszModName, pszFnNmBuf, pszPrbName) != DTRACE_IDNONE) + { + RTStrPrintf(pszFnNmBuf+cch, cbFnNmBuf - cch, "-%u", pProbeLocRO->uLine); + if (dtrace_probe_lookup(idProvider, pProv->pszModName, pszFnNmBuf, pszPrbName) != DTRACE_IDNONE) + { + unsigned iOrd = 2; + while (iOrd < 128) + { + RTStrPrintf(pszFnNmBuf+cch, cbFnNmBuf - cch, "-%u-%u", pProbeLocRO->uLine, iOrd); + if (dtrace_probe_lookup(idProvider, pProv->pszModName, pszFnNmBuf, pszPrbName) == DTRACE_IDNONE) + break; + iOrd++; + } + if (iOrd >= 128) + { + LogRel(("VBoxDrv: More than 128 duplicate probe location instances at line %u in function %s [%s], probe %s\n", + pProbeLocRO->uLine, pProbeLocRO->pszFunction, pszFnNmBuf, pszPrbName)); + continue; + } + } + } + + /* Create the probe. */ + AssertCompile(sizeof(*pidProbe) == sizeof(dtrace_id_t)); + *pidProbe = dtrace_probe_create(idProvider, pProv->pszModName, pszFnNmBuf, pszPrbName, + 1 /*aframes*/, (void *)(uintptr_t)idxProbeLoc); + pProv->TracerData.DTrace.cProvidedProbes++; + } + + RTMemFree(pszFnNmBuf); + LOG_DTRACE(("%s: returns\n", __FUNCTION__)); +} + + +/** + * @callback_method_impl{dtrace_pops_t,dtps_enable} + */ +static int vboxDtPOps_Enable(void *pvProv, dtrace_id_t idProbe, void *pvProbe) +{ + PSUPDRVVDTPROVIDERCORE pProv = (PSUPDRVVDTPROVIDERCORE)pvProv; + LOG_DTRACE(("%s: %p / %p - %#x / %p\n", __FUNCTION__, pProv, pProv->TracerData.DTrace.idProvider, idProbe, pvProbe)); + AssertPtrReturn(pProv->TracerData.DTrace.idProvider, EINVAL); + RT_NOREF_PV(idProbe); + + if (!pProv->TracerData.DTrace.fZombie) + { + uint32_t idxProbeLoc = (uint32_t)(uintptr_t)pvProbe; + PVTGPROBELOC32 pProbeLocEn = (PVTGPROBELOC32)( (uintptr_t)pProv->pvProbeLocsEn + idxProbeLoc * pProv->cbProbeLocsEn); + PCVTGPROBELOC pProbeLocRO = (PVTGPROBELOC)&pProv->paProbeLocsRO[idxProbeLoc]; + PCVTGDESCPROBE pProbeDesc = pProbeLocRO->pProbe; + uint32_t const idxProbe = pProbeDesc->idxEnabled; + + if (!pProv->fUmod) + { + if (!pProbeLocEn->fEnabled) + { + pProbeLocEn->fEnabled = 1; + ASMAtomicIncU32(&pProv->pacProbeEnabled[idxProbe]); + ASMAtomicIncU32(&pProv->pDesc->cProbesEnabled); + ASMAtomicIncU32(&pProv->pDesc->uSettingsSerialNo); + } + } + else + { + /* Update kernel mode structure */ + if (!pProv->paR0ProbeLocs[idxProbeLoc].fEnabled) + { + pProv->paR0ProbeLocs[idxProbeLoc].fEnabled = 1; + ASMAtomicIncU32(&pProv->paR0Probes[idxProbe].cEnabled); + ASMAtomicIncU32(&pProv->pDesc->cProbesEnabled); + ASMAtomicIncU32(&pProv->pDesc->uSettingsSerialNo); + } + + /* Update user mode structure. */ + pProbeLocEn->fEnabled = 1; + pProv->pacProbeEnabled[idxProbe] = pProv->paR0Probes[idxProbe].cEnabled; + } + } + + return 0; +} + + +/** + * @callback_method_impl{dtrace_pops_t,dtps_disable} + */ +static void vboxDtPOps_Disable(void *pvProv, dtrace_id_t idProbe, void *pvProbe) +{ + PSUPDRVVDTPROVIDERCORE pProv = (PSUPDRVVDTPROVIDERCORE)pvProv; + AssertPtrReturnVoid(pProv); + LOG_DTRACE(("%s: %p / %p - %#x / %p\n", __FUNCTION__, pProv, pProv->TracerData.DTrace.idProvider, idProbe, pvProbe)); + AssertPtrReturnVoid(pProv->TracerData.DTrace.idProvider); + RT_NOREF_PV(idProbe); + + if (!pProv->TracerData.DTrace.fZombie) + { + uint32_t idxProbeLoc = (uint32_t)(uintptr_t)pvProbe; + PVTGPROBELOC32 pProbeLocEn = (PVTGPROBELOC32)( (uintptr_t)pProv->pvProbeLocsEn + idxProbeLoc * pProv->cbProbeLocsEn); + PCVTGPROBELOC pProbeLocRO = (PVTGPROBELOC)&pProv->paProbeLocsRO[idxProbeLoc]; + PCVTGDESCPROBE pProbeDesc = pProbeLocRO->pProbe; + uint32_t const idxProbe = pProbeDesc->idxEnabled; + + if (!pProv->fUmod) + { + if (pProbeLocEn->fEnabled) + { + pProbeLocEn->fEnabled = 0; + ASMAtomicDecU32(&pProv->pacProbeEnabled[idxProbe]); + ASMAtomicDecU32(&pProv->pDesc->cProbesEnabled); + ASMAtomicIncU32(&pProv->pDesc->uSettingsSerialNo); + } + } + else + { + /* Update kernel mode structure */ + if (pProv->paR0ProbeLocs[idxProbeLoc].fEnabled) + { + pProv->paR0ProbeLocs[idxProbeLoc].fEnabled = 0; + ASMAtomicDecU32(&pProv->paR0Probes[idxProbe].cEnabled); + ASMAtomicDecU32(&pProv->pDesc->cProbesEnabled); + ASMAtomicIncU32(&pProv->pDesc->uSettingsSerialNo); + } + + /* Update user mode structure. */ + pProbeLocEn->fEnabled = 0; + pProv->pacProbeEnabled[idxProbe] = pProv->paR0Probes[idxProbe].cEnabled; + } + } +} + + +/** + * @callback_method_impl{dtrace_pops_t,dtps_getargdesc} + */ +static void vboxDtPOps_GetArgDesc(void *pvProv, dtrace_id_t idProbe, void *pvProbe, + dtrace_argdesc_t *pArgDesc) +{ + PSUPDRVVDTPROVIDERCORE pProv = (PSUPDRVVDTPROVIDERCORE)pvProv; + unsigned uArg = pArgDesc->dtargd_ndx; + RT_NOREF_PV(idProbe); + + pArgDesc->dtargd_ndx = DTRACE_ARGNONE; + AssertPtrReturnVoid(pProv); + LOG_DTRACE(("%s: %p / %p - %#x / %p uArg=%d\n", __FUNCTION__, pProv, pProv->TracerData.DTrace.idProvider, idProbe, pvProbe, uArg)); + AssertPtrReturnVoid(pProv->TracerData.DTrace.idProvider); + + if (!pProv->TracerData.DTrace.fZombie) + { + uint32_t idxProbeLoc = (uint32_t)(uintptr_t)pvProbe; + PCVTGPROBELOC pProbeLocRO = (PVTGPROBELOC)&pProv->paProbeLocsRO[idxProbeLoc]; + PCVTGDESCPROBE pProbeDesc = pProbeLocRO->pProbe; + PCVTGDESCARGLIST pArgList = (PCVTGDESCARGLIST)( (uintptr_t)pProv->pHdr + + pProv->pHdr->offArgLists + + pProbeDesc->offArgList); + AssertReturnVoid(pProbeDesc->offArgList < pProv->pHdr->cbArgLists); + + if (uArg < pArgList->cArgs) + { + const char *pszType = vboxDtVtgGetString(pProv->pHdr, pArgList->aArgs[uArg].offType); + size_t cchType = strlen(pszType); + if (cchType < sizeof(pArgDesc->dtargd_native)) + { + memcpy(pArgDesc->dtargd_native, pszType, cchType + 1); + /** @todo mapping? */ + pArgDesc->dtargd_ndx = uArg; + LOG_DTRACE(("%s: returns dtargd_native = %s\n", __FUNCTION__, pArgDesc->dtargd_native)); + return; + } + } + } +} + + +/** + * @callback_method_impl{dtrace_pops_t,dtps_getargval} + */ +static uint64_t vboxDtPOps_GetArgVal(void *pvProv, dtrace_id_t idProbe, void *pvProbe, + int iArg, int cFrames) +{ + PSUPDRVVDTPROVIDERCORE pProv = (PSUPDRVVDTPROVIDERCORE)pvProv; + AssertPtrReturn(pProv, UINT64_MAX); + LOG_DTRACE(("%s: %p / %p - %#x / %p iArg=%d cFrames=%u\n", __FUNCTION__, pProv, pProv->TracerData.DTrace.idProvider, idProbe, pvProbe, iArg, cFrames)); + AssertReturn(iArg >= 5, UINT64_MAX); + RT_NOREF_PV(idProbe); RT_NOREF_PV(cFrames); + + if (pProv->TracerData.DTrace.fZombie) + return UINT64_MAX; + + uint32_t idxProbeLoc = (uint32_t)(uintptr_t)pvProbe; + PCVTGPROBELOC pProbeLocRO = (PVTGPROBELOC)&pProv->paProbeLocsRO[idxProbeLoc]; + PCVTGDESCPROBE pProbeDesc = pProbeLocRO->pProbe; + PCVTGDESCARGLIST pArgList = (PCVTGDESCARGLIST)( (uintptr_t)pProv->pHdr + + pProv->pHdr->offArgLists + + pProbeDesc->offArgList); + AssertReturn(pProbeDesc->offArgList < pProv->pHdr->cbArgLists, UINT64_MAX); + + PVBDTSTACKDATA pData = vboxDtGetStackData(); + + /* + * Get the stack data. This is a wee bit complicated on 32-bit systems + * since we want to support 64-bit integer arguments. + */ + uint64_t u64Ret; + if (iArg >= 20) + u64Ret = UINT64_MAX; + else if (pData->enmCaller == kVBoxDtCaller_ProbeFireKernel) + { +#if ARCH_BITS == 64 + u64Ret = pData->u.ProbeFireKernel.pauStackArgs[iArg - 5]; +#else + if ( !pArgList->fHaveLargeArgs + || iArg >= pArgList->cArgs) + u64Ret = pData->u.ProbeFireKernel.pauStackArgs[iArg - 5]; + else + { + /* Similar to what we did for mac in when calling dtrace_probe(). */ + uint32_t offArg = 0; + for (int i = 5; i < iArg; i++) + if (VTG_TYPE_IS_LARGE(pArgList->aArgs[iArg].fType)) + offArg++; + u64Ret = pData->u.ProbeFireKernel.pauStackArgs[iArg - 5 + offArg]; + if (VTG_TYPE_IS_LARGE(pArgList->aArgs[iArg].fType)) + u64Ret |= (uint64_t)pData->u.ProbeFireKernel.pauStackArgs[iArg - 5 + offArg + 1] << 32; + } +#endif + } + else if (pData->enmCaller == kVBoxDtCaller_ProbeFireUser) + { + int offArg = pData->u.ProbeFireUser.offArg; + PCSUPDRVTRACERUSRCTX pCtx = pData->u.ProbeFireUser.pCtx; + AssertPtrReturn(pCtx, UINT64_MAX); + + if (pCtx->cBits == 32) + { + if ( !pArgList->fHaveLargeArgs + || iArg >= pArgList->cArgs) + { + if (iArg + offArg < (int)RT_ELEMENTS(pCtx->u.X86.aArgs)) + u64Ret = pCtx->u.X86.aArgs[iArg + offArg]; + else + u64Ret = UINT64_MAX; + } + else + { + for (int i = 5; i < iArg; i++) + if (VTG_TYPE_IS_LARGE(pArgList->aArgs[iArg].fType)) + offArg++; + if (offArg + iArg < (int)RT_ELEMENTS(pCtx->u.X86.aArgs)) + { + u64Ret = pCtx->u.X86.aArgs[iArg + offArg]; + if ( VTG_TYPE_IS_LARGE(pArgList->aArgs[iArg].fType) + && offArg + iArg + 1 < (int)RT_ELEMENTS(pCtx->u.X86.aArgs)) + u64Ret |= (uint64_t)pCtx->u.X86.aArgs[iArg + offArg + 1] << 32; + } + else + u64Ret = UINT64_MAX; + } + } + else + { + if (iArg + offArg < (int)RT_ELEMENTS(pCtx->u.Amd64.aArgs)) + u64Ret = pCtx->u.Amd64.aArgs[iArg + offArg]; + else + u64Ret = UINT64_MAX; + } + } + else + AssertFailedReturn(UINT64_MAX); + + LOG_DTRACE(("%s: returns %#llx\n", __FUNCTION__, u64Ret)); + return u64Ret; +} + + +/** + * @callback_method_impl{dtrace_pops_t,dtps_destroy} + */ +static void vboxDtPOps_Destroy(void *pvProv, dtrace_id_t idProbe, void *pvProbe) +{ + PSUPDRVVDTPROVIDERCORE pProv = (PSUPDRVVDTPROVIDERCORE)pvProv; + AssertPtrReturnVoid(pProv); + LOG_DTRACE(("%s: %p / %p - %#x / %p\n", __FUNCTION__, pProv, pProv->TracerData.DTrace.idProvider, idProbe, pvProbe)); + AssertReturnVoid(pProv->TracerData.DTrace.cProvidedProbes > 0); + AssertPtrReturnVoid(pProv->TracerData.DTrace.idProvider); + + if (!pProv->TracerData.DTrace.fZombie) + { + uint32_t idxProbeLoc = (uint32_t)(uintptr_t)pvProbe; + PCVTGPROBELOC pProbeLocRO = (PVTGPROBELOC)&pProv->paProbeLocsRO[idxProbeLoc]; + uint32_t *pidProbe; + if (!pProv->fUmod) + { + pidProbe = (uint32_t *)&pProbeLocRO->idProbe; + Assert(!pProbeLocRO->fEnabled); + Assert(*pidProbe == idProbe); + } + else + { + pidProbe = &pProv->paR0ProbeLocs[idxProbeLoc].idProbe; + Assert(!pProv->paR0ProbeLocs[idxProbeLoc].fEnabled); + Assert(*pidProbe == idProbe); NOREF(idProbe); + } + *pidProbe = 0; + } + pProv->TracerData.DTrace.cProvidedProbes--; +} + + + +/** + * DTrace provider method table. + */ +static const dtrace_pops_t g_vboxDtVtgProvOps = +{ + /* .dtps_provide = */ vboxDtPOps_Provide, + /* .dtps_provide_module = */ NULL, + /* .dtps_enable = */ vboxDtPOps_Enable, + /* .dtps_disable = */ vboxDtPOps_Disable, + /* .dtps_suspend = */ NULL, + /* .dtps_resume = */ NULL, + /* .dtps_getargdesc = */ vboxDtPOps_GetArgDesc, + /* .dtps_getargval = */ vboxDtPOps_GetArgVal, + /* .dtps_usermode = */ NULL, + /* .dtps_destroy = */ vboxDtPOps_Destroy +}; + + + + +/* + * + * Support Driver Tracer Interface. + * Support Driver Tracer Interface. + * Support Driver Tracer Interface. + * + */ + + + +/** + * interface_method_impl{SUPDRVTRACERREG,pfnProbeFireKernel} + */ +static DECLCALLBACK(void) vboxDtTOps_ProbeFireKernel(struct VTGPROBELOC *pVtgProbeLoc, uintptr_t uArg0, uintptr_t uArg1, uintptr_t uArg2, + uintptr_t uArg3, uintptr_t uArg4) +{ + AssertPtrReturnVoid(pVtgProbeLoc); + LOG_DTRACE(("%s: %p / %p\n", __FUNCTION__, pVtgProbeLoc, pVtgProbeLoc->idProbe)); + AssertPtrReturnVoid(pVtgProbeLoc->pProbe); + AssertPtrReturnVoid(pVtgProbeLoc->pszFunction); + + VBDT_SETUP_STACK_DATA(kVBoxDtCaller_ProbeFireKernel); + + pStackData->u.ProbeFireKernel.pauStackArgs = &uArg4 + 1; + +#if defined(RT_OS_DARWIN) && ARCH_BITS == 32 + /* + * Convert arguments from uintptr_t to uint64_t. + */ + PVTGDESCPROBE pProbe = pVtgProbeLoc->pProbe; + AssertPtrReturnVoid(pProbe); + PVTGOBJHDR pVtgHdr = (PVTGOBJHDR)((uintptr_t)pProbe + pProbe->offObjHdr); + AssertPtrReturnVoid(pVtgHdr); + PVTGDESCARGLIST pArgList = (PVTGDESCARGLIST)((uintptr_t)pVtgHdr + pVtgHdr->offArgLists + pProbe->offArgList); + AssertPtrReturnVoid(pArgList); + if (!pArgList->fHaveLargeArgs) + dtrace_probe(pVtgProbeLoc->idProbe, uArg0, uArg1, uArg2, uArg3, uArg4); + else + { + uintptr_t *auSrcArgs = &uArg0; + uint32_t iSrcArg = 0; + uint32_t iDstArg = 0; + uint64_t au64DstArgs[5]; + + while ( iDstArg < RT_ELEMENTS(au64DstArgs) + && iSrcArg < pArgList->cArgs) + { + au64DstArgs[iDstArg] = auSrcArgs[iSrcArg]; + if (VTG_TYPE_IS_LARGE(pArgList->aArgs[iDstArg].fType)) + au64DstArgs[iDstArg] |= (uint64_t)auSrcArgs[++iSrcArg] << 32; + iSrcArg++; + iDstArg++; + } + while (iDstArg < RT_ELEMENTS(au64DstArgs)) + au64DstArgs[iDstArg++] = auSrcArgs[iSrcArg++]; + + pStackData->u.ProbeFireKernel.pauStackArgs = &auSrcArgs[iSrcArg]; + dtrace_probe(pVtgProbeLoc->idProbe, au64DstArgs[0], au64DstArgs[1], au64DstArgs[2], au64DstArgs[3], au64DstArgs[4]); + } +#else + dtrace_probe(pVtgProbeLoc->idProbe, uArg0, uArg1, uArg2, uArg3, uArg4); +#endif + + VBDT_CLEAR_STACK_DATA(); + LOG_DTRACE(("%s: returns\n", __FUNCTION__)); +} + + +/** + * interface_method_impl{SUPDRVTRACERREG,pfnProbeFireUser} + */ +static DECLCALLBACK(void) vboxDtTOps_ProbeFireUser(PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, PCSUPDRVTRACERUSRCTX pCtx, + PCVTGOBJHDR pVtgHdr, PCVTGPROBELOC pProbeLocRO) +{ + LOG_DTRACE(("%s: %p / %p\n", __FUNCTION__, pCtx, pCtx->idProbe)); + AssertPtrReturnVoid(pProbeLocRO); + AssertPtrReturnVoid(pVtgHdr); + RT_NOREF_PV(pThis); + RT_NOREF_PV(pSession); + VBDT_SETUP_STACK_DATA(kVBoxDtCaller_ProbeFireUser); + + if (pCtx->cBits == 32) + { + pStackData->u.ProbeFireUser.pCtx = pCtx; + pStackData->u.ProbeFireUser.offArg = 0; + +#if ARCH_BITS == 64 || defined(RT_OS_DARWIN) + /* + * Combine two 32-bit arguments into one 64-bit argument where needed. + */ + PVTGDESCPROBE pProbeDesc = pProbeLocRO->pProbe; + AssertPtrReturnVoid(pProbeDesc); + PVTGDESCARGLIST pArgList = (PVTGDESCARGLIST)((uintptr_t)pVtgHdr + pVtgHdr->offArgLists + pProbeDesc->offArgList); + AssertPtrReturnVoid(pArgList); + + if (!pArgList->fHaveLargeArgs) + dtrace_probe(pCtx->idProbe, + pCtx->u.X86.aArgs[0], + pCtx->u.X86.aArgs[1], + pCtx->u.X86.aArgs[2], + pCtx->u.X86.aArgs[3], + pCtx->u.X86.aArgs[4]); + else + { + uint32_t const *auSrcArgs = &pCtx->u.X86.aArgs[0]; + uint32_t iSrcArg = 0; + uint32_t iDstArg = 0; + uint64_t au64DstArgs[5]; + + while ( iDstArg < RT_ELEMENTS(au64DstArgs) + && iSrcArg < pArgList->cArgs) + { + au64DstArgs[iDstArg] = auSrcArgs[iSrcArg]; + if (VTG_TYPE_IS_LARGE(pArgList->aArgs[iDstArg].fType)) + au64DstArgs[iDstArg] |= (uint64_t)auSrcArgs[++iSrcArg] << 32; + iSrcArg++; + iDstArg++; + } + while (iDstArg < RT_ELEMENTS(au64DstArgs)) + au64DstArgs[iDstArg++] = auSrcArgs[iSrcArg++]; + + pStackData->u.ProbeFireUser.offArg = iSrcArg - RT_ELEMENTS(au64DstArgs); + dtrace_probe(pCtx->idProbe, au64DstArgs[0], au64DstArgs[1], au64DstArgs[2], au64DstArgs[3], au64DstArgs[4]); + } +#else + dtrace_probe(pCtx->idProbe, + pCtx->u.X86.aArgs[0], + pCtx->u.X86.aArgs[1], + pCtx->u.X86.aArgs[2], + pCtx->u.X86.aArgs[3], + pCtx->u.X86.aArgs[4]); +#endif + } + else if (pCtx->cBits == 64) + { + pStackData->u.ProbeFireUser.pCtx = pCtx; + pStackData->u.ProbeFireUser.offArg = 0; + dtrace_probe(pCtx->idProbe, + pCtx->u.Amd64.aArgs[0], + pCtx->u.Amd64.aArgs[1], + pCtx->u.Amd64.aArgs[2], + pCtx->u.Amd64.aArgs[3], + pCtx->u.Amd64.aArgs[4]); + } + else + AssertFailed(); + + VBDT_CLEAR_STACK_DATA(); + LOG_DTRACE(("%s: returns\n", __FUNCTION__)); +} + + +/** + * interface_method_impl{SUPDRVTRACERREG,pfnTracerOpen} + */ +static DECLCALLBACK(int) vboxDtTOps_TracerOpen(PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uint32_t uCookie, + uintptr_t uArg, uintptr_t *puSessionData) +{ + if (uCookie != RT_MAKE_U32_FROM_U8('V', 'B', 'D', 'T')) + return VERR_INVALID_MAGIC; + if (uArg) + return VERR_INVALID_PARAMETER; + RT_NOREF_PV(pThis); RT_NOREF_PV(pSession); + VBDT_SETUP_STACK_DATA(kVBoxDtCaller_Generic); + + int rc = dtrace_open((dtrace_state_t **)puSessionData, VBoxDtGetCurrentCreds()); + + VBDT_CLEAR_STACK_DATA(); + return RTErrConvertFromErrno(rc); +} + + +/** + * interface_method_impl{SUPDRVTRACERREG,pfnTracerClose} + */ +static DECLCALLBACK(int) vboxDtTOps_TracerIoCtl(PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uintptr_t uSessionData, + uintptr_t uCmd, uintptr_t uArg, int32_t *piRetVal) +{ + AssertPtrReturn(uSessionData, VERR_INVALID_POINTER); + RT_NOREF_PV(pThis); RT_NOREF_PV(pSession); + VBDT_SETUP_STACK_DATA(kVBoxDtCaller_Generic); + + int rc = dtrace_ioctl((dtrace_state_t *)uSessionData, (intptr_t)uCmd, (intptr_t)uArg, piRetVal); + + VBDT_CLEAR_STACK_DATA(); + return RTErrConvertFromErrno(rc); +} + + +/** + * interface_method_impl{SUPDRVTRACERREG,pfnTracerClose} + */ +static DECLCALLBACK(void) vboxDtTOps_TracerClose(PCSUPDRVTRACERREG pThis, PSUPDRVSESSION pSession, uintptr_t uSessionData) +{ + AssertPtrReturnVoid(uSessionData); + RT_NOREF_PV(pThis); RT_NOREF_PV(pSession); + VBDT_SETUP_STACK_DATA(kVBoxDtCaller_Generic); + + dtrace_close((dtrace_state_t *)uSessionData); + + VBDT_CLEAR_STACK_DATA(); +} + + +/** + * interface_method_impl{SUPDRVTRACERREG,pfnProviderRegister} + */ +static DECLCALLBACK(int) vboxDtTOps_ProviderRegister(PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore) +{ + LOG_DTRACE(("%s: %p %s/%s\n", __FUNCTION__, pThis, pCore->pszModName, pCore->pszName)); + AssertReturn(pCore->TracerData.DTrace.idProvider == 0, VERR_INTERNAL_ERROR_3); + RT_NOREF_PV(pThis); + VBDT_SETUP_STACK_DATA(kVBoxDtCaller_Generic); + + PVTGDESCPROVIDER pDesc = pCore->pDesc; + dtrace_pattr_t DtAttrs; + vboxDtVtgConvAttr(&DtAttrs.dtpa_provider, &pDesc->AttrSelf); + vboxDtVtgConvAttr(&DtAttrs.dtpa_mod, &pDesc->AttrModules); + vboxDtVtgConvAttr(&DtAttrs.dtpa_func, &pDesc->AttrFunctions); + vboxDtVtgConvAttr(&DtAttrs.dtpa_name, &pDesc->AttrNames); + vboxDtVtgConvAttr(&DtAttrs.dtpa_args, &pDesc->AttrArguments); + + /* Note! DTrace may call us back before dtrace_register returns, so we + have to point it to pCore->TracerData.DTrace.idProvider. */ + AssertCompile(sizeof(dtrace_provider_id_t) == sizeof(pCore->TracerData.DTrace.idProvider)); + int rc = dtrace_register(pCore->pszName, + &DtAttrs, + DTRACE_PRIV_KERNEL, + NULL /* cred */, + &g_vboxDtVtgProvOps, + pCore, + &pCore->TracerData.DTrace.idProvider); + if (!rc) + { + LOG_DTRACE(("%s: idProvider=%p\n", __FUNCTION__, pCore->TracerData.DTrace.idProvider)); + AssertPtr(pCore->TracerData.DTrace.idProvider); + rc = VINF_SUCCESS; + } + else + { + pCore->TracerData.DTrace.idProvider = 0; + rc = RTErrConvertFromErrno(rc); + } + + VBDT_CLEAR_STACK_DATA(); + LOG_DTRACE(("%s: returns %Rrc\n", __FUNCTION__, rc)); + return rc; +} + + +/** + * interface_method_impl{SUPDRVTRACERREG,pfnProviderDeregister} + */ +static DECLCALLBACK(int) vboxDtTOps_ProviderDeregister(PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore) +{ + uintptr_t idProvider = pCore->TracerData.DTrace.idProvider; + LOG_DTRACE(("%s: %p / %p\n", __FUNCTION__, pThis, idProvider)); + AssertPtrReturn(idProvider, VERR_INTERNAL_ERROR_3); + RT_NOREF_PV(pThis); + VBDT_SETUP_STACK_DATA(kVBoxDtCaller_Generic); + + dtrace_invalidate(idProvider); + int rc = dtrace_unregister(idProvider); + if (!rc) + { + pCore->TracerData.DTrace.idProvider = 0; + rc = VINF_SUCCESS; + } + else + { + AssertMsg(rc == EBUSY, ("%d\n", rc)); + pCore->TracerData.DTrace.fZombie = true; + rc = VERR_TRY_AGAIN; + } + + VBDT_CLEAR_STACK_DATA(); + LOG_DTRACE(("%s: returns %Rrc\n", __FUNCTION__, rc)); + return rc; +} + + +/** + * interface_method_impl{SUPDRVTRACERREG,pfnProviderDeregisterZombie} + */ +static DECLCALLBACK(int) vboxDtTOps_ProviderDeregisterZombie(PCSUPDRVTRACERREG pThis, PSUPDRVVDTPROVIDERCORE pCore) +{ + uintptr_t idProvider = pCore->TracerData.DTrace.idProvider; + LOG_DTRACE(("%s: %p / %p\n", __FUNCTION__, pThis, idProvider)); + AssertPtrReturn(idProvider, VERR_INTERNAL_ERROR_3); + Assert(pCore->TracerData.DTrace.fZombie); + RT_NOREF_PV(pThis); + VBDT_SETUP_STACK_DATA(kVBoxDtCaller_Generic); + + int rc = dtrace_unregister(idProvider); + if (!rc) + { + pCore->TracerData.DTrace.idProvider = 0; + rc = VINF_SUCCESS; + } + else + { + AssertMsg(rc == EBUSY, ("%d\n", rc)); + rc = VERR_TRY_AGAIN; + } + + VBDT_CLEAR_STACK_DATA(); + LOG_DTRACE(("%s: returns %Rrc\n", __FUNCTION__, rc)); + return rc; +} + + + +/** + * The tracer registration record of the VBox DTrace implementation + */ +static SUPDRVTRACERREG g_VBoxDTraceReg = +{ + SUPDRVTRACERREG_MAGIC, + SUPDRVTRACERREG_VERSION, + vboxDtTOps_ProbeFireKernel, + vboxDtTOps_ProbeFireUser, + vboxDtTOps_TracerOpen, + vboxDtTOps_TracerIoCtl, + vboxDtTOps_TracerClose, + vboxDtTOps_ProviderRegister, + vboxDtTOps_ProviderDeregister, + vboxDtTOps_ProviderDeregisterZombie, + SUPDRVTRACERREG_MAGIC +}; + + + +/** + * Module termination code. + * + * @param hMod Opque module handle. + */ +DECLEXPORT(void) ModuleTerm(void *hMod) +{ + SUPR0TracerDeregisterImpl(hMod, NULL); + dtrace_detach(); + vboxDtTermThreadDb(); +} + + +/** + * Module initialization code. + * + * @param hMod Opque module handle. + */ +DECLEXPORT(int) ModuleInit(void *hMod) +{ + int rc = vboxDtInitThreadDb(); + if (RT_SUCCESS(rc)) + { + rc = dtrace_attach(); + if (rc == DDI_SUCCESS) + { + rc = SUPR0TracerRegisterImpl(hMod, NULL, &g_VBoxDTraceReg, &g_pVBoxDTraceHlp); + if (RT_SUCCESS(rc)) + return rc; + + dtrace_detach(); + } + else + { + SUPR0Printf("dtrace_attach -> %d\n", rc); + rc = VERR_INTERNAL_ERROR_5; + } + vboxDtTermThreadDb(); + } + else + SUPR0Printf("vboxDtInitThreadDb -> %d\n", rc); + + return rc; +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0A.asm b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0A.asm new file mode 100644 index 00000000..299606a2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0A.asm @@ -0,0 +1,32 @@ +; $Id: VBoxDTraceR0A.asm $ +;; @file +; VBoxDTraceR0 - Assembly Hacks. +; +; Contributed by: bird +; + +; +; Copyright (C) 2012-2023 Oracle and/or its affiliates. +; +; This file is part of VirtualBox base platform packages, as +; available from http://www.virtualbox.org. +; +; The contents of this file are subject to the terms of the Common +; Development and Distribution License Version 1.0 (CDDL) only, as it +; comes in the "COPYING.CDDL" file of the VirtualBox distribution. +; +; SPDX-License-Identifier: CDDL-1.0 +; + + + +%include "iprt/asmdefs.mac" + +BEGINCODE + + +extern NAME(dtrace_probe) + +GLOBALNAME dtrace_probe6 + jmp NAME(dtrace_probe) + diff --git a/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceWrapper.cpp b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceWrapper.cpp new file mode 100644 index 00000000..7221e7c3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceWrapper.cpp @@ -0,0 +1,202 @@ +/* $Id: VBoxDTraceWrapper.cpp $ */ +/** @file + * VBoxDTrace - Wrapper that selects the right dtrace implemetation and adds + * our library to the search path. + */ + +/* + * Copyright (C) 2016-2023 Oracle and/or its affiliates. + * + * This file is part of VirtualBox base platform packages, as + * available from http://www.virtualbox.org. + * + * The contents of this file are subject to the terms of the Common + * Development and Distribution License Version 1.0 (CDDL) only, as it + * comes in the "COPYING.CDDL" file of the VirtualBox distribution. + * + * SPDX-License-Identifier: CDDL-1.0 + */ + + +/********************************************************************************************************************************* +* Header Files * +*********************************************************************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "../../Main/include/ExtPackUtil.h" + + +/********************************************************************************************************************************* +* Defined Constants And Macros * +*********************************************************************************************************************************/ +/** The VBoxDTrace extension pack name. */ +#define VBOX_EXTPACK_VBOXDTRACE_NAME "Oracle VBoxDTrace Extension Pack" +/** The mangled version of VBOX_EXTPACK_VBOXDTRACE_NAME (also in Config.kmk). */ +#define VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME "Oracle_VBoxDTrace_Extension_Pack" + + +/********************************************************************************************************************************* +* Structures and Typedefs * +*********************************************************************************************************************************/ +/** The main function of VBoxDTrace.so/dylib/dll. */ +typedef int (RTCALL *PFNVBOXDTRACEMAIN)(int argc, char **argv); + + +int main(int argc, char **argv) +{ + /* + * Init IPRT. + */ + int rc = RTR3InitExe(argc, &argv, 0); + if (RT_FAILURE(rc)) + return RTMsgInitFailure(rc); + + /* + * Locate a native DTrace command binary. + */ + bool fIsNativeDTrace = false; + char szDTraceCmd[RTPATH_MAX]; + szDTraceCmd[0] = '\0'; + +#if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) + /* + * 1. Try native first on platforms where it's applicable. + */ + static const char * const s_apszNativeDTrace[] = + { + "/usr/sbin/dtrace", + "/sbin/dtrace", + "/usr/bin/dtrace", + "/bin/dtrace", + "/usr/local/sbin/dtrace", + "/usr/local/bin/dtrace" + }; + if (!RTEnvExist("VBOX_DTRACE_NO_NATIVE")) + for (uint32_t i = 0; i < RT_ELEMENTS(s_apszNativeDTrace); i++) + if (RTFileExists(s_apszNativeDTrace[i])) + { + fIsNativeDTrace = true; + strcpy(szDTraceCmd, s_apszNativeDTrace[i]); +# ifdef RT_OS_LINUX + /** @todo Warn if the dtrace modules haven't been loaded or vboxdrv isn't + * compiled against them. */ +# endif + break; + } + if (szDTraceCmd[0] == '\0') +#endif + { + /* + * 2. VBoxDTrace extension pack installed? + * + * Note! We cannot use the COM API here because this program is usually + * run thru sudo or directly as root, even if the target + * VirtualBox process is running as regular user. This is due to + * the privileges required to run dtrace scripts on a host. + */ + rc = RTPathAppPrivateArch(szDTraceCmd, sizeof(szDTraceCmd)); + if (RT_SUCCESS(rc)) + rc = RTPathAppend(szDTraceCmd, sizeof(szDTraceCmd), + VBOX_EXTPACK_INSTALL_DIR RTPATH_SLASH_STR VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME); + if (RT_SUCCESS(rc)) + rc = RTPathAppend(szDTraceCmd, sizeof(szDTraceCmd), RTBldCfgTargetDotArch()); + if (RT_SUCCESS(rc)) + rc = RTPathAppend(szDTraceCmd, sizeof(szDTraceCmd), "VBoxDTraceCmd"); + if (RT_SUCCESS(rc)) + rc = RTStrCat(szDTraceCmd, sizeof(szDTraceCmd), RTLdrGetSuff()); + if (RT_FAILURE(rc)) + return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error constructing extension pack path: %Rrc", rc); + if (!RTFileExists(szDTraceCmd)) + return RTMsgErrorExit(RTEXITCODE_FAILURE, + "Unable to find a DTrace implementation. VBoxDTrace Extension Pack installed?"); + fIsNativeDTrace = false; + } + + + /* + * Construct a new command line that includes our libary. + */ + char szDTraceLibDir[RTPATH_MAX]; + rc = RTPathAppPrivateNoArch(szDTraceLibDir, sizeof(szDTraceLibDir)); + if (RT_SUCCESS(rc)) + rc = RTPathAppend(szDTraceLibDir, sizeof(szDTraceLibDir), "dtrace" RTPATH_SLASH_STR "lib"); + if (RT_SUCCESS(rc)) + rc = RTPathAppend(szDTraceLibDir, sizeof(szDTraceLibDir), RTBldCfgTargetArch()); + if (RT_FAILURE(rc)) + return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error constructing dtrace library path for VBox: %Rrc", rc); + + char **papszArgs = (char **)RTMemAlloc((argc + 3) * sizeof(char *)); + if (!papszArgs) + return RTMsgErrorExit(RTEXITCODE_FAILURE, "No memory for argument list."); + + int cArgs = 1; + papszArgs[0] = fIsNativeDTrace ? szDTraceCmd : argv[0]; + if (argc > 1) + { + papszArgs[cArgs++] = (char *)"-L"; + papszArgs[cArgs++] = szDTraceLibDir; + } + for (int i = 1; i < argc; i++) + papszArgs[cArgs++] = argv[i]; + papszArgs[cArgs] = NULL; + Assert(cArgs <= argc + 3); + + + /* + * The native DTrace we execute as a sub-process and wait for. + */ + RTEXITCODE rcExit; + if (fIsNativeDTrace) + { + RTPROCESS hProc; + rc = RTProcCreate(szDTraceCmd, papszArgs, RTENV_DEFAULT, 0, &hProc); + if (RT_SUCCESS(rc)) + { + RTPROCSTATUS Status; + rc = RTProcWait(hProc, RTPROCWAIT_FLAGS_BLOCK, &Status); + if (RT_SUCCESS(rc)) + { + if (Status.enmReason == RTPROCEXITREASON_NORMAL) + rcExit = (RTEXITCODE)Status.iStatus; + else + rcExit = RTEXITCODE_FAILURE; + } + else + rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Error waiting for child process: %Rrc", rc); + } + else + rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Error executing '%s': %Rrc", szDTraceCmd, rc); + } + /* + * While the VBoxDTrace we load and call the main function of. + */ + else + { + RTERRINFOSTATIC ErrInfo; + RTLDRMOD hMod; + rc = SUPR3HardenedLdrLoadPlugIn(szDTraceCmd, &hMod, RTErrInfoInitStatic(&ErrInfo)); + if (RT_SUCCESS(rc)) + { + PFNVBOXDTRACEMAIN pfnVBoxDTraceMain; + rc = RTLdrGetSymbol(hMod, "VBoxDTraceMain", (void **)&pfnVBoxDTraceMain); + if (RT_SUCCESS(rc)) + rcExit = (RTEXITCODE)pfnVBoxDTraceMain(cArgs, papszArgs); + else + rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Error locating 'VBoxDTraceMain' in '%s': %Rrc", szDTraceCmd, rc); + } + else + rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Error loading '%s': %Rrc (%s)", szDTraceCmd, rc, ErrInfo.szMsg); + } + return rcExit; +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/generated/dt_grammar.c b/src/VBox/ExtPacks/VBoxDTrace/generated/dt_grammar.c new file mode 100644 index 00000000..7ba1a4bb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/generated/dt_grammar.c @@ -0,0 +1,3729 @@ + +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.4.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ +#line 1 "dt_grammar.y" + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef VBOX +#pragma ident "%Z%%M% %I% %E% SMI" +#else +# ifdef _MSC_VER +# pragma warning(disable:4255 4702) +# endif +#endif + +#include + +#define OP1(op, c) dt_node_op1(op, c) +#define OP2(op, l, r) dt_node_op2(op, l, r) +#define OP3(x, y, z) dt_node_op3(x, y, z) +#define LINK(l, r) dt_node_link(l, r) +#define DUP(s) strdup(s) + +#ifdef VBOX +# define YYMALLOC RTMemAlloc +# define YYFREE RTMemFree +#endif + + + + +/* Line 189 of yacc.c */ +#line 124 "dt_grammar.c" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + DT_TOK_EOF = 0, + DT_TOK_COMMA = 258, + DT_TOK_ELLIPSIS = 259, + DT_TOK_ASGN = 260, + DT_TOK_ADD_EQ = 261, + DT_TOK_SUB_EQ = 262, + DT_TOK_MUL_EQ = 263, + DT_TOK_DIV_EQ = 264, + DT_TOK_MOD_EQ = 265, + DT_TOK_AND_EQ = 266, + DT_TOK_XOR_EQ = 267, + DT_TOK_OR_EQ = 268, + DT_TOK_LSH_EQ = 269, + DT_TOK_RSH_EQ = 270, + DT_TOK_QUESTION = 271, + DT_TOK_COLON = 272, + DT_TOK_LOR = 273, + DT_TOK_LXOR = 274, + DT_TOK_LAND = 275, + DT_TOK_BOR = 276, + DT_TOK_XOR = 277, + DT_TOK_BAND = 278, + DT_TOK_EQU = 279, + DT_TOK_NEQ = 280, + DT_TOK_LT = 281, + DT_TOK_LE = 282, + DT_TOK_GT = 283, + DT_TOK_GE = 284, + DT_TOK_LSH = 285, + DT_TOK_RSH = 286, + DT_TOK_ADD = 287, + DT_TOK_SUB = 288, + DT_TOK_MUL = 289, + DT_TOK_DIV = 290, + DT_TOK_MOD = 291, + DT_TOK_LNEG = 292, + DT_TOK_BNEG = 293, + DT_TOK_ADDADD = 294, + DT_TOK_SUBSUB = 295, + DT_TOK_PREINC = 296, + DT_TOK_POSTINC = 297, + DT_TOK_PREDEC = 298, + DT_TOK_POSTDEC = 299, + DT_TOK_IPOS = 300, + DT_TOK_INEG = 301, + DT_TOK_DEREF = 302, + DT_TOK_ADDROF = 303, + DT_TOK_OFFSETOF = 304, + DT_TOK_SIZEOF = 305, + DT_TOK_STRINGOF = 306, + DT_TOK_XLATE = 307, + DT_TOK_LPAR = 308, + DT_TOK_RPAR = 309, + DT_TOK_LBRAC = 310, + DT_TOK_RBRAC = 311, + DT_TOK_PTR = 312, + DT_TOK_DOT = 313, + DT_TOK_STRING = 314, + DT_TOK_IDENT = 315, + DT_TOK_PSPEC = 316, + DT_TOK_AGG = 317, + DT_TOK_TNAME = 318, + DT_TOK_INT = 319, + DT_KEY_AUTO = 320, + DT_KEY_BREAK = 321, + DT_KEY_CASE = 322, + DT_KEY_CHAR = 323, + DT_KEY_CONST = 324, + DT_KEY_CONTINUE = 325, + DT_KEY_COUNTER = 326, + DT_KEY_DEFAULT = 327, + DT_KEY_DO = 328, + DT_KEY_DOUBLE = 329, + DT_KEY_ELSE = 330, + DT_KEY_ENUM = 331, + DT_KEY_EXTERN = 332, + DT_KEY_FLOAT = 333, + DT_KEY_FOR = 334, + DT_KEY_GOTO = 335, + DT_KEY_IF = 336, + DT_KEY_IMPORT = 337, + DT_KEY_INLINE = 338, + DT_KEY_INT = 339, + DT_KEY_LONG = 340, + DT_KEY_PROBE = 341, + DT_KEY_PROVIDER = 342, + DT_KEY_REGISTER = 343, + DT_KEY_RESTRICT = 344, + DT_KEY_RETURN = 345, + DT_KEY_SELF = 346, + DT_KEY_SHORT = 347, + DT_KEY_SIGNED = 348, + DT_KEY_STATIC = 349, + DT_KEY_STRING = 350, + DT_KEY_STRUCT = 351, + DT_KEY_SWITCH = 352, + DT_KEY_THIS = 353, + DT_KEY_TYPEDEF = 354, + DT_KEY_UNION = 355, + DT_KEY_UNSIGNED = 356, + DT_KEY_VOID = 357, + DT_KEY_VOLATILE = 358, + DT_KEY_WHILE = 359, + DT_KEY_XLATOR = 360, + DT_TOK_EPRED = 361, + DT_CTX_DEXPR = 362, + DT_CTX_DPROG = 363, + DT_CTX_DTYPE = 364 + }; +#endif +/* Tokens. */ +#define DT_TOK_EOF 0 +#define DT_TOK_COMMA 258 +#define DT_TOK_ELLIPSIS 259 +#define DT_TOK_ASGN 260 +#define DT_TOK_ADD_EQ 261 +#define DT_TOK_SUB_EQ 262 +#define DT_TOK_MUL_EQ 263 +#define DT_TOK_DIV_EQ 264 +#define DT_TOK_MOD_EQ 265 +#define DT_TOK_AND_EQ 266 +#define DT_TOK_XOR_EQ 267 +#define DT_TOK_OR_EQ 268 +#define DT_TOK_LSH_EQ 269 +#define DT_TOK_RSH_EQ 270 +#define DT_TOK_QUESTION 271 +#define DT_TOK_COLON 272 +#define DT_TOK_LOR 273 +#define DT_TOK_LXOR 274 +#define DT_TOK_LAND 275 +#define DT_TOK_BOR 276 +#define DT_TOK_XOR 277 +#define DT_TOK_BAND 278 +#define DT_TOK_EQU 279 +#define DT_TOK_NEQ 280 +#define DT_TOK_LT 281 +#define DT_TOK_LE 282 +#define DT_TOK_GT 283 +#define DT_TOK_GE 284 +#define DT_TOK_LSH 285 +#define DT_TOK_RSH 286 +#define DT_TOK_ADD 287 +#define DT_TOK_SUB 288 +#define DT_TOK_MUL 289 +#define DT_TOK_DIV 290 +#define DT_TOK_MOD 291 +#define DT_TOK_LNEG 292 +#define DT_TOK_BNEG 293 +#define DT_TOK_ADDADD 294 +#define DT_TOK_SUBSUB 295 +#define DT_TOK_PREINC 296 +#define DT_TOK_POSTINC 297 +#define DT_TOK_PREDEC 298 +#define DT_TOK_POSTDEC 299 +#define DT_TOK_IPOS 300 +#define DT_TOK_INEG 301 +#define DT_TOK_DEREF 302 +#define DT_TOK_ADDROF 303 +#define DT_TOK_OFFSETOF 304 +#define DT_TOK_SIZEOF 305 +#define DT_TOK_STRINGOF 306 +#define DT_TOK_XLATE 307 +#define DT_TOK_LPAR 308 +#define DT_TOK_RPAR 309 +#define DT_TOK_LBRAC 310 +#define DT_TOK_RBRAC 311 +#define DT_TOK_PTR 312 +#define DT_TOK_DOT 313 +#define DT_TOK_STRING 314 +#define DT_TOK_IDENT 315 +#define DT_TOK_PSPEC 316 +#define DT_TOK_AGG 317 +#define DT_TOK_TNAME 318 +#define DT_TOK_INT 319 +#define DT_KEY_AUTO 320 +#define DT_KEY_BREAK 321 +#define DT_KEY_CASE 322 +#define DT_KEY_CHAR 323 +#define DT_KEY_CONST 324 +#define DT_KEY_CONTINUE 325 +#define DT_KEY_COUNTER 326 +#define DT_KEY_DEFAULT 327 +#define DT_KEY_DO 328 +#define DT_KEY_DOUBLE 329 +#define DT_KEY_ELSE 330 +#define DT_KEY_ENUM 331 +#define DT_KEY_EXTERN 332 +#define DT_KEY_FLOAT 333 +#define DT_KEY_FOR 334 +#define DT_KEY_GOTO 335 +#define DT_KEY_IF 336 +#define DT_KEY_IMPORT 337 +#define DT_KEY_INLINE 338 +#define DT_KEY_INT 339 +#define DT_KEY_LONG 340 +#define DT_KEY_PROBE 341 +#define DT_KEY_PROVIDER 342 +#define DT_KEY_REGISTER 343 +#define DT_KEY_RESTRICT 344 +#define DT_KEY_RETURN 345 +#define DT_KEY_SELF 346 +#define DT_KEY_SHORT 347 +#define DT_KEY_SIGNED 348 +#define DT_KEY_STATIC 349 +#define DT_KEY_STRING 350 +#define DT_KEY_STRUCT 351 +#define DT_KEY_SWITCH 352 +#define DT_KEY_THIS 353 +#define DT_KEY_TYPEDEF 354 +#define DT_KEY_UNION 355 +#define DT_KEY_UNSIGNED 356 +#define DT_KEY_VOID 357 +#define DT_KEY_VOLATILE 358 +#define DT_KEY_WHILE 359 +#define DT_KEY_XLATOR 360 +#define DT_TOK_EPRED 361 +#define DT_CTX_DEXPR 362 +#define DT_CTX_DPROG 363 +#define DT_CTX_DTYPE 364 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + +/* Line 214 of yacc.c */ +#line 51 "dt_grammar.y" + + dt_node_t *l_node; + dt_decl_t *l_decl; + char *l_str; + uintmax_t l_int; + int l_tok; + + + +/* Line 214 of yacc.c */ +#line 390 "dt_grammar.c" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +/* Copy the second part of user declarations. */ + + +/* Line 264 of yacc.c */ +#line 402 "dt_grammar.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 99 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 837 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 113 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 81 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 239 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 363 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 364 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 110, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 111, 2, 112, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 6, 9, 12, 14, 17, 19, 22, + 24, 27, 29, 32, 34, 36, 38, 40, 42, 43, + 51, 62, 72, 74, 77, 82, 89, 95, 97, 100, + 107, 112, 114, 119, 124, 132, 134, 136, 140, 142, + 144, 146, 150, 151, 153, 155, 159, 161, 163, 165, + 167, 169, 171, 175, 177, 182, 186, 191, 195, 199, + 203, 207, 210, 213, 220, 227, 235, 237, 240, 243, + 246, 249, 254, 257, 259, 261, 263, 265, 267, 269, + 271, 276, 278, 282, 286, 290, 292, 296, 300, 302, + 306, 310, 312, 316, 320, 324, 328, 330, 334, 338, + 340, 344, 346, 350, 352, 356, 358, 362, 364, 368, + 370, 374, 376, 378, 384, 386, 390, 392, 394, 396, + 398, 400, 402, 404, 406, 408, 410, 412, 414, 418, + 421, 425, 427, 430, 432, 435, 437, 440, 442, 445, + 447, 450, 452, 455, 457, 459, 461, 463, 465, 467, + 469, 471, 473, 475, 477, 479, 481, 483, 485, 487, + 489, 491, 493, 495, 497, 499, 501, 503, 507, 510, + 513, 516, 520, 524, 526, 528, 530, 533, 535, 539, + 541, 545, 547, 550, 552, 555, 557, 561, 563, 566, + 570, 574, 577, 580, 583, 587, 591, 593, 597, 599, + 603, 605, 608, 610, 614, 617, 620, 622, 624, 627, + 630, 634, 636, 639, 641, 643, 647, 649, 653, 655, + 658, 661, 663, 666, 668, 670, 673, 677, 680, 682, + 685, 687, 688, 693, 694, 696, 698, 699, 704, 705 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 114, 0, -1, 115, 0, -1, 116, 0, -1, 117, + 0, -1, 107, -1, 107, 155, -1, 108, -1, 108, + 118, -1, 109, -1, 109, 185, -1, 119, -1, 118, + 119, -1, 120, -1, 122, -1, 125, -1, 128, -1, + 156, -1, -1, 83, 157, 177, 121, 5, 153, 110, + -1, 105, 185, 26, 185, 60, 28, 111, 123, 112, + 110, -1, 105, 185, 26, 185, 60, 28, 111, 112, + 110, -1, 124, -1, 123, 124, -1, 60, 5, 153, + 110, -1, 87, 60, 111, 126, 112, 110, -1, 87, + 60, 111, 112, 110, -1, 127, -1, 126, 127, -1, + 86, 60, 191, 17, 191, 110, -1, 86, 60, 191, + 110, -1, 129, -1, 129, 111, 132, 112, -1, 129, + 35, 155, 106, -1, 129, 35, 155, 106, 111, 132, + 112, -1, 130, -1, 131, -1, 130, 3, 131, -1, + 61, -1, 64, -1, 133, -1, 132, 110, 133, -1, + -1, 155, -1, 153, -1, 134, 3, 153, -1, 60, + -1, 62, -1, 64, -1, 59, -1, 91, -1, 98, + -1, 53, 155, 54, -1, 135, -1, 136, 55, 134, + 56, -1, 136, 53, 54, -1, 136, 53, 134, 54, + -1, 136, 58, 60, -1, 136, 58, 63, -1, 136, + 57, 60, -1, 136, 57, 63, -1, 136, 39, -1, + 136, 40, -1, 49, 53, 185, 3, 60, 54, -1, + 49, 53, 185, 3, 63, 54, -1, 52, 26, 185, + 28, 53, 155, 54, -1, 136, -1, 39, 137, -1, + 40, 137, -1, 138, 139, -1, 50, 137, -1, 50, + 53, 185, 54, -1, 51, 137, -1, 23, -1, 34, + -1, 32, -1, 33, -1, 38, -1, 37, -1, 137, + -1, 53, 185, 54, 139, -1, 139, -1, 140, 34, + 139, -1, 140, 35, 139, -1, 140, 36, 139, -1, + 140, -1, 141, 32, 140, -1, 141, 33, 140, -1, + 141, -1, 142, 30, 141, -1, 142, 31, 141, -1, + 142, -1, 143, 26, 142, -1, 143, 28, 142, -1, + 143, 27, 142, -1, 143, 29, 142, -1, 143, -1, + 144, 24, 143, -1, 144, 25, 143, -1, 144, -1, + 145, 23, 144, -1, 145, -1, 146, 22, 145, -1, + 146, -1, 147, 21, 146, -1, 147, -1, 148, 20, + 147, -1, 148, -1, 149, 19, 148, -1, 149, -1, + 150, 18, 149, -1, 152, -1, 150, -1, 150, 16, + 155, 17, 152, -1, 152, -1, 137, 154, 153, -1, + 5, -1, 8, -1, 9, -1, 10, -1, 6, -1, + 7, -1, 14, -1, 15, -1, 11, -1, 12, -1, + 13, -1, 153, -1, 155, 3, 153, -1, 157, 110, + -1, 157, 167, 110, -1, 160, -1, 160, 157, -1, + 161, -1, 161, 157, -1, 162, -1, 162, 157, -1, + 159, -1, 159, 157, -1, 161, -1, 161, 157, -1, + 162, -1, 162, 157, -1, 65, -1, 88, -1, 94, + -1, 77, -1, 99, -1, 159, -1, 91, -1, 98, + -1, 102, -1, 68, -1, 92, -1, 84, -1, 85, + -1, 78, -1, 74, -1, 93, -1, 101, -1, 95, + -1, 63, -1, 163, -1, 173, -1, 69, -1, 89, + -1, 103, -1, 164, 166, 112, -1, 165, 60, -1, + 165, 63, -1, 165, 111, -1, 165, 60, 111, -1, + 165, 63, 111, -1, 96, -1, 100, -1, 169, -1, + 166, 169, -1, 168, -1, 167, 3, 168, -1, 177, + -1, 170, 171, 110, -1, 161, -1, 161, 170, -1, + 162, -1, 162, 170, -1, 172, -1, 171, 3, 172, + -1, 177, -1, 17, 151, -1, 177, 17, 151, -1, + 174, 175, 112, -1, 76, 60, -1, 76, 63, -1, + 76, 111, -1, 76, 60, 111, -1, 76, 63, 111, + -1, 176, -1, 175, 3, 176, -1, 60, -1, 60, + 5, 155, -1, 178, -1, 180, 178, -1, 60, -1, + 179, 177, 54, -1, 178, 188, -1, 178, 191, -1, + 53, -1, 34, -1, 34, 181, -1, 34, 180, -1, + 34, 181, 180, -1, 162, -1, 181, 162, -1, 183, + -1, 4, -1, 183, 3, 4, -1, 184, -1, 183, + 3, 184, -1, 158, -1, 158, 177, -1, 158, 186, + -1, 170, -1, 170, 186, -1, 180, -1, 187, -1, + 180, 187, -1, 179, 186, 54, -1, 187, 188, -1, + 188, -1, 187, 191, -1, 191, -1, -1, 55, 189, + 190, 56, -1, -1, 151, -1, 182, -1, -1, 53, + 192, 193, 54, -1, -1, 182, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 221, 221, 222, 223, 226, 227, 230, 231, 234, + 235, 239, 240, 244, 245, 246, 247, 248, 253, 252, + 268, 272, 279, 280, 284, 290, 293, 299, 300, 304, + 307, 314, 330, 333, 337, 344, 348, 349, 355, 356, + 359, 360, 363, 364, 368, 369, 375, 376, 377, 378, + 379, 380, 381, 385, 386, 390, 393, 397, 400, 403, + 406, 409, 412, 415, 419, 423, 430, 431, 432, 433, + 434, 435, 438, 443, 444, 445, 446, 447, 448, 452, + 453, 459, 460, 463, 466, 472, 473, 476, 482, 483, + 486, 492, 493, 496, 499, 502, 508, 509, 512, 518, + 519, 525, 526, 532, 533, 539, 540, 546, 547, 553, + 554, 559, 563, 564, 569, 570, 576, 577, 578, 579, + 580, 581, 582, 583, 584, 585, 586, 589, 590, 595, + 600, 608, 609, 610, 611, 612, 613, 617, 618, 619, + 620, 621, 622, 626, 627, 628, 629, 630, 634, 635, + 636, 639, 640, 641, 642, 643, 644, 645, 646, 647, + 648, 651, 652, 653, 656, 657, 658, 662, 665, 666, + 670, 671, 672, 676, 677, 681, 682, 686, 687, 693, + 700, 706, 707, 708, 709, 713, 714, 718, 719, 720, + 726, 727, 728, 732, 733, 734, 738, 739, 742, 743, + 748, 749, 753, 754, 755, 756, 759, 762, 763, 764, + 765, 769, 770, 774, 775, 776, 781, 782, 788, 791, + 794, 799, 802, 808, 809, 810, 814, 815, 816, 817, + 818, 821, 821, 829, 830, 831, 834, 834, 842, 843 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "DT_TOK_EOF", "error", "$undefined", "DT_TOK_COMMA", "DT_TOK_ELLIPSIS", + "DT_TOK_ASGN", "DT_TOK_ADD_EQ", "DT_TOK_SUB_EQ", "DT_TOK_MUL_EQ", + "DT_TOK_DIV_EQ", "DT_TOK_MOD_EQ", "DT_TOK_AND_EQ", "DT_TOK_XOR_EQ", + "DT_TOK_OR_EQ", "DT_TOK_LSH_EQ", "DT_TOK_RSH_EQ", "DT_TOK_QUESTION", + "DT_TOK_COLON", "DT_TOK_LOR", "DT_TOK_LXOR", "DT_TOK_LAND", "DT_TOK_BOR", + "DT_TOK_XOR", "DT_TOK_BAND", "DT_TOK_EQU", "DT_TOK_NEQ", "DT_TOK_LT", + "DT_TOK_LE", "DT_TOK_GT", "DT_TOK_GE", "DT_TOK_LSH", "DT_TOK_RSH", + "DT_TOK_ADD", "DT_TOK_SUB", "DT_TOK_MUL", "DT_TOK_DIV", "DT_TOK_MOD", + "DT_TOK_LNEG", "DT_TOK_BNEG", "DT_TOK_ADDADD", "DT_TOK_SUBSUB", + "DT_TOK_PREINC", "DT_TOK_POSTINC", "DT_TOK_PREDEC", "DT_TOK_POSTDEC", + "DT_TOK_IPOS", "DT_TOK_INEG", "DT_TOK_DEREF", "DT_TOK_ADDROF", + "DT_TOK_OFFSETOF", "DT_TOK_SIZEOF", "DT_TOK_STRINGOF", "DT_TOK_XLATE", + "DT_TOK_LPAR", "DT_TOK_RPAR", "DT_TOK_LBRAC", "DT_TOK_RBRAC", + "DT_TOK_PTR", "DT_TOK_DOT", "DT_TOK_STRING", "DT_TOK_IDENT", + "DT_TOK_PSPEC", "DT_TOK_AGG", "DT_TOK_TNAME", "DT_TOK_INT", + "DT_KEY_AUTO", "DT_KEY_BREAK", "DT_KEY_CASE", "DT_KEY_CHAR", + "DT_KEY_CONST", "DT_KEY_CONTINUE", "DT_KEY_COUNTER", "DT_KEY_DEFAULT", + "DT_KEY_DO", "DT_KEY_DOUBLE", "DT_KEY_ELSE", "DT_KEY_ENUM", + "DT_KEY_EXTERN", "DT_KEY_FLOAT", "DT_KEY_FOR", "DT_KEY_GOTO", + "DT_KEY_IF", "DT_KEY_IMPORT", "DT_KEY_INLINE", "DT_KEY_INT", + "DT_KEY_LONG", "DT_KEY_PROBE", "DT_KEY_PROVIDER", "DT_KEY_REGISTER", + "DT_KEY_RESTRICT", "DT_KEY_RETURN", "DT_KEY_SELF", "DT_KEY_SHORT", + "DT_KEY_SIGNED", "DT_KEY_STATIC", "DT_KEY_STRING", "DT_KEY_STRUCT", + "DT_KEY_SWITCH", "DT_KEY_THIS", "DT_KEY_TYPEDEF", "DT_KEY_UNION", + "DT_KEY_UNSIGNED", "DT_KEY_VOID", "DT_KEY_VOLATILE", "DT_KEY_WHILE", + "DT_KEY_XLATOR", "DT_TOK_EPRED", "DT_CTX_DEXPR", "DT_CTX_DPROG", + "DT_CTX_DTYPE", "';'", "'{'", "'}'", "$accept", "dtrace_program", + "d_expression", "d_program", "d_type", "translation_unit", + "external_declaration", "inline_definition", "$@1", + "translator_definition", "translator_member_list", "translator_member", + "provider_definition", "provider_probe_list", "provider_probe", + "probe_definition", "probe_specifiers", "probe_specifier_list", + "probe_specifier", "statement_list", "statement", + "argument_expression_list", "primary_expression", "postfix_expression", + "unary_expression", "unary_operator", "cast_expression", + "multiplicative_expression", "additive_expression", "shift_expression", + "relational_expression", "equality_expression", "and_expression", + "exclusive_or_expression", "inclusive_or_expression", + "logical_and_expression", "logical_xor_expression", + "logical_or_expression", "constant_expression", "conditional_expression", + "assignment_expression", "assignment_operator", "expression", + "declaration", "declaration_specifiers", + "parameter_declaration_specifiers", "storage_class_specifier", + "d_storage_class_specifier", "type_specifier", "type_qualifier", + "struct_or_union_specifier", "struct_or_union_definition", + "struct_or_union", "struct_declaration_list", "init_declarator_list", + "init_declarator", "struct_declaration", "specifier_qualifier_list", + "struct_declarator_list", "struct_declarator", "enum_specifier", + "enum_definition", "enumerator_list", "enumerator", "declarator", + "direct_declarator", "lparen", "pointer", "type_qualifier_list", + "parameter_type_list", "parameter_list", "parameter_declaration", + "type_name", "abstract_declarator", "direct_abstract_declarator", + "array", "$@2", "array_parameters", "function", "$@3", + "function_parameters", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 59, 123, 125 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 113, 114, 114, 114, 115, 115, 116, 116, 117, + 117, 118, 118, 119, 119, 119, 119, 119, 121, 120, + 122, 122, 123, 123, 124, 125, 125, 126, 126, 127, + 127, 128, 128, 128, 128, 129, 130, 130, 131, 131, + 132, 132, 133, 133, 134, 134, 135, 135, 135, 135, + 135, 135, 135, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, + 137, 137, 137, 138, 138, 138, 138, 138, 138, 139, + 139, 140, 140, 140, 140, 141, 141, 141, 142, 142, + 142, 143, 143, 143, 143, 143, 144, 144, 144, 145, + 145, 146, 146, 147, 147, 148, 148, 149, 149, 150, + 150, 151, 152, 152, 153, 153, 154, 154, 154, 154, + 154, 154, 154, 154, 154, 154, 154, 155, 155, 156, + 156, 157, 157, 157, 157, 157, 157, 158, 158, 158, + 158, 158, 158, 159, 159, 159, 159, 159, 160, 160, + 160, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 162, 162, 162, 163, 163, 163, + 164, 164, 164, 165, 165, 166, 166, 167, 167, 168, + 169, 170, 170, 170, 170, 171, 171, 172, 172, 172, + 173, 173, 173, 174, 174, 174, 175, 175, 176, 176, + 177, 177, 178, 178, 178, 178, 179, 180, 180, 180, + 180, 181, 181, 182, 182, 182, 183, 183, 184, 184, + 184, 185, 185, 186, 186, 186, 187, 187, 187, 187, + 187, 189, 188, 190, 190, 190, 192, 191, 193, 193 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 2, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 1, 1, 1, 1, 0, 7, + 10, 9, 1, 2, 4, 6, 5, 1, 2, 6, + 4, 1, 4, 4, 7, 1, 1, 3, 1, 1, + 1, 3, 0, 1, 1, 3, 1, 1, 1, 1, + 1, 1, 3, 1, 4, 3, 4, 3, 3, 3, + 3, 2, 2, 6, 6, 7, 1, 2, 2, 2, + 2, 4, 2, 1, 1, 1, 1, 1, 1, 1, + 4, 1, 3, 3, 3, 1, 3, 3, 1, 3, + 3, 1, 3, 3, 3, 3, 1, 3, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 1, 5, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, + 3, 1, 2, 1, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, + 2, 3, 3, 1, 1, 1, 2, 1, 3, 1, + 3, 1, 2, 1, 2, 1, 3, 1, 2, 3, + 3, 2, 2, 2, 3, 3, 1, 3, 1, 3, + 1, 2, 1, 3, 2, 2, 1, 1, 2, 2, + 3, 1, 2, 1, 1, 3, 1, 3, 1, 2, + 2, 1, 2, 1, 1, 2, 3, 2, 1, 2, + 1, 0, 4, 0, 1, 1, 0, 4, 0, 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 5, 7, 9, 0, 0, 0, 0, 73, 75, + 76, 74, 78, 77, 0, 0, 0, 0, 0, 0, + 0, 49, 46, 47, 48, 50, 51, 53, 66, 79, + 0, 81, 85, 88, 91, 96, 99, 101, 103, 105, + 107, 109, 112, 114, 127, 6, 38, 161, 39, 143, + 152, 164, 157, 0, 146, 156, 0, 154, 155, 0, + 144, 165, 149, 153, 158, 145, 160, 173, 150, 147, + 174, 159, 151, 166, 0, 8, 11, 13, 14, 15, + 16, 31, 35, 36, 17, 0, 148, 131, 133, 135, + 162, 0, 0, 163, 0, 181, 183, 221, 10, 1, + 2, 3, 4, 0, 67, 68, 0, 0, 70, 72, + 0, 0, 0, 61, 62, 0, 0, 0, 0, 116, + 120, 121, 117, 118, 119, 124, 125, 126, 122, 123, + 0, 79, 69, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 191, 192, 193, 0, 0, 0, + 12, 0, 42, 0, 207, 206, 202, 129, 0, 177, + 179, 200, 0, 0, 132, 134, 136, 0, 175, 0, + 168, 169, 170, 198, 0, 196, 182, 184, 236, 231, + 0, 223, 222, 224, 228, 230, 0, 0, 0, 52, + 0, 55, 0, 44, 0, 59, 60, 57, 58, 115, + 82, 83, 84, 86, 87, 89, 90, 92, 94, 93, + 95, 97, 98, 100, 102, 104, 106, 108, 0, 110, + 128, 194, 195, 18, 0, 0, 0, 0, 40, 43, + 37, 211, 209, 208, 0, 130, 236, 204, 205, 0, + 201, 167, 176, 0, 0, 185, 187, 171, 172, 0, + 0, 190, 238, 233, 0, 225, 227, 229, 0, 71, + 0, 80, 0, 56, 54, 0, 0, 0, 0, 0, + 27, 0, 33, 42, 32, 212, 210, 178, 203, 188, + 111, 0, 180, 0, 199, 197, 214, 218, 137, 139, + 141, 239, 213, 216, 0, 234, 235, 0, 226, 0, + 0, 0, 45, 113, 0, 0, 26, 0, 28, 0, + 42, 41, 186, 189, 219, 0, 223, 220, 138, 140, + 142, 0, 237, 232, 63, 64, 0, 0, 0, 25, + 0, 0, 215, 217, 65, 19, 0, 30, 0, 34, + 0, 0, 0, 0, 22, 29, 0, 21, 0, 23, + 0, 20, 24 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 4, 5, 6, 7, 75, 76, 77, 276, 78, + 353, 354, 79, 279, 280, 80, 81, 82, 83, 237, + 238, 202, 27, 28, 131, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 289, 43, + 44, 130, 111, 84, 85, 297, 86, 87, 95, 96, + 90, 91, 92, 177, 168, 169, 178, 97, 254, 255, + 93, 94, 184, 185, 170, 171, 172, 173, 243, 301, + 302, 303, 98, 264, 193, 194, 263, 307, 195, 262, + 304 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -224 +static const yytype_int16 yypact[] = +{ + 148, 553, 641, 723, 26, 49, 57, 76, -224, -224, + -224, -224, -224, -224, 596, 596, 88, 629, 596, 72, + 446, -224, -224, -224, -224, -224, -224, -224, 179, 822, + 553, -224, 152, 37, 118, 109, 56, 132, 137, 154, + 149, 162, 175, -224, -224, 205, -224, -224, -224, -224, + -224, -224, -224, 11, -224, -224, 682, -224, -224, 155, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, 723, 641, -224, -224, -224, -224, + -224, 10, 217, -224, -224, 7, -224, 682, 682, 682, + -224, 723, 22, -224, 167, 723, 723, 139, -224, -224, + -224, -224, -224, 553, -224, -224, 723, 446, -224, -224, + 723, 58, 177, -224, -224, 520, 553, -5, 80, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + 553, -224, -224, 553, 553, 553, 553, 553, 553, 553, + 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, + 553, 553, 553, 553, 127, 131, -224, 110, 133, 209, + -224, 553, 553, 81, 4, -224, -224, -224, 17, -224, + -224, 145, 110, 50, -224, -224, -224, 121, -224, 94, + 159, 161, -224, 243, 18, -224, -224, -224, 119, -224, + 139, 156, -224, 145, -224, -224, 247, 213, 231, -224, + 553, -224, 62, -224, 48, -224, -224, -224, -224, -224, + -224, -224, -224, 152, 152, 37, 37, 118, 118, 118, + 118, 109, 109, 56, 132, 137, 154, 149, 45, 162, + -224, -224, -224, -224, -49, 723, 19, 116, -224, 205, + -224, -224, -224, 4, 110, -224, -224, -224, -224, 219, + 145, -224, -224, 553, 21, -224, 257, -224, -224, 553, + 167, -224, 331, 289, 221, 145, -224, -224, 117, -224, + 223, -224, 553, -224, -224, 553, 272, 218, 169, -44, + -224, 220, 170, 553, -224, -224, -224, -224, -224, -224, + -224, 94, -224, 553, -224, -224, -224, 123, 682, 682, + 682, -224, 280, -224, 230, -224, -224, 229, -224, 232, + 233, 553, -224, -224, 553, 236, -224, 180, -224, 263, + 553, -224, -224, -224, -224, 123, 79, -224, -224, -224, + -224, 372, -224, -224, -224, -224, 69, 182, 16, -224, + 183, 129, -224, -224, -224, -224, 236, -224, -35, -224, + 185, 291, 187, -13, -224, -224, 553, -224, 194, -224, + 195, -224, -224 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -224, -224, -224, -224, -224, -224, 234, -224, -224, -224, + -224, -47, -224, -224, 28, -224, -224, -224, 151, -12, + 32, 201, -224, -224, -1, -224, -15, 66, 122, 111, + 124, 165, 171, 172, 181, 174, 184, -224, -210, -209, + -107, -224, 5, -224, -53, -224, -223, -224, 3, 0, + -224, -224, -224, -224, -224, 89, 160, -64, -224, 41, + -224, -224, -224, 83, -129, -155, -96, -85, -224, 82, + -224, 13, -10, -93, -180, -141, -224, -224, -164, -224, + -224 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -207 +static const yytype_int16 yytable[] = +{ + 29, 190, 89, 157, 192, 88, 45, 248, 203, 203, + 112, 265, 191, 104, 105, 132, 108, 109, 250, 29, + 244, 260, 153, 209, 291, 351, 99, 179, 233, 267, + 247, 186, 187, 346, 174, 175, 176, 277, 164, 298, + 298, 164, 277, 249, 290, 161, 230, 351, 153, 100, + 256, 272, 266, 305, 290, 205, 89, 101, 206, 88, + 165, 153, 275, 278, 159, 272, 313, 166, 317, 136, + 137, 154, 153, 51, 155, 89, 102, 352, 88, 242, + 144, 145, 180, 323, 290, 181, 248, 89, 89, 89, + 88, 88, 88, 61, 190, 190, 196, 197, 110, 358, + 198, 267, 29, 165, 274, 191, 29, 73, 298, 247, + 166, 253, 199, 179, 29, 29, 273, 167, 210, 211, + 212, 162, 156, 344, 266, 282, 347, 245, 164, 29, + 261, 292, 188, 182, 189, 140, 141, 142, 143, 166, + 207, 106, 46, 208, 164, 48, 265, 165, 138, 139, + 29, 338, 29, -206, 166, 146, 228, 164, 286, 147, + 29, 29, 256, 165, 241, 312, 236, 239, 324, 149, + 166, 250, -206, 164, -206, 148, 188, 309, 189, -206, + 310, 150, 350, 166, 47, 271, 133, 134, 135, 50, + 51, 151, 188, 152, 189, 52, 249, 53, 246, 55, + 189, 325, 213, 214, 327, 57, 58, 337, 153, 188, + 61, 189, 326, 63, 64, 158, 66, 67, 113, 114, + 163, 70, 71, 72, 73, 281, 283, 183, 284, 325, + 325, 200, 115, 251, 116, 235, 117, 118, 231, 283, + 326, 349, 232, 285, 234, 328, 329, 330, 259, 360, + 268, 217, 218, 219, 220, 1, 2, 3, 29, 270, + 215, 216, 300, 300, 294, 299, 299, 269, 221, 222, + 257, 29, 258, 288, 293, 308, 311, 314, 315, 316, + 319, 320, 29, 331, 332, 333, 334, 335, 239, 246, + 339, 340, 345, 296, 348, 355, 356, 357, 89, 89, + 89, 88, 88, 88, 361, 362, 359, 318, 341, 160, + 29, 223, 8, 29, 240, 321, 336, 204, 224, 29, + 225, 9, 10, 11, 227, 239, 12, 13, 14, 15, + 226, 300, 322, 287, 299, 296, 229, 252, 16, 17, + 18, 19, 20, 295, 343, 306, 0, 0, 21, 22, + 0, 23, 47, 24, 49, 29, 0, 50, 51, 0, + 0, 0, 0, 52, 0, 53, 54, 55, 0, 0, + 0, 0, 0, 57, 58, 0, 342, 60, 61, 0, + 25, 63, 64, 65, 66, 67, 0, 26, 69, 70, + 71, 72, 73, 0, 47, 0, 49, 0, 0, 50, + 51, 0, 0, 0, 0, 52, 0, 53, 54, 55, + 0, 0, 0, 0, 0, 57, 58, 0, 0, 60, + 61, 0, 0, 63, 64, 65, 66, 67, 0, 0, + 69, 70, 71, 72, 73, 47, 0, 49, 0, 0, + 50, 51, 0, 0, 0, 0, 52, 0, 53, 54, + 55, 0, 0, 0, 0, 0, 57, 58, 0, 0, + 60, 61, 0, 0, 63, 64, 65, 66, 67, 8, + 0, 69, 70, 71, 72, 73, 0, 0, 9, 10, + 11, 0, 0, 12, 13, 14, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 16, 17, 18, 19, 20, + 0, 0, 0, 0, 0, 21, 22, 0, 23, 47, + 24, 0, 0, 0, 50, 51, 0, 0, 0, 0, + 52, 0, 53, 0, 55, 0, 0, 0, 0, 0, + 57, 58, 0, 0, 0, 61, 0, 25, 63, 64, + 0, 66, 67, 8, 26, 0, 70, 71, 72, 73, + 0, 0, 9, 10, 11, 0, 0, 12, 13, 14, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 16, + 17, 18, 19, 20, 201, 0, 8, 0, 0, 21, + 22, 0, 23, 0, 24, 9, 10, 11, 0, 0, + 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, + 0, 0, 16, 17, 18, 19, 20, 0, 0, 0, + 0, 25, 21, 22, 0, 23, 0, 24, 26, 8, + 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, + 11, 0, 0, 12, 13, 14, 15, 0, 0, 0, + 0, 0, 0, 0, 25, 16, 17, 18, 19, 103, + 0, 26, 8, 0, 0, 21, 22, 0, 23, 0, + 24, 9, 10, 11, 0, 0, 12, 13, 14, 15, + 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, + 18, 19, 107, 0, 0, 0, 0, 25, 21, 22, + 0, 23, 0, 24, 26, 0, 0, 0, 0, 0, + 0, 0, 46, 0, 47, 48, 49, 0, 0, 50, + 51, 0, 0, 0, 0, 52, 0, 53, 54, 55, + 25, 0, 0, 0, 56, 57, 58, 26, 59, 60, + 61, 0, 62, 63, 64, 65, 66, 67, 0, 68, + 69, 70, 71, 72, 73, 47, 74, 49, 0, 0, + 50, 51, 0, 0, 0, 0, 52, 0, 53, 54, + 55, 0, 0, 0, 0, 0, 57, 58, 0, 0, + 60, 61, 0, 62, 63, 64, 65, 66, 67, 0, + 68, 69, 70, 71, 72, 73, 47, 0, 0, 0, + 0, 50, 51, 0, 0, 0, 0, 52, 0, 53, + 0, 55, 0, 0, 0, 0, 0, 57, 58, 0, + 0, 0, 61, 0, 0, 63, 64, 0, 66, 67, + 0, 0, 0, 70, 71, 72, 73, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129 +}; + +static const yytype_int16 yycheck[] = +{ + 1, 97, 2, 56, 97, 2, 1, 171, 115, 116, + 20, 191, 97, 14, 15, 30, 17, 18, 173, 20, + 3, 3, 3, 130, 3, 60, 0, 91, 157, 193, + 171, 95, 96, 17, 87, 88, 89, 86, 34, 262, + 263, 34, 86, 172, 253, 35, 153, 60, 3, 0, + 179, 3, 193, 263, 263, 60, 56, 0, 63, 56, + 53, 3, 17, 112, 74, 3, 275, 60, 112, 32, + 33, 60, 3, 69, 63, 75, 0, 112, 75, 164, + 24, 25, 60, 293, 293, 63, 250, 87, 88, 89, + 87, 88, 89, 89, 190, 191, 106, 107, 26, 112, + 110, 265, 103, 53, 56, 190, 107, 103, 331, 250, + 60, 17, 54, 177, 115, 116, 54, 110, 133, 134, + 135, 111, 111, 54, 265, 106, 110, 110, 34, 130, + 112, 110, 53, 111, 55, 26, 27, 28, 29, 60, + 60, 53, 61, 63, 34, 64, 326, 53, 30, 31, + 151, 315, 153, 34, 60, 23, 151, 34, 243, 22, + 161, 162, 291, 53, 164, 272, 161, 162, 297, 20, + 60, 326, 53, 34, 55, 21, 53, 60, 55, 60, + 63, 19, 346, 60, 63, 200, 34, 35, 36, 68, + 69, 16, 53, 18, 55, 74, 325, 76, 53, 78, + 55, 297, 136, 137, 297, 84, 85, 314, 3, 53, + 89, 55, 297, 92, 93, 60, 95, 96, 39, 40, + 3, 100, 101, 102, 103, 235, 110, 60, 112, 325, + 326, 54, 53, 112, 55, 26, 57, 58, 111, 110, + 325, 112, 111, 243, 111, 298, 299, 300, 5, 356, + 3, 140, 141, 142, 143, 107, 108, 109, 259, 28, + 138, 139, 262, 263, 259, 262, 263, 54, 144, 145, + 111, 272, 111, 54, 17, 54, 53, 5, 60, 110, + 60, 111, 283, 3, 54, 56, 54, 54, 283, 53, + 110, 28, 110, 4, 111, 110, 5, 110, 298, 299, + 300, 298, 299, 300, 110, 110, 353, 279, 320, 75, + 311, 146, 23, 314, 163, 283, 311, 116, 147, 320, + 148, 32, 33, 34, 150, 320, 37, 38, 39, 40, + 149, 331, 291, 244, 331, 4, 152, 177, 49, 50, + 51, 52, 53, 260, 331, 263, -1, -1, 59, 60, + -1, 62, 63, 64, 65, 356, -1, 68, 69, -1, + -1, -1, -1, 74, -1, 76, 77, 78, -1, -1, + -1, -1, -1, 84, 85, -1, 4, 88, 89, -1, + 91, 92, 93, 94, 95, 96, -1, 98, 99, 100, + 101, 102, 103, -1, 63, -1, 65, -1, -1, 68, + 69, -1, -1, -1, -1, 74, -1, 76, 77, 78, + -1, -1, -1, -1, -1, 84, 85, -1, -1, 88, + 89, -1, -1, 92, 93, 94, 95, 96, -1, -1, + 99, 100, 101, 102, 103, 63, -1, 65, -1, -1, + 68, 69, -1, -1, -1, -1, 74, -1, 76, 77, + 78, -1, -1, -1, -1, -1, 84, 85, -1, -1, + 88, 89, -1, -1, 92, 93, 94, 95, 96, 23, + -1, 99, 100, 101, 102, 103, -1, -1, 32, 33, + 34, -1, -1, 37, 38, 39, 40, -1, -1, -1, + -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, + -1, -1, -1, -1, -1, 59, 60, -1, 62, 63, + 64, -1, -1, -1, 68, 69, -1, -1, -1, -1, + 74, -1, 76, -1, 78, -1, -1, -1, -1, -1, + 84, 85, -1, -1, -1, 89, -1, 91, 92, 93, + -1, 95, 96, 23, 98, -1, 100, 101, 102, 103, + -1, -1, 32, 33, 34, -1, -1, 37, 38, 39, + 40, -1, -1, -1, -1, -1, -1, -1, -1, 49, + 50, 51, 52, 53, 54, -1, 23, -1, -1, 59, + 60, -1, 62, -1, 64, 32, 33, 34, -1, -1, + 37, 38, 39, 40, -1, -1, -1, -1, -1, -1, + -1, -1, 49, 50, 51, 52, 53, -1, -1, -1, + -1, 91, 59, 60, -1, 62, -1, 64, 98, 23, + -1, -1, -1, -1, -1, -1, -1, -1, 32, 33, + 34, -1, -1, 37, 38, 39, 40, -1, -1, -1, + -1, -1, -1, -1, 91, 49, 50, 51, 52, 53, + -1, 98, 23, -1, -1, 59, 60, -1, 62, -1, + 64, 32, 33, 34, -1, -1, 37, 38, 39, 40, + -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, + 51, 52, 53, -1, -1, -1, -1, 91, 59, 60, + -1, 62, -1, 64, 98, -1, -1, -1, -1, -1, + -1, -1, 61, -1, 63, 64, 65, -1, -1, 68, + 69, -1, -1, -1, -1, 74, -1, 76, 77, 78, + 91, -1, -1, -1, 83, 84, 85, 98, 87, 88, + 89, -1, 91, 92, 93, 94, 95, 96, -1, 98, + 99, 100, 101, 102, 103, 63, 105, 65, -1, -1, + 68, 69, -1, -1, -1, -1, 74, -1, 76, 77, + 78, -1, -1, -1, -1, -1, 84, 85, -1, -1, + 88, 89, -1, 91, 92, 93, 94, 95, 96, -1, + 98, 99, 100, 101, 102, 103, 63, -1, -1, -1, + -1, 68, 69, -1, -1, -1, -1, 74, -1, 76, + -1, 78, -1, -1, -1, -1, -1, 84, 85, -1, + -1, -1, 89, -1, -1, 92, 93, -1, 95, 96, + -1, -1, -1, 100, 101, 102, 103, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 107, 108, 109, 114, 115, 116, 117, 23, 32, + 33, 34, 37, 38, 39, 40, 49, 50, 51, 52, + 53, 59, 60, 62, 64, 91, 98, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 152, 153, 155, 61, 63, 64, 65, + 68, 69, 74, 76, 77, 78, 83, 84, 85, 87, + 88, 89, 91, 92, 93, 94, 95, 96, 98, 99, + 100, 101, 102, 103, 105, 118, 119, 120, 122, 125, + 128, 129, 130, 131, 156, 157, 159, 160, 161, 162, + 163, 164, 165, 173, 174, 161, 162, 170, 185, 0, + 0, 0, 0, 53, 137, 137, 53, 53, 137, 137, + 26, 155, 185, 39, 40, 53, 55, 57, 58, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 154, 137, 139, 34, 35, 36, 32, 33, 30, 31, + 26, 27, 28, 29, 24, 25, 23, 22, 21, 20, + 19, 16, 18, 3, 60, 63, 111, 157, 60, 185, + 119, 35, 111, 3, 34, 53, 60, 110, 167, 168, + 177, 178, 179, 180, 157, 157, 157, 166, 169, 170, + 60, 63, 111, 60, 175, 176, 170, 170, 53, 55, + 179, 180, 186, 187, 188, 191, 185, 185, 185, 54, + 54, 54, 134, 153, 134, 60, 63, 60, 63, 153, + 139, 139, 139, 140, 140, 141, 141, 142, 142, 142, + 142, 143, 143, 144, 145, 146, 147, 148, 155, 149, + 153, 111, 111, 177, 111, 26, 155, 132, 133, 155, + 131, 162, 180, 181, 3, 110, 53, 188, 191, 177, + 178, 112, 169, 17, 171, 172, 177, 111, 111, 5, + 3, 112, 192, 189, 186, 187, 188, 191, 3, 54, + 28, 139, 3, 54, 56, 17, 121, 86, 112, 126, + 127, 185, 106, 110, 112, 162, 180, 168, 54, 151, + 152, 3, 110, 17, 155, 176, 4, 158, 159, 161, + 162, 182, 183, 184, 193, 151, 182, 190, 54, 60, + 63, 53, 153, 152, 5, 60, 110, 112, 127, 60, + 111, 133, 172, 151, 177, 179, 180, 186, 157, 157, + 157, 3, 54, 56, 54, 54, 155, 153, 191, 110, + 28, 132, 4, 184, 54, 110, 17, 110, 111, 112, + 191, 60, 112, 123, 124, 110, 5, 110, 112, 124, + 153, 110, 110 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: + +/* Line 1455 of yacc.c */ +#line 221 "dt_grammar.y" + { return (dt_node_root((yyvsp[(1) - (2)].l_node))); } + break; + + case 3: + +/* Line 1455 of yacc.c */ +#line 222 "dt_grammar.y" + { return (dt_node_root((yyvsp[(1) - (2)].l_node))); } + break; + + case 4: + +/* Line 1455 of yacc.c */ +#line 223 "dt_grammar.y" + { return (dt_node_root((yyvsp[(1) - (2)].l_node))); } + break; + + case 5: + +/* Line 1455 of yacc.c */ +#line 226 "dt_grammar.y" + { (yyval.l_node) = NULL; } + break; + + case 6: + +/* Line 1455 of yacc.c */ +#line 227 "dt_grammar.y" + { (yyval.l_node) = (yyvsp[(2) - (2)].l_node); } + break; + + case 7: + +/* Line 1455 of yacc.c */ +#line 230 "dt_grammar.y" + { (yyval.l_node) = dt_node_program(NULL); } + break; + + case 8: + +/* Line 1455 of yacc.c */ +#line 231 "dt_grammar.y" + { (yyval.l_node) = dt_node_program((yyvsp[(2) - (2)].l_node)); } + break; + + case 9: + +/* Line 1455 of yacc.c */ +#line 234 "dt_grammar.y" + { (yyval.l_node) = NULL; } + break; + + case 10: + +/* Line 1455 of yacc.c */ +#line 235 "dt_grammar.y" + { (yyval.l_node) = (dt_node_t *)(yyvsp[(2) - (2)].l_decl); } + break; + + case 12: + +/* Line 1455 of yacc.c */ +#line 240 "dt_grammar.y" + { (yyval.l_node) = LINK((yyvsp[(1) - (2)].l_node), (yyvsp[(2) - (2)].l_node)); } + break; + + case 18: + +/* Line 1455 of yacc.c */ +#line 253 "dt_grammar.y" + { dt_scope_push(NULL, CTF_ERR); } + break; + + case 19: + +/* Line 1455 of yacc.c */ +#line 254 "dt_grammar.y" + { + /* + * We push a new declaration scope before shifting the + * assignment_expression in order to preserve ds_class + * and ds_ident for use in dt_node_inline(). Once the + * entire inline_definition rule is matched, pop the + * scope and construct the inline using the saved decl. + */ + dt_scope_pop(); + (yyval.l_node) = dt_node_inline((yyvsp[(6) - (7)].l_node)); + } + break; + + case 20: + +/* Line 1455 of yacc.c */ +#line 269 "dt_grammar.y" + { + (yyval.l_node) = dt_node_xlator((yyvsp[(2) - (10)].l_decl), (yyvsp[(4) - (10)].l_decl), (yyvsp[(5) - (10)].l_str), (yyvsp[(8) - (10)].l_node)); + } + break; + + case 21: + +/* Line 1455 of yacc.c */ +#line 273 "dt_grammar.y" + { + (yyval.l_node) = dt_node_xlator((yyvsp[(2) - (9)].l_decl), (yyvsp[(4) - (9)].l_decl), (yyvsp[(5) - (9)].l_str), NULL); + } + break; + + case 23: + +/* Line 1455 of yacc.c */ +#line 280 "dt_grammar.y" + { (yyval.l_node) = LINK((yyvsp[(1) - (2)].l_node),(yyvsp[(2) - (2)].l_node)); } + break; + + case 24: + +/* Line 1455 of yacc.c */ +#line 284 "dt_grammar.y" + { + (yyval.l_node) = dt_node_member(NULL, (yyvsp[(1) - (4)].l_str), (yyvsp[(3) - (4)].l_node)); + } + break; + + case 25: + +/* Line 1455 of yacc.c */ +#line 290 "dt_grammar.y" + { + (yyval.l_node) = dt_node_provider((yyvsp[(2) - (6)].l_str), (yyvsp[(4) - (6)].l_node)); + } + break; + + case 26: + +/* Line 1455 of yacc.c */ +#line 293 "dt_grammar.y" + { + (yyval.l_node) = dt_node_provider((yyvsp[(2) - (5)].l_str), NULL); + } + break; + + case 28: + +/* Line 1455 of yacc.c */ +#line 300 "dt_grammar.y" + { (yyval.l_node) = LINK((yyvsp[(1) - (2)].l_node), (yyvsp[(2) - (2)].l_node)); } + break; + + case 29: + +/* Line 1455 of yacc.c */ +#line 304 "dt_grammar.y" + { + (yyval.l_node) = dt_node_probe((yyvsp[(2) - (6)].l_str), 2, (yyvsp[(3) - (6)].l_node), (yyvsp[(5) - (6)].l_node)); + } + break; + + case 30: + +/* Line 1455 of yacc.c */ +#line 307 "dt_grammar.y" + { + (yyval.l_node) = dt_node_probe((yyvsp[(2) - (4)].l_str), 1, (yyvsp[(3) - (4)].l_node), NULL); + } + break; + + case 31: + +/* Line 1455 of yacc.c */ +#line 314 "dt_grammar.y" + { + /* + * If the input stream is a file, do not permit a probe + * specification without / / or { } after + * it. This can only occur if the next token is EOF or + * an ambiguous predicate was slurped up as a comment. + * We cannot perform this check if input() is a string + * because dtrace(1M) [-fmnP] also use the compiler and + * things like dtrace -n BEGIN have to be accepted. + */ + if (yypcb->pcb_fileptr != NULL) { + dnerror((yyvsp[(1) - (1)].l_node), D_SYNTAX, "expected predicate and/" + "or actions following probe description\n"); + } + (yyval.l_node) = dt_node_clause((yyvsp[(1) - (1)].l_node), NULL, NULL); + } + break; + + case 32: + +/* Line 1455 of yacc.c */ +#line 330 "dt_grammar.y" + { + (yyval.l_node) = dt_node_clause((yyvsp[(1) - (4)].l_node), NULL, (yyvsp[(3) - (4)].l_node)); + } + break; + + case 33: + +/* Line 1455 of yacc.c */ +#line 333 "dt_grammar.y" + { + dnerror((yyvsp[(3) - (4)].l_node), D_SYNTAX, "expected actions { } following " + "probe description and predicate\n"); + } + break; + + case 34: + +/* Line 1455 of yacc.c */ +#line 338 "dt_grammar.y" + { + (yyval.l_node) = dt_node_clause((yyvsp[(1) - (7)].l_node), (yyvsp[(3) - (7)].l_node), (yyvsp[(6) - (7)].l_node)); + } + break; + + case 35: + +/* Line 1455 of yacc.c */ +#line 344 "dt_grammar.y" + { yybegin(YYS_EXPR); (yyval.l_node) = (yyvsp[(1) - (1)].l_node); } + break; + + case 37: + +/* Line 1455 of yacc.c */ +#line 349 "dt_grammar.y" + { + (yyval.l_node) = LINK((yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 38: + +/* Line 1455 of yacc.c */ +#line 355 "dt_grammar.y" + { (yyval.l_node) = dt_node_pdesc_by_name((yyvsp[(1) - (1)].l_str)); } + break; + + case 39: + +/* Line 1455 of yacc.c */ +#line 356 "dt_grammar.y" + { (yyval.l_node) = dt_node_pdesc_by_id((yyvsp[(1) - (1)].l_int)); } + break; + + case 40: + +/* Line 1455 of yacc.c */ +#line 359 "dt_grammar.y" + { (yyval.l_node) = (yyvsp[(1) - (1)].l_node); } + break; + + case 41: + +/* Line 1455 of yacc.c */ +#line 360 "dt_grammar.y" + { (yyval.l_node) = LINK((yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); } + break; + + case 42: + +/* Line 1455 of yacc.c */ +#line 363 "dt_grammar.y" + { (yyval.l_node) = NULL; } + break; + + case 43: + +/* Line 1455 of yacc.c */ +#line 364 "dt_grammar.y" + { (yyval.l_node) = dt_node_statement((yyvsp[(1) - (1)].l_node)); } + break; + + case 45: + +/* Line 1455 of yacc.c */ +#line 369 "dt_grammar.y" + { + (yyval.l_node) = LINK((yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 46: + +/* Line 1455 of yacc.c */ +#line 375 "dt_grammar.y" + { (yyval.l_node) = dt_node_ident((yyvsp[(1) - (1)].l_str)); } + break; + + case 47: + +/* Line 1455 of yacc.c */ +#line 376 "dt_grammar.y" + { (yyval.l_node) = dt_node_ident((yyvsp[(1) - (1)].l_str)); } + break; + + case 48: + +/* Line 1455 of yacc.c */ +#line 377 "dt_grammar.y" + { (yyval.l_node) = dt_node_int((yyvsp[(1) - (1)].l_int)); } + break; + + case 49: + +/* Line 1455 of yacc.c */ +#line 378 "dt_grammar.y" + { (yyval.l_node) = dt_node_string((yyvsp[(1) - (1)].l_str)); } + break; + + case 50: + +/* Line 1455 of yacc.c */ +#line 379 "dt_grammar.y" + { (yyval.l_node) = dt_node_ident(DUP("self")); } + break; + + case 51: + +/* Line 1455 of yacc.c */ +#line 380 "dt_grammar.y" + { (yyval.l_node) = dt_node_ident(DUP("this")); } + break; + + case 52: + +/* Line 1455 of yacc.c */ +#line 381 "dt_grammar.y" + { (yyval.l_node) = (yyvsp[(2) - (3)].l_node); } + break; + + case 54: + +/* Line 1455 of yacc.c */ +#line 387 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_LBRAC, (yyvsp[(1) - (4)].l_node), (yyvsp[(3) - (4)].l_node)); + } + break; + + case 55: + +/* Line 1455 of yacc.c */ +#line 390 "dt_grammar.y" + { + (yyval.l_node) = dt_node_func((yyvsp[(1) - (3)].l_node), NULL); + } + break; + + case 56: + +/* Line 1455 of yacc.c */ +#line 394 "dt_grammar.y" + { + (yyval.l_node) = dt_node_func((yyvsp[(1) - (4)].l_node), (yyvsp[(3) - (4)].l_node)); + } + break; + + case 57: + +/* Line 1455 of yacc.c */ +#line 397 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_DOT, (yyvsp[(1) - (3)].l_node), dt_node_ident((yyvsp[(3) - (3)].l_str))); + } + break; + + case 58: + +/* Line 1455 of yacc.c */ +#line 400 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_DOT, (yyvsp[(1) - (3)].l_node), dt_node_ident((yyvsp[(3) - (3)].l_str))); + } + break; + + case 59: + +/* Line 1455 of yacc.c */ +#line 403 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_PTR, (yyvsp[(1) - (3)].l_node), dt_node_ident((yyvsp[(3) - (3)].l_str))); + } + break; + + case 60: + +/* Line 1455 of yacc.c */ +#line 406 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_PTR, (yyvsp[(1) - (3)].l_node), dt_node_ident((yyvsp[(3) - (3)].l_str))); + } + break; + + case 61: + +/* Line 1455 of yacc.c */ +#line 409 "dt_grammar.y" + { + (yyval.l_node) = OP1(DT_TOK_POSTINC, (yyvsp[(1) - (2)].l_node)); + } + break; + + case 62: + +/* Line 1455 of yacc.c */ +#line 412 "dt_grammar.y" + { + (yyval.l_node) = OP1(DT_TOK_POSTDEC, (yyvsp[(1) - (2)].l_node)); + } + break; + + case 63: + +/* Line 1455 of yacc.c */ +#line 416 "dt_grammar.y" + { + (yyval.l_node) = dt_node_offsetof((yyvsp[(3) - (6)].l_decl), (yyvsp[(5) - (6)].l_str)); + } + break; + + case 64: + +/* Line 1455 of yacc.c */ +#line 420 "dt_grammar.y" + { + (yyval.l_node) = dt_node_offsetof((yyvsp[(3) - (6)].l_decl), (yyvsp[(5) - (6)].l_str)); + } + break; + + case 65: + +/* Line 1455 of yacc.c */ +#line 424 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_XLATE, dt_node_type((yyvsp[(3) - (7)].l_decl)), (yyvsp[(6) - (7)].l_node)); + } + break; + + case 67: + +/* Line 1455 of yacc.c */ +#line 431 "dt_grammar.y" + { (yyval.l_node) = OP1(DT_TOK_PREINC, (yyvsp[(2) - (2)].l_node)); } + break; + + case 68: + +/* Line 1455 of yacc.c */ +#line 432 "dt_grammar.y" + { (yyval.l_node) = OP1(DT_TOK_PREDEC, (yyvsp[(2) - (2)].l_node)); } + break; + + case 69: + +/* Line 1455 of yacc.c */ +#line 433 "dt_grammar.y" + { (yyval.l_node) = OP1((yyvsp[(1) - (2)].l_tok), (yyvsp[(2) - (2)].l_node)); } + break; + + case 70: + +/* Line 1455 of yacc.c */ +#line 434 "dt_grammar.y" + { (yyval.l_node) = OP1(DT_TOK_SIZEOF, (yyvsp[(2) - (2)].l_node)); } + break; + + case 71: + +/* Line 1455 of yacc.c */ +#line 435 "dt_grammar.y" + { + (yyval.l_node) = OP1(DT_TOK_SIZEOF, dt_node_type((yyvsp[(3) - (4)].l_decl))); + } + break; + + case 72: + +/* Line 1455 of yacc.c */ +#line 438 "dt_grammar.y" + { + (yyval.l_node) = OP1(DT_TOK_STRINGOF, (yyvsp[(2) - (2)].l_node)); + } + break; + + case 73: + +/* Line 1455 of yacc.c */ +#line 443 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_ADDROF; } + break; + + case 74: + +/* Line 1455 of yacc.c */ +#line 444 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_DEREF; } + break; + + case 75: + +/* Line 1455 of yacc.c */ +#line 445 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_IPOS; } + break; + + case 76: + +/* Line 1455 of yacc.c */ +#line 446 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_INEG; } + break; + + case 77: + +/* Line 1455 of yacc.c */ +#line 447 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_BNEG; } + break; + + case 78: + +/* Line 1455 of yacc.c */ +#line 448 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_LNEG; } + break; + + case 80: + +/* Line 1455 of yacc.c */ +#line 453 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_LPAR, dt_node_type((yyvsp[(2) - (4)].l_decl)), (yyvsp[(4) - (4)].l_node)); + } + break; + + case 82: + +/* Line 1455 of yacc.c */ +#line 460 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_MUL, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 83: + +/* Line 1455 of yacc.c */ +#line 463 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_DIV, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 84: + +/* Line 1455 of yacc.c */ +#line 466 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_MOD, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 86: + +/* Line 1455 of yacc.c */ +#line 473 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_ADD, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 87: + +/* Line 1455 of yacc.c */ +#line 476 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_SUB, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 89: + +/* Line 1455 of yacc.c */ +#line 483 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_LSH, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 90: + +/* Line 1455 of yacc.c */ +#line 486 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_RSH, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 92: + +/* Line 1455 of yacc.c */ +#line 493 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_LT, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 93: + +/* Line 1455 of yacc.c */ +#line 496 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_GT, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 94: + +/* Line 1455 of yacc.c */ +#line 499 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_LE, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 95: + +/* Line 1455 of yacc.c */ +#line 502 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_GE, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 97: + +/* Line 1455 of yacc.c */ +#line 509 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_EQU, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 98: + +/* Line 1455 of yacc.c */ +#line 512 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_NEQ, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 100: + +/* Line 1455 of yacc.c */ +#line 519 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_BAND, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 102: + +/* Line 1455 of yacc.c */ +#line 526 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_XOR, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 104: + +/* Line 1455 of yacc.c */ +#line 533 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_BOR, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 106: + +/* Line 1455 of yacc.c */ +#line 540 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_LAND, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 108: + +/* Line 1455 of yacc.c */ +#line 547 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_LXOR, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 110: + +/* Line 1455 of yacc.c */ +#line 554 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_LOR, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 113: + +/* Line 1455 of yacc.c */ +#line 565 "dt_grammar.y" + { (yyval.l_node) = OP3((yyvsp[(1) - (5)].l_node), (yyvsp[(3) - (5)].l_node), (yyvsp[(5) - (5)].l_node)); } + break; + + case 115: + +/* Line 1455 of yacc.c */ +#line 570 "dt_grammar.y" + { + (yyval.l_node) = OP2((yyvsp[(2) - (3)].l_tok), (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 116: + +/* Line 1455 of yacc.c */ +#line 576 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_ASGN; } + break; + + case 117: + +/* Line 1455 of yacc.c */ +#line 577 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_MUL_EQ; } + break; + + case 118: + +/* Line 1455 of yacc.c */ +#line 578 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_DIV_EQ; } + break; + + case 119: + +/* Line 1455 of yacc.c */ +#line 579 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_MOD_EQ; } + break; + + case 120: + +/* Line 1455 of yacc.c */ +#line 580 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_ADD_EQ; } + break; + + case 121: + +/* Line 1455 of yacc.c */ +#line 581 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_SUB_EQ; } + break; + + case 122: + +/* Line 1455 of yacc.c */ +#line 582 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_LSH_EQ; } + break; + + case 123: + +/* Line 1455 of yacc.c */ +#line 583 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_RSH_EQ; } + break; + + case 124: + +/* Line 1455 of yacc.c */ +#line 584 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_AND_EQ; } + break; + + case 125: + +/* Line 1455 of yacc.c */ +#line 585 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_XOR_EQ; } + break; + + case 126: + +/* Line 1455 of yacc.c */ +#line 586 "dt_grammar.y" + { (yyval.l_tok) = DT_TOK_OR_EQ; } + break; + + case 128: + +/* Line 1455 of yacc.c */ +#line 590 "dt_grammar.y" + { + (yyval.l_node) = OP2(DT_TOK_COMMA, (yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 129: + +/* Line 1455 of yacc.c */ +#line 595 "dt_grammar.y" + { + (yyval.l_node) = dt_node_decl(); + dt_decl_free(dt_decl_pop()); + yybegin(YYS_CLAUSE); + } + break; + + case 130: + +/* Line 1455 of yacc.c */ +#line 600 "dt_grammar.y" + { + (yyval.l_node) = (yyvsp[(2) - (3)].l_node); + dt_decl_free(dt_decl_pop()); + yybegin(YYS_CLAUSE); + } + break; + + case 143: + +/* Line 1455 of yacc.c */ +#line 626 "dt_grammar.y" + { dt_decl_class(DT_DC_AUTO); } + break; + + case 144: + +/* Line 1455 of yacc.c */ +#line 627 "dt_grammar.y" + { dt_decl_class(DT_DC_REGISTER); } + break; + + case 145: + +/* Line 1455 of yacc.c */ +#line 628 "dt_grammar.y" + { dt_decl_class(DT_DC_STATIC); } + break; + + case 146: + +/* Line 1455 of yacc.c */ +#line 629 "dt_grammar.y" + { dt_decl_class(DT_DC_EXTERN); } + break; + + case 147: + +/* Line 1455 of yacc.c */ +#line 630 "dt_grammar.y" + { dt_decl_class(DT_DC_TYPEDEF); } + break; + + case 149: + +/* Line 1455 of yacc.c */ +#line 635 "dt_grammar.y" + { dt_decl_class(DT_DC_SELF); } + break; + + case 150: + +/* Line 1455 of yacc.c */ +#line 636 "dt_grammar.y" + { dt_decl_class(DT_DC_THIS); } + break; + + case 151: + +/* Line 1455 of yacc.c */ +#line 639 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_spec(CTF_K_INTEGER, DUP("void")); } + break; + + case 152: + +/* Line 1455 of yacc.c */ +#line 640 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_spec(CTF_K_INTEGER, DUP("char")); } + break; + + case 153: + +/* Line 1455 of yacc.c */ +#line 641 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_attr(DT_DA_SHORT); } + break; + + case 154: + +/* Line 1455 of yacc.c */ +#line 642 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_spec(CTF_K_INTEGER, DUP("int")); } + break; + + case 155: + +/* Line 1455 of yacc.c */ +#line 643 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_attr(DT_DA_LONG); } + break; + + case 156: + +/* Line 1455 of yacc.c */ +#line 644 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_spec(CTF_K_FLOAT, DUP("float")); } + break; + + case 157: + +/* Line 1455 of yacc.c */ +#line 645 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_spec(CTF_K_FLOAT, DUP("double")); } + break; + + case 158: + +/* Line 1455 of yacc.c */ +#line 646 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_attr(DT_DA_SIGNED); } + break; + + case 159: + +/* Line 1455 of yacc.c */ +#line 647 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_attr(DT_DA_UNSIGNED); } + break; + + case 160: + +/* Line 1455 of yacc.c */ +#line 648 "dt_grammar.y" + { + (yyval.l_decl) = dt_decl_spec(CTF_K_TYPEDEF, DUP("string")); + } + break; + + case 161: + +/* Line 1455 of yacc.c */ +#line 651 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_spec(CTF_K_TYPEDEF, (yyvsp[(1) - (1)].l_str)); } + break; + + case 164: + +/* Line 1455 of yacc.c */ +#line 656 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_attr(DT_DA_CONST); } + break; + + case 165: + +/* Line 1455 of yacc.c */ +#line 657 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_attr(DT_DA_RESTRICT); } + break; + + case 166: + +/* Line 1455 of yacc.c */ +#line 658 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_attr(DT_DA_VOLATILE); } + break; + + case 167: + +/* Line 1455 of yacc.c */ +#line 662 "dt_grammar.y" + { + (yyval.l_decl) = dt_scope_pop(); + } + break; + + case 168: + +/* Line 1455 of yacc.c */ +#line 665 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_spec((yyvsp[(1) - (2)].l_tok), (yyvsp[(2) - (2)].l_str)); } + break; + + case 169: + +/* Line 1455 of yacc.c */ +#line 666 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_spec((yyvsp[(1) - (2)].l_tok), (yyvsp[(2) - (2)].l_str)); } + break; + + case 170: + +/* Line 1455 of yacc.c */ +#line 670 "dt_grammar.y" + { dt_decl_sou((yyvsp[(1) - (2)].l_tok), NULL); } + break; + + case 171: + +/* Line 1455 of yacc.c */ +#line 671 "dt_grammar.y" + { dt_decl_sou((yyvsp[(1) - (3)].l_tok), (yyvsp[(2) - (3)].l_str)); } + break; + + case 172: + +/* Line 1455 of yacc.c */ +#line 672 "dt_grammar.y" + { dt_decl_sou((yyvsp[(1) - (3)].l_tok), (yyvsp[(2) - (3)].l_str)); } + break; + + case 173: + +/* Line 1455 of yacc.c */ +#line 676 "dt_grammar.y" + { (yyval.l_tok) = CTF_K_STRUCT; } + break; + + case 174: + +/* Line 1455 of yacc.c */ +#line 677 "dt_grammar.y" + { (yyval.l_tok) = CTF_K_UNION; } + break; + + case 178: + +/* Line 1455 of yacc.c */ +#line 687 "dt_grammar.y" + { + (yyval.l_node) = LINK((yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 179: + +/* Line 1455 of yacc.c */ +#line 693 "dt_grammar.y" + { + (yyval.l_node) = dt_node_decl(); + dt_decl_reset(); + } + break; + + case 180: + +/* Line 1455 of yacc.c */ +#line 700 "dt_grammar.y" + { + dt_decl_free(dt_decl_pop()); + } + break; + + case 182: + +/* Line 1455 of yacc.c */ +#line 707 "dt_grammar.y" + { (yyval.l_decl) = (yyvsp[(2) - (2)].l_decl); } + break; + + case 184: + +/* Line 1455 of yacc.c */ +#line 709 "dt_grammar.y" + { (yyval.l_decl) = (yyvsp[(2) - (2)].l_decl); } + break; + + case 187: + +/* Line 1455 of yacc.c */ +#line 718 "dt_grammar.y" + { dt_decl_member(NULL); } + break; + + case 188: + +/* Line 1455 of yacc.c */ +#line 719 "dt_grammar.y" + { dt_decl_member((yyvsp[(2) - (2)].l_node)); } + break; + + case 189: + +/* Line 1455 of yacc.c */ +#line 720 "dt_grammar.y" + { + dt_decl_member((yyvsp[(3) - (3)].l_node)); + } + break; + + case 190: + +/* Line 1455 of yacc.c */ +#line 726 "dt_grammar.y" + { (yyval.l_decl) = dt_scope_pop(); } + break; + + case 191: + +/* Line 1455 of yacc.c */ +#line 727 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_spec(CTF_K_ENUM, (yyvsp[(2) - (2)].l_str)); } + break; + + case 192: + +/* Line 1455 of yacc.c */ +#line 728 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_spec(CTF_K_ENUM, (yyvsp[(2) - (2)].l_str)); } + break; + + case 193: + +/* Line 1455 of yacc.c */ +#line 732 "dt_grammar.y" + { dt_decl_enum(NULL); } + break; + + case 194: + +/* Line 1455 of yacc.c */ +#line 733 "dt_grammar.y" + { dt_decl_enum((yyvsp[(2) - (3)].l_str)); } + break; + + case 195: + +/* Line 1455 of yacc.c */ +#line 734 "dt_grammar.y" + { dt_decl_enum((yyvsp[(2) - (3)].l_str)); } + break; + + case 198: + +/* Line 1455 of yacc.c */ +#line 742 "dt_grammar.y" + { dt_decl_enumerator((yyvsp[(1) - (1)].l_str), NULL); } + break; + + case 199: + +/* Line 1455 of yacc.c */ +#line 743 "dt_grammar.y" + { + dt_decl_enumerator((yyvsp[(1) - (3)].l_str), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 202: + +/* Line 1455 of yacc.c */ +#line 753 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_ident((yyvsp[(1) - (1)].l_str)); } + break; + + case 203: + +/* Line 1455 of yacc.c */ +#line 754 "dt_grammar.y" + { (yyval.l_decl) = (yyvsp[(2) - (3)].l_decl); } + break; + + case 204: + +/* Line 1455 of yacc.c */ +#line 755 "dt_grammar.y" + { dt_decl_array((yyvsp[(2) - (2)].l_node)); } + break; + + case 205: + +/* Line 1455 of yacc.c */ +#line 756 "dt_grammar.y" + { dt_decl_func((yyvsp[(1) - (2)].l_decl), (yyvsp[(2) - (2)].l_node)); } + break; + + case 206: + +/* Line 1455 of yacc.c */ +#line 759 "dt_grammar.y" + { dt_decl_top()->dd_attr |= DT_DA_PAREN; } + break; + + case 207: + +/* Line 1455 of yacc.c */ +#line 762 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_ptr(); } + break; + + case 208: + +/* Line 1455 of yacc.c */ +#line 763 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_ptr(); } + break; + + case 209: + +/* Line 1455 of yacc.c */ +#line 764 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_ptr(); } + break; + + case 210: + +/* Line 1455 of yacc.c */ +#line 765 "dt_grammar.y" + { (yyval.l_decl) = dt_decl_ptr(); } + break; + + case 212: + +/* Line 1455 of yacc.c */ +#line 770 "dt_grammar.y" + { (yyval.l_decl) = (yyvsp[(2) - (2)].l_decl); } + break; + + case 214: + +/* Line 1455 of yacc.c */ +#line 775 "dt_grammar.y" + { (yyval.l_node) = dt_node_vatype(); } + break; + + case 215: + +/* Line 1455 of yacc.c */ +#line 776 "dt_grammar.y" + { + (yyval.l_node) = LINK((yyvsp[(1) - (3)].l_node), dt_node_vatype()); + } + break; + + case 217: + +/* Line 1455 of yacc.c */ +#line 782 "dt_grammar.y" + { + (yyval.l_node) = LINK((yyvsp[(1) - (3)].l_node), (yyvsp[(3) - (3)].l_node)); + } + break; + + case 218: + +/* Line 1455 of yacc.c */ +#line 788 "dt_grammar.y" + { + (yyval.l_node) = dt_node_type(NULL); + } + break; + + case 219: + +/* Line 1455 of yacc.c */ +#line 791 "dt_grammar.y" + { + (yyval.l_node) = dt_node_type(NULL); + } + break; + + case 220: + +/* Line 1455 of yacc.c */ +#line 794 "dt_grammar.y" + { + (yyval.l_node) = dt_node_type(NULL); + } + break; + + case 221: + +/* Line 1455 of yacc.c */ +#line 799 "dt_grammar.y" + { + (yyval.l_decl) = dt_decl_pop(); + } + break; + + case 222: + +/* Line 1455 of yacc.c */ +#line 802 "dt_grammar.y" + { + (yyval.l_decl) = dt_decl_pop(); + } + break; + + case 226: + +/* Line 1455 of yacc.c */ +#line 814 "dt_grammar.y" + { (yyval.l_decl) = (yyvsp[(2) - (3)].l_decl); } + break; + + case 227: + +/* Line 1455 of yacc.c */ +#line 815 "dt_grammar.y" + { dt_decl_array((yyvsp[(2) - (2)].l_node)); } + break; + + case 228: + +/* Line 1455 of yacc.c */ +#line 816 "dt_grammar.y" + { dt_decl_array((yyvsp[(1) - (1)].l_node)); (yyval.l_decl) = NULL; } + break; + + case 229: + +/* Line 1455 of yacc.c */ +#line 817 "dt_grammar.y" + { dt_decl_func((yyvsp[(1) - (2)].l_decl), (yyvsp[(2) - (2)].l_node)); } + break; + + case 230: + +/* Line 1455 of yacc.c */ +#line 818 "dt_grammar.y" + { dt_decl_func(NULL, (yyvsp[(1) - (1)].l_node)); } + break; + + case 231: + +/* Line 1455 of yacc.c */ +#line 821 "dt_grammar.y" + { dt_scope_push(NULL, CTF_ERR); } + break; + + case 232: + +/* Line 1455 of yacc.c */ +#line 822 "dt_grammar.y" + { + dt_scope_pop(); + (yyval.l_node) = (yyvsp[(3) - (4)].l_node); + } + break; + + case 233: + +/* Line 1455 of yacc.c */ +#line 829 "dt_grammar.y" + { (yyval.l_node) = NULL; } + break; + + case 234: + +/* Line 1455 of yacc.c */ +#line 830 "dt_grammar.y" + { (yyval.l_node) = (yyvsp[(1) - (1)].l_node); } + break; + + case 235: + +/* Line 1455 of yacc.c */ +#line 831 "dt_grammar.y" + { (yyval.l_node) = (yyvsp[(1) - (1)].l_node); } + break; + + case 236: + +/* Line 1455 of yacc.c */ +#line 834 "dt_grammar.y" + { dt_scope_push(NULL, CTF_ERR); } + break; + + case 237: + +/* Line 1455 of yacc.c */ +#line 835 "dt_grammar.y" + { + dt_scope_pop(); + (yyval.l_node) = (yyvsp[(3) - (4)].l_node); + } + break; + + case 238: + +/* Line 1455 of yacc.c */ +#line 842 "dt_grammar.y" + { (yyval.l_node) = NULL; } + break; + + case 239: + +/* Line 1455 of yacc.c */ +#line 843 "dt_grammar.y" + { (yyval.l_node) = (yyvsp[(1) - (1)].l_node); } + break; + + + +/* Line 1455 of yacc.c */ +#line 3516 "dt_grammar.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + + +/* Line 1675 of yacc.c */ +#line 846 "dt_grammar.y" + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/generated/dt_grammar.h b/src/VBox/ExtPacks/VBoxDTrace/generated/dt_grammar.h new file mode 100644 index 00000000..cf624531 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/generated/dt_grammar.h @@ -0,0 +1,290 @@ + +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + DT_TOK_EOF = 0, + DT_TOK_COMMA = 258, + DT_TOK_ELLIPSIS = 259, + DT_TOK_ASGN = 260, + DT_TOK_ADD_EQ = 261, + DT_TOK_SUB_EQ = 262, + DT_TOK_MUL_EQ = 263, + DT_TOK_DIV_EQ = 264, + DT_TOK_MOD_EQ = 265, + DT_TOK_AND_EQ = 266, + DT_TOK_XOR_EQ = 267, + DT_TOK_OR_EQ = 268, + DT_TOK_LSH_EQ = 269, + DT_TOK_RSH_EQ = 270, + DT_TOK_QUESTION = 271, + DT_TOK_COLON = 272, + DT_TOK_LOR = 273, + DT_TOK_LXOR = 274, + DT_TOK_LAND = 275, + DT_TOK_BOR = 276, + DT_TOK_XOR = 277, + DT_TOK_BAND = 278, + DT_TOK_EQU = 279, + DT_TOK_NEQ = 280, + DT_TOK_LT = 281, + DT_TOK_LE = 282, + DT_TOK_GT = 283, + DT_TOK_GE = 284, + DT_TOK_LSH = 285, + DT_TOK_RSH = 286, + DT_TOK_ADD = 287, + DT_TOK_SUB = 288, + DT_TOK_MUL = 289, + DT_TOK_DIV = 290, + DT_TOK_MOD = 291, + DT_TOK_LNEG = 292, + DT_TOK_BNEG = 293, + DT_TOK_ADDADD = 294, + DT_TOK_SUBSUB = 295, + DT_TOK_PREINC = 296, + DT_TOK_POSTINC = 297, + DT_TOK_PREDEC = 298, + DT_TOK_POSTDEC = 299, + DT_TOK_IPOS = 300, + DT_TOK_INEG = 301, + DT_TOK_DEREF = 302, + DT_TOK_ADDROF = 303, + DT_TOK_OFFSETOF = 304, + DT_TOK_SIZEOF = 305, + DT_TOK_STRINGOF = 306, + DT_TOK_XLATE = 307, + DT_TOK_LPAR = 308, + DT_TOK_RPAR = 309, + DT_TOK_LBRAC = 310, + DT_TOK_RBRAC = 311, + DT_TOK_PTR = 312, + DT_TOK_DOT = 313, + DT_TOK_STRING = 314, + DT_TOK_IDENT = 315, + DT_TOK_PSPEC = 316, + DT_TOK_AGG = 317, + DT_TOK_TNAME = 318, + DT_TOK_INT = 319, + DT_KEY_AUTO = 320, + DT_KEY_BREAK = 321, + DT_KEY_CASE = 322, + DT_KEY_CHAR = 323, + DT_KEY_CONST = 324, + DT_KEY_CONTINUE = 325, + DT_KEY_COUNTER = 326, + DT_KEY_DEFAULT = 327, + DT_KEY_DO = 328, + DT_KEY_DOUBLE = 329, + DT_KEY_ELSE = 330, + DT_KEY_ENUM = 331, + DT_KEY_EXTERN = 332, + DT_KEY_FLOAT = 333, + DT_KEY_FOR = 334, + DT_KEY_GOTO = 335, + DT_KEY_IF = 336, + DT_KEY_IMPORT = 337, + DT_KEY_INLINE = 338, + DT_KEY_INT = 339, + DT_KEY_LONG = 340, + DT_KEY_PROBE = 341, + DT_KEY_PROVIDER = 342, + DT_KEY_REGISTER = 343, + DT_KEY_RESTRICT = 344, + DT_KEY_RETURN = 345, + DT_KEY_SELF = 346, + DT_KEY_SHORT = 347, + DT_KEY_SIGNED = 348, + DT_KEY_STATIC = 349, + DT_KEY_STRING = 350, + DT_KEY_STRUCT = 351, + DT_KEY_SWITCH = 352, + DT_KEY_THIS = 353, + DT_KEY_TYPEDEF = 354, + DT_KEY_UNION = 355, + DT_KEY_UNSIGNED = 356, + DT_KEY_VOID = 357, + DT_KEY_VOLATILE = 358, + DT_KEY_WHILE = 359, + DT_KEY_XLATOR = 360, + DT_TOK_EPRED = 361, + DT_CTX_DEXPR = 362, + DT_CTX_DPROG = 363, + DT_CTX_DTYPE = 364 + }; +#endif +/* Tokens. */ +#define DT_TOK_EOF 0 +#define DT_TOK_COMMA 258 +#define DT_TOK_ELLIPSIS 259 +#define DT_TOK_ASGN 260 +#define DT_TOK_ADD_EQ 261 +#define DT_TOK_SUB_EQ 262 +#define DT_TOK_MUL_EQ 263 +#define DT_TOK_DIV_EQ 264 +#define DT_TOK_MOD_EQ 265 +#define DT_TOK_AND_EQ 266 +#define DT_TOK_XOR_EQ 267 +#define DT_TOK_OR_EQ 268 +#define DT_TOK_LSH_EQ 269 +#define DT_TOK_RSH_EQ 270 +#define DT_TOK_QUESTION 271 +#define DT_TOK_COLON 272 +#define DT_TOK_LOR 273 +#define DT_TOK_LXOR 274 +#define DT_TOK_LAND 275 +#define DT_TOK_BOR 276 +#define DT_TOK_XOR 277 +#define DT_TOK_BAND 278 +#define DT_TOK_EQU 279 +#define DT_TOK_NEQ 280 +#define DT_TOK_LT 281 +#define DT_TOK_LE 282 +#define DT_TOK_GT 283 +#define DT_TOK_GE 284 +#define DT_TOK_LSH 285 +#define DT_TOK_RSH 286 +#define DT_TOK_ADD 287 +#define DT_TOK_SUB 288 +#define DT_TOK_MUL 289 +#define DT_TOK_DIV 290 +#define DT_TOK_MOD 291 +#define DT_TOK_LNEG 292 +#define DT_TOK_BNEG 293 +#define DT_TOK_ADDADD 294 +#define DT_TOK_SUBSUB 295 +#define DT_TOK_PREINC 296 +#define DT_TOK_POSTINC 297 +#define DT_TOK_PREDEC 298 +#define DT_TOK_POSTDEC 299 +#define DT_TOK_IPOS 300 +#define DT_TOK_INEG 301 +#define DT_TOK_DEREF 302 +#define DT_TOK_ADDROF 303 +#define DT_TOK_OFFSETOF 304 +#define DT_TOK_SIZEOF 305 +#define DT_TOK_STRINGOF 306 +#define DT_TOK_XLATE 307 +#define DT_TOK_LPAR 308 +#define DT_TOK_RPAR 309 +#define DT_TOK_LBRAC 310 +#define DT_TOK_RBRAC 311 +#define DT_TOK_PTR 312 +#define DT_TOK_DOT 313 +#define DT_TOK_STRING 314 +#define DT_TOK_IDENT 315 +#define DT_TOK_PSPEC 316 +#define DT_TOK_AGG 317 +#define DT_TOK_TNAME 318 +#define DT_TOK_INT 319 +#define DT_KEY_AUTO 320 +#define DT_KEY_BREAK 321 +#define DT_KEY_CASE 322 +#define DT_KEY_CHAR 323 +#define DT_KEY_CONST 324 +#define DT_KEY_CONTINUE 325 +#define DT_KEY_COUNTER 326 +#define DT_KEY_DEFAULT 327 +#define DT_KEY_DO 328 +#define DT_KEY_DOUBLE 329 +#define DT_KEY_ELSE 330 +#define DT_KEY_ENUM 331 +#define DT_KEY_EXTERN 332 +#define DT_KEY_FLOAT 333 +#define DT_KEY_FOR 334 +#define DT_KEY_GOTO 335 +#define DT_KEY_IF 336 +#define DT_KEY_IMPORT 337 +#define DT_KEY_INLINE 338 +#define DT_KEY_INT 339 +#define DT_KEY_LONG 340 +#define DT_KEY_PROBE 341 +#define DT_KEY_PROVIDER 342 +#define DT_KEY_REGISTER 343 +#define DT_KEY_RESTRICT 344 +#define DT_KEY_RETURN 345 +#define DT_KEY_SELF 346 +#define DT_KEY_SHORT 347 +#define DT_KEY_SIGNED 348 +#define DT_KEY_STATIC 349 +#define DT_KEY_STRING 350 +#define DT_KEY_STRUCT 351 +#define DT_KEY_SWITCH 352 +#define DT_KEY_THIS 353 +#define DT_KEY_TYPEDEF 354 +#define DT_KEY_UNION 355 +#define DT_KEY_UNSIGNED 356 +#define DT_KEY_VOID 357 +#define DT_KEY_VOLATILE 358 +#define DT_KEY_WHILE 359 +#define DT_KEY_XLATOR 360 +#define DT_TOK_EPRED 361 +#define DT_CTX_DEXPR 362 +#define DT_CTX_DPROG 363 +#define DT_CTX_DTYPE 364 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + +/* Line 1676 of yacc.c */ +#line 51 "dt_grammar.y" + + dt_node_t *l_node; + dt_decl_t *l_decl; + char *l_str; + uintmax_t l_int; + int l_tok; + + + +/* Line 1676 of yacc.c */ +#line 282 "dt_grammar.h" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + +extern YYSTYPE yylval; + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c b/src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c new file mode 100644 index 00000000..3d54d443 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/generated/dt_lex.c @@ -0,0 +1,3516 @@ +#line 2 "dt_lex.c" +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +#define YY_FLEX_LEX_COMPAT +extern int yylineno; +int yylineno = 1; +extern char yytext[]; + + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + if ( yyleng + yy_more_offset >= YYLMAX ) \ + YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ + yy_flex_strncpy( &yytext[yy_more_offset], yytext_ptr, yyleng + 1 ); \ + yyleng += yy_more_offset; \ + yy_prev_more_offset = yy_more_offset; \ + yy_more_offset = 0; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 162 +#define YY_END_OF_BUFFER 163 +static yyconst short int yy_acclist[740] = + { 0, + 163, 162, 149, 162, 147, 149, 162, 147, 162, 126, + 149, 162, 149, 162,16469, 149, 162, 124, 149, 162, + 109, 149, 162, 149, 162,16472, 100, 149, 162, 101, + 149, 162, 123, 149, 162, 121, 149, 162, 145, 149, + 162, 122, 149, 162, 129, 149, 162, 99, 149, 162, + 81, 84, 149, 162, 81, 84, 149, 162, 128, 149, + 162, 146, 149, 162, 115, 149, 162, 131, 149, 162, + 117, 149, 162, 127, 149, 162, 80, 149, 162, 78, + 149, 162, 102, 149, 162, 149, 162, 103, 149, 162, + 108, 149, 162, 78, 149, 162, 78, 149, 162, 78, + + 149, 162, 78, 149, 162, 78, 149, 162, 78, 149, + 162, 78, 149, 162, 78, 149, 162, 78, 149, 162, + 78, 149, 162, 78, 149, 162, 78, 149, 162, 78, + 149, 162, 78, 149, 162, 78, 149, 162, 78, 149, + 162, 78, 149, 162, 78, 149, 162, 104, 149, 162, + 107, 149, 162, 106, 149, 162, 125, 149, 162, 147, + 149, 162, 94, 149, 162, 152, 162, 152, 162, 152, + 162, 157, 162, 156, 157, 162, 156, 162, 153, 157, + 162, 155, 157, 162, 154, 157, 162, 82, 157, 162, + 82, 157, 162, 153, 157, 162, 153, 157, 162, 153, + + 157, 162, 153, 157, 162, 153, 157, 162, 153, 157, + 162, 153, 157, 162, 153, 157, 162, 153, 157, 162, + 153, 157, 162, 153, 157, 162, 153, 157, 162, 153, + 157, 162, 105, 157, 162, 156, 157, 162, 95, 157, + 162, 160, 161, 162, 159, 161, 162, 158, 162, 161, + 162,16469, 83, 160, 161, 162, 83, 160, 161, 162, + 97, 162, 98, 162, 97, 162, 96, 97, 162, 114, + 16469, 8277, 86, 75, 77, 136, 110, 137,16472, 8280, + 89, 134, 142, 132, 143, 133, 130, 84, 90, 135, + 84, 81, 84, 84, 81, 84, 81, 119, 116, 113, + + 118, 120, 79, 78, 148, 138, 111, 78, 78, 78, + 78, 78, 78, 9, 78, 78, 78, 78, 78, 78, + 78, 17, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 139, 112, 94, 92, 151, 150, 153, 91, 82, + 82, 82, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 95, 93, 160, 159,16469, 87, 83, + 160, 83, 160, 83, 160, 160, 96, 74, 76, 77, + 144, 84, 84, 81, 81, 81, 140, 141, 79, 78, + + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 15, 78, 78, 78, 78, 20, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 92, 82, 82, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 56, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 93, 83, 160, 83, 160, 76, 1, 78, 78, + 3, 78, 4, 78, 78, 78, 78, 78, 78, 11, + 78, 12, 78, 78, 78, 16, 78, 78, 78, 21, + + 78, 78, 78, 78, 78, 78, 78, 28, 78, 78, + 78, 78, 78, 78, 78, 78, 37, 78, 78, 78, + 78, 78, 42, 78, 78, 78, 78, 46, 153, 47, + 153, 153, 153, 153, 51, 153, 153, 153, 153, 153, + 57, 153, 153, 153, 153, 61, 153, 153, 153, 153, + 153, 153, 67, 153, 153, 153, 153, 153, 72, 153, + 153, 2, 78, 5, 78, 78, 78, 78, 78, 78, + 14, 78, 78, 78, 78, 23, 78, 78, 78, 78, + 78, 29, 78, 78, 78, 78, 78, 78, 78, 78, + 78, 40, 78, 78, 78, 44, 78, 45, 78, 48, + + 153, 153, 153, 153, 53, 153, 153, 153, 153, 153, + 153, 62, 153, 153, 153, 153, 153, 153, 153, 70, + 153, 153, 153, 78, 78, 78, 10, 78, 13, 78, + 18, 78, 19, 78, 78, 78, 78, 78, 27, 78, + 30, 78, 31, 78, 32, 78, 33, 78, 35, 78, + 36, 78, 78, 78, 78, 78, 153, 50, 153, 52, + 153, 54, 153, 55, 153, 153, 153, 153, 63, 153, + 64, 153, 65, 153, 66, 153, 153, 153, 153, 153, + 78, 7, 78, 8, 78, 78, 78, 78, 78, 78, + 78, 39, 78, 78, 78, 49, 153, 153, 153, 153, + + 153, 69, 153, 153, 153, 6, 78, 22, 78, 24, + 78, 25, 78, 26, 78, 34, 78, 78, 41, 78, + 43, 78, 58, 153, 59, 153, 60, 153, 153, 71, + 153, 73, 153, 78, 153, 38, 78, 68, 153 + } ; + +static yyconst short int yy_accept[511] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 3, 5, 8, 10, 13, 16, + 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, + 48, 51, 55, 59, 62, 65, 68, 71, 74, 77, + 80, 83, 86, 88, 91, 94, 97, 100, 103, 106, + 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, + 139, 142, 145, 148, 151, 154, 157, 160, 163, 166, + 168, 170, 172, 174, 177, 179, 182, 185, 188, 191, + 194, 197, 200, 203, 206, 209, 212, 215, 218, 221, + 224, 227, 230, 233, 236, 239, 242, 245, 248, 250, + + 253, 257, 261, 263, 265, 267, 270, 271, 272, 273, + 274, 274, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 282, 283, 284, 285, 286, 287, 288, 288, 289, + 290, 291, 292, 294, 294, 295, 297, 298, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 316, 317, 318, 319, 320, + 321, 322, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 353, 354, 355, 356, 357, 358, 359, + + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 374, 375, 376, 377, 378, + 379, 380, 380, 382, 384, 386, 387, 387, 388, 389, + 390, 391, 392, 393, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 414, 415, 416, 417, 419, 420, + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 456, 457, 458, 459, 460, 461, + + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 475, 477, 478, 480, 481, 483, 485, 486, + 487, 488, 489, 490, 492, 494, 495, 496, 498, 499, + 500, 502, 503, 504, 505, 506, 507, 508, 510, 511, + 512, 513, 514, 515, 516, 517, 519, 520, 521, 522, + 523, 525, 526, 527, 528, 530, 532, 533, 534, 535, + 537, 538, 539, 540, 541, 543, 544, 545, 546, 548, + 549, 550, 551, 552, 553, 555, 556, 557, 558, 559, + 561, 562, 564, 566, 567, 568, 569, 570, 571, 573, + 574, 575, 576, 578, 579, 580, 581, 582, 584, 585, + + 586, 587, 588, 589, 590, 591, 592, 594, 595, 596, + 598, 600, 602, 603, 604, 605, 607, 608, 609, 610, + 611, 612, 614, 615, 616, 617, 618, 619, 620, 622, + 623, 624, 625, 626, 627, 629, 631, 633, 635, 636, + 637, 638, 639, 641, 643, 645, 647, 649, 651, 653, + 654, 655, 656, 657, 658, 660, 662, 664, 666, 667, + 668, 669, 671, 673, 675, 677, 678, 679, 680, 681, + 682, 684, 686, 687, 688, 689, 690, 691, 692, 694, + 695, 696, 698, 699, 700, 701, 702, 704, 705, 706, + 708, 710, 712, 714, 716, 718, 719, 721, 723, 725, + + 727, 729, 730, 732, 734, 735, 736, 738, 740, 740 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 29, 29, 29, 30, 31, + 32, 32, 32, 32, 32, 33, 32, 32, 32, 32, + 32, 32, 32, 32, 34, 32, 32, 35, 32, 32, + 36, 37, 38, 39, 32, 40, 41, 42, 43, 44, + + 45, 46, 47, 48, 49, 32, 50, 51, 52, 53, + 54, 55, 32, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[69] = + { 0, + 1, 2, 3, 1, 4, 2, 1, 5, 1, 1, + 1, 1, 1, 4, 1, 1, 4, 4, 1, 6, + 6, 4, 1, 1, 1, 1, 4, 1, 7, 7, + 7, 8, 8, 8, 8, 4, 4, 4, 1, 9, + 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 1, 1, 1, 1 + } ; + +static yyconst short int yy_base[530] = + { 0, + 0, 0, 0, 67, 56, 57, 76, 143, 145, 150, + 811, 152, 813, 815, 815, 815, 815, 787, 143, 152, + 786, 151, 164, 815, 815, 785, 143, 815, 152, 161, + 149, 184, 122, 815, 815, 48, 784, 160, 815, 0, + 0, 815, 805, 815, 158, 748, 750, 146, 144, 137, + 141, 751, 157, 750, 757, 746, 756, 163, 175, 747, + 745, 750, 746, 815, 166, 815, 815, 218, 791, 815, + 776, 780, 815, 815, 815, 0, 815, 779, 206, 216, + 733, 159, 737, 180, 739, 192, 735, 732, 742, 203, + 199, 733, 731, 815, 251, 779, 0, 781, 815, 253, + + 243, 249, 815, 815, 264, 815, 815, 278, 815, 815, + 779, 252, 259, 0, 815, 815, 815, 282, 815, 815, + 778, 815, 815, 815, 815, 815, 815, 762, 266, 815, + 815, 283, 239, 303, 815, 183, 255, 0, 754, 815, + 815, 815, 753, 0, 0, 815, 815, 815, 719, 731, + 718, 733, 169, 727, 713, 714, 711, 711, 714, 711, + 708, 0, 710, 240, 711, 717, 708, 274, 710, 706, + 245, 254, 710, 709, 716, 701, 273, 113, 706, 713, + 815, 815, 331, 748, 0, 815, 815, 0, 815, 306, + 256, 292, 0, 694, 710, 201, 691, 690, 690, 693, + + 691, 284, 692, 690, 149, 692, 688, 694, 295, 691, + 698, 683, 288, 295, 345, 732, 0, 0, 734, 347, + 815, 732, 328, 308, 321, 368, 353, 815, 343, 0, + 0, 815, 350, 346, 371, 815, 323, 335, 815, 815, + 0, 680, 692, 687, 675, 318, 677, 688, 686, 682, + 674, 680, 683, 0, 669, 668, 672, 0, 673, 662, + 340, 669, 659, 657, 669, 658, 660, 667, 653, 344, + 652, 652, 655, 662, 652, 656, 660, 662, 651, 643, + 0, 815, 372, 646, 643, 641, 644, 654, 643, 649, + 652, 638, 642, 0, 643, 629, 639, 629, 640, 629, + + 631, 625, 359, 625, 628, 635, 625, 629, 633, 635, + 0, 0, 412, 0, 0, 625, 0, 0, 616, 624, + 614, 612, 619, 0, 0, 613, 610, 0, 611, 613, + 0, 620, 619, 614, 605, 605, 604, 0, 601, 613, + 603, 607, 602, 611, 610, 0, 595, 607, 597, 602, + 0, 590, 602, 601, 0, 0, 587, 586, 592, 0, + 586, 583, 584, 586, 0, 589, 580, 580, 0, 577, + 589, 584, 579, 588, 0, 573, 585, 575, 580, 0, + 568, 0, 0, 572, 579, 572, 577, 568, 0, 562, + 574, 560, 0, 573, 558, 566, 561, 0, 569, 566, + + 568, 563, 551, 560, 556, 561, 0, 552, 555, 0, + 0, 0, 558, 557, 548, 0, 542, 554, 554, 529, + 527, 0, 501, 501, 423, 411, 417, 422, 0, 413, + 416, 405, 406, 403, 0, 0, 0, 0, 406, 414, + 407, 408, 0, 0, 0, 0, 396, 0, 0, 408, + 402, 402, 393, 384, 0, 0, 0, 0, 394, 393, + 394, 0, 0, 0, 0, 395, 389, 389, 379, 384, + 0, 0, 382, 371, 370, 367, 378, 363, 0, 376, + 374, 0, 360, 359, 349, 332, 0, 341, 333, 0, + 0, 0, 0, 0, 0, 323, 0, 0, 0, 0, + + 0, 319, 0, 0, 302, 137, 0, 0, 815, 471, + 480, 489, 498, 507, 512, 521, 524, 527, 533, 542, + 551, 555, 559, 563, 565, 573, 577, 584, 588 + } ; + +static yyconst short int yy_def[530] = + { 0, + 510, 510, 509, 3, 511, 511, 509, 7, 512, 512, + 513, 513, 509, 509, 509, 509, 509, 509, 514, 515, + 509, 509, 516, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 32, 509, 509, 509, 509, 509, 509, 517, + 518, 509, 509, 509, 509, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 519, 509, 509, 509, 509, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 509, 509, 509, 520, 509, 509, 521, + + 520, 520, 509, 509, 509, 509, 509, 514, 509, 509, + 514, 522, 509, 523, 509, 509, 509, 516, 509, 509, + 516, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 32, 509, 509, 509, 509, 524, 509, 509, + 509, 509, 509, 525, 518, 509, 509, 509, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 509, 509, 509, 509, 526, 509, 509, 519, 509, 509, + 509, 509, 527, 519, 519, 519, 519, 519, 519, 519, + + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 509, 509, 528, 520, 509, 521, + 509, 521, 520, 520, 520, 520, 509, 509, 509, 529, + 523, 509, 509, 509, 509, 509, 509, 524, 509, 509, + 525, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 526, 509, 527, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 528, 520, 520, 529, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, + 519, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 518, 518, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519, 519, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, + 518, 519, 519, 519, 519, 519, 519, 519, 519, 518, + 518, 518, 518, 518, 518, 518, 518, 518, 519, 519, + + 519, 519, 519, 519, 518, 519, 518, 519, 0, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509 + } ; + +static yyconst short int yy_nxt[884] = + { 0, + 15, 16, 17, 16, 18, 19, 15, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, + 41, 41, 41, 41, 41, 42, 43, 44, 45, 41, + 46, 47, 48, 49, 50, 51, 52, 41, 53, 41, + 54, 41, 41, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 41, 41, 64, 65, 66, 67, 68, 71, + 71, 139, 140, 69, 72, 72, 73, 74, 75, 74, + 76, 73, 73, 76, 73, 73, 73, 73, 73, 76, + 73, 77, 76, 76, 78, 79, 80, 76, 73, 73, + + 73, 73, 76, 73, 76, 76, 76, 76, 76, 76, + 76, 76, 76, 76, 73, 73, 81, 76, 82, 83, + 84, 85, 76, 76, 86, 76, 87, 76, 76, 76, + 88, 89, 90, 91, 92, 93, 76, 76, 76, 76, + 94, 73, 73, 73, 95, 109, 98, 99, 110, 96, + 100, 98, 99, 105, 104, 100, 509, 123, 106, 112, + 116, 277, 130, 278, 101, 102, 119, 124, 125, 101, + 102, 113, 113, 131, 120, 117, 126, 127, 128, 111, + 129, 129, 147, 509, 142, 143, 151, 156, 154, 157, + 181, 159, 508, 152, 160, 297, 148, 155, 158, 153, + + 121, 132, 162, 133, 133, 298, 195, 169, 163, 164, + 170, 171, 196, 134, 135, 236, 136, 137, 138, 183, + 172, 246, 174, 173, 184, 190, 190, 247, 134, 135, + 175, 182, 198, 236, 136, 190, 190, 176, 191, 192, + 193, 199, 137, 201, 202, 138, 210, 206, 191, 192, + 207, 208, 215, 286, 211, 109, 191, 216, 221, 287, + 209, 212, 223, 223, 192, 227, 191, 193, 223, 223, + 228, 229, 229, 509, 192, 224, 225, 226, 113, 113, + 109, 224, 225, 110, 119, 129, 129, 237, 282, 222, + 257, 267, 120, 224, 269, 134, 135, 258, 135, 224, + + 509, 225, 233, 233, 226, 237, 282, 225, 268, 270, + 134, 135, 134, 135, 111, 135, 135, 234, 121, 234, + 262, 275, 235, 235, 191, 190, 190, 134, 135, 276, + 263, 264, 183, 135, 293, 302, 307, 184, 191, 192, + 312, 294, 191, 309, 308, 310, 215, 223, 223, 109, + 303, 216, 221, 224, 227, 236, 191, 507, 312, 228, + 224, 225, 229, 229, 192, 235, 235, 237, 137, 233, + 233, 224, 506, 236, 319, 320, 505, 504, 224, 134, + 135, 333, 135, 222, 503, 237, 225, 313, 313, 502, + 235, 235, 343, 137, 134, 135, 313, 313, 313, 334, + + 135, 135, 344, 135, 191, 192, 501, 373, 313, 313, + 313, 313, 313, 313, 500, 499, 135, 374, 498, 497, + 496, 135, 191, 495, 494, 493, 492, 491, 490, 489, + 192, 313, 313, 488, 487, 486, 485, 484, 483, 482, + 313, 313, 313, 481, 224, 225, 480, 479, 478, 477, + 476, 475, 313, 313, 313, 313, 313, 313, 474, 473, + 472, 471, 224, 470, 469, 468, 467, 466, 465, 464, + 225, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 103, 103, + + 103, 103, 103, 103, 103, 103, 103, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 114, 114, 114, 114, + 114, 118, 118, 118, 118, 118, 118, 118, 118, 118, + 144, 144, 145, 145, 145, 145, 188, 188, 188, 188, + 188, 188, 218, 463, 462, 218, 218, 218, 218, 218, + 218, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 230, 230, 230, 230, 231, 231, 231, 231, 238, 238, + 241, 241, 241, 281, 281, 461, 281, 281, 281, 281, + 281, 281, 283, 283, 311, 311, 460, 311, 311, 311, + 311, 311, 311, 314, 314, 314, 314, 459, 458, 457, + + 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, + 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, + 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, + 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, + 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, + 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, + 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, + 386, 385, 384, 383, 382, 381, 380, 379, 378, 377, + 376, 375, 372, 371, 370, 369, 368, 367, 366, 365, + 364, 363, 362, 361, 360, 359, 358, 357, 356, 355, + + 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, + 342, 341, 340, 339, 338, 337, 336, 335, 332, 331, + 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, + 318, 317, 316, 315, 509, 219, 217, 306, 305, 304, + 301, 300, 299, 296, 295, 292, 291, 290, 289, 288, + 285, 284, 185, 280, 279, 274, 273, 272, 271, 266, + 265, 261, 260, 259, 256, 255, 254, 253, 252, 251, + 250, 249, 248, 245, 244, 243, 242, 240, 239, 232, + 509, 509, 219, 217, 214, 213, 205, 204, 203, 200, + 197, 194, 189, 187, 186, 185, 180, 179, 178, 177, + + 168, 167, 166, 165, 161, 150, 149, 146, 141, 122, + 115, 107, 509, 104, 13, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509 + } ; + +static yyconst short int yy_chk[884] = + { 0, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, + 6, 36, 36, 4, 5, 6, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 8, 19, 9, 9, 19, 8, + 9, 10, 10, 12, 12, 10, 33, 27, 12, 20, + 22, 178, 31, 178, 9, 9, 23, 27, 29, 10, + 10, 20, 20, 31, 23, 22, 29, 29, 30, 19, + 30, 30, 45, 33, 38, 38, 48, 50, 49, 50, + 65, 51, 506, 48, 51, 205, 45, 49, 50, 48, + + 23, 32, 53, 32, 32, 205, 82, 58, 53, 53, + 58, 58, 82, 32, 32, 136, 32, 32, 32, 68, + 58, 153, 59, 58, 68, 79, 79, 153, 32, 32, + 59, 65, 84, 136, 32, 80, 80, 59, 79, 79, + 79, 84, 32, 86, 86, 32, 91, 90, 80, 80, + 90, 90, 95, 196, 91, 100, 79, 95, 100, 196, + 90, 91, 101, 101, 79, 105, 80, 79, 102, 102, + 105, 112, 112, 133, 80, 101, 101, 101, 113, 113, + 108, 102, 102, 108, 118, 129, 129, 137, 191, 100, + 164, 171, 118, 101, 172, 129, 129, 164, 129, 102, + + 133, 101, 132, 132, 101, 137, 191, 102, 171, 172, + 129, 129, 132, 132, 108, 132, 129, 134, 118, 134, + 168, 177, 134, 134, 192, 190, 190, 132, 132, 177, + 168, 168, 183, 132, 202, 209, 213, 183, 190, 190, + 224, 202, 192, 214, 213, 214, 215, 223, 223, 220, + 209, 215, 220, 225, 227, 237, 190, 505, 224, 227, + 223, 223, 229, 229, 190, 234, 234, 238, 238, 233, + 233, 225, 502, 237, 246, 246, 496, 489, 223, 233, + 233, 261, 233, 220, 488, 238, 223, 226, 226, 486, + 235, 235, 270, 238, 233, 233, 226, 226, 226, 261, + + 233, 235, 270, 235, 283, 283, 485, 303, 226, 226, + 226, 226, 226, 226, 484, 483, 235, 303, 481, 480, + 478, 235, 283, 477, 476, 475, 474, 473, 470, 469, + 283, 313, 313, 468, 467, 466, 461, 460, 459, 454, + 313, 313, 313, 453, 313, 313, 452, 451, 450, 447, + 442, 441, 313, 313, 313, 313, 313, 313, 440, 439, + 434, 433, 313, 432, 431, 430, 428, 427, 426, 425, + 313, 510, 510, 510, 510, 510, 510, 510, 510, 510, + 511, 511, 511, 511, 511, 511, 511, 511, 511, 512, + 512, 512, 512, 512, 512, 512, 512, 512, 513, 513, + + 513, 513, 513, 513, 513, 513, 513, 514, 514, 514, + 514, 514, 514, 514, 514, 514, 515, 515, 515, 515, + 515, 516, 516, 516, 516, 516, 516, 516, 516, 516, + 517, 517, 518, 518, 518, 518, 519, 519, 519, 519, + 519, 519, 520, 424, 423, 520, 520, 520, 520, 520, + 520, 521, 521, 521, 521, 521, 521, 521, 521, 521, + 522, 522, 522, 522, 523, 523, 523, 523, 524, 524, + 525, 525, 525, 526, 526, 421, 526, 526, 526, 526, + 526, 526, 527, 527, 528, 528, 420, 528, 528, 528, + 528, 528, 528, 529, 529, 529, 529, 419, 418, 417, + + 415, 414, 413, 409, 408, 406, 405, 404, 403, 402, + 401, 400, 399, 397, 396, 395, 394, 392, 391, 390, + 388, 387, 386, 385, 384, 381, 379, 378, 377, 376, + 374, 373, 372, 371, 370, 368, 367, 366, 364, 363, + 362, 361, 359, 358, 357, 354, 353, 352, 350, 349, + 348, 347, 345, 344, 343, 342, 341, 340, 339, 337, + 336, 335, 334, 333, 332, 330, 329, 327, 326, 323, + 322, 321, 320, 319, 316, 310, 309, 308, 307, 306, + 305, 304, 302, 301, 300, 299, 298, 297, 296, 295, + 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, + + 280, 279, 278, 277, 276, 275, 274, 273, 272, 271, + 269, 268, 267, 266, 265, 264, 263, 262, 260, 259, + 257, 256, 255, 253, 252, 251, 250, 249, 248, 247, + 245, 244, 243, 242, 222, 219, 216, 212, 211, 210, + 208, 207, 206, 204, 203, 201, 200, 199, 198, 197, + 195, 194, 184, 180, 179, 176, 175, 174, 173, 170, + 169, 167, 166, 165, 163, 161, 160, 159, 158, 157, + 156, 155, 154, 152, 151, 150, 149, 143, 139, 128, + 121, 111, 98, 96, 93, 92, 89, 88, 87, 85, + 83, 81, 78, 72, 71, 69, 63, 62, 61, 60, + + 57, 56, 55, 54, 52, 47, 46, 43, 37, 26, + 21, 18, 13, 11, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, + 509, 509, 509 + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +static int yy_looking_for_trail_begin = 0; +static int yy_full_lp; +static int *yy_full_state; +#define YY_TRAILING_MASK 0x2000 +#define YY_TRAILING_HEAD_MASK 0x4000 +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \ +yy_state_ptr = yy_full_state; /* restore orig. state */ \ +yy_current_state = *yy_state_ptr; /* restore curr. state */ \ +++yy_lp; \ +goto find_rule; \ +} +static int yy_more_offset = 0; +static int yy_prev_more_offset = 0; +#define yymore() (yy_more_offset = yy_flex_strlen( yytext )) +#define YY_NEED_STRLEN +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET \ + { \ + yy_more_offset = yy_prev_more_offset; \ + yyleng -= yy_more_offset; \ + } +#ifndef YYLMAX +#define YYLMAX 8192 +#endif + +char yytext[YYLMAX]; +char *yytext_ptr; +#line 1 "dt_lex.l" +#define INITIAL 0 +#line 2 "dt_lex.l" +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL 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) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + */ + +#ifndef VBOX +#include +#include +#include +#include +#include +#include +#else /* VBOX */ +# ifdef RT_OS_WINDOWS /* No unistd.h on windows, avoid redef warnings of the [U]INTxx_MAX defines caused by no inttypes.h/stdint.h. */ +# define YY_NO_UNISTD_H +# undef INT8_MAX +# undef INT16_MAX +# undef INT32_MAX +# undef INT64_MAX +# undef UINT8_MAX +# undef UINT16_MAX +# undef UINT32_MAX +# undef UINT64_MAX +# endif +# ifdef _MSC_VER +# pragma warning(disable:4668 4131 4255) +# endif +# ifdef __GNUC__ +# if ((__GNUC__ << 16) + __GNUC_MINOR__) >= 0x40002 +# pragma GCC diagnostic ignored "-Wunused-function" +# endif +# endif +# include +# include +# define isdigit(a_ch) RT_C_IS_DIGIT(a_ch) +#endif /* VBOX */ + +#include +#include +#include +#include + +#ifndef USING_FLEX +/* + * We need to undefine lex's input and unput macros so that references to these + * call the functions provided at the end of this source file. + */ +#undef input +#undef unput +#else /* USING_FLEX */ +# define YY_INPUT(buf, result, max_size) \ + do { \ + if (yypcb->pcb_fileptr != NULL) { \ + result = (int)fread(buf, 1, max_size, yypcb->pcb_fileptr); \ + if (!result && ferror(yypcb->pcb_fileptr)) \ + longjmp(yypcb->pcb_jmpbuf, EDT_FIO); \ + /*YY_FATAL_ERROR("input in flex scanner failed");*/ \ + } else { \ + size_t off = yypcb->pcb_strptr - yypcb->pcb_string; \ + if (off < yypcb->pcb_strlen) { \ + off = yypcb->pcb_strlen - off; \ + result = max_size; \ + if ((size_t)result > off) \ + result = (int)off; \ + memcpy(buf, yypcb->pcb_strptr, result); \ + yypcb->pcb_strptr += result; \ + /*fprintf(stderr, "yy_input -> %d '%.*s'\n", result, result, buf);*/ \ + } else { \ + buf[0] = '\0'; \ + result = 0; \ + /*fprintf(stderr, "yy_input -> %d\n", result);*/ \ + } \ + } \ + } while (0) +#endif /* USING_FLEX */ + +static int id_or_type(const char *); +#ifndef USING_FLEX +static int input(void); +static void unput(int); +#endif + +/* + * We first define a set of labeled states for use in the D lexer and then a + * set of regular expressions to simplify things below. The lexer states are: + * + * S0 - D program clause and expression lexing + * S1 - D comments (i.e. skip everything until end of comment) + * S2 - D program outer scope (probe specifiers and declarations) + * S3 - D control line parsing (i.e. after ^# is seen but before \n) + * S4 - D control line scan (locate control directives only and invoke S3) + */ +#define S0 1 +#define S1 2 +#define S2 3 +#define S3 4 +#define S4 5 + +#line 968 "dt_lex.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + yy_current_buffer->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 132 "dt_lex.l" + + + + +/* + * We insert a special prologue into yylex() itself: if the pcb contains a + * context token, we return that prior to running the normal lexer. This + * allows libdtrace to force yacc into one of our three parsing contexts: D + * expression (DT_CTX_DEXPR), D program (DT_CTX_DPROG) or D type (DT_CTX_DTYPE). + * Once the token is returned, we clear it so this only happens once. + */ +if (yypcb->pcb_token != 0) { + int tok = yypcb->pcb_token; + yypcb->pcb_token = 0; + return (tok); +} + + + +#line 1142 "dt_lex.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 510 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_current_state != 509 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + if ( yy_act & YY_TRAILING_HEAD_MASK || + yy_looking_for_trail_begin ) + { + if ( yy_act == yy_looking_for_trail_begin ) + { + yy_looking_for_trail_begin = 0; + yy_act &= ~YY_TRAILING_HEAD_MASK; + break; + } + } + else if ( yy_act & YY_TRAILING_MASK ) + { + yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; + yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; + yy_full_match = yy_cp; + yy_full_state = yy_state_ptr; + yy_full_lp = yy_lp; + } + else + { + yy_full_match = yy_cp; + yy_full_state = yy_state_ptr; + yy_full_lp = yy_lp; + break; + } + ++yy_lp; + goto find_rule; + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER ) + { + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + ++yylineno; + } + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 151 "dt_lex.l" +return (DT_KEY_AUTO); + YY_BREAK +case 2: +YY_RULE_SETUP +#line 152 "dt_lex.l" +return (DT_KEY_BREAK); + YY_BREAK +case 3: +YY_RULE_SETUP +#line 153 "dt_lex.l" +return (DT_KEY_CASE); + YY_BREAK +case 4: +YY_RULE_SETUP +#line 154 "dt_lex.l" +return (DT_KEY_CHAR); + YY_BREAK +case 5: +YY_RULE_SETUP +#line 155 "dt_lex.l" +return (DT_KEY_CONST); + YY_BREAK +case 6: +YY_RULE_SETUP +#line 156 "dt_lex.l" +return (DT_KEY_CONTINUE); + YY_BREAK +case 7: +YY_RULE_SETUP +#line 157 "dt_lex.l" +return (DT_KEY_COUNTER); + YY_BREAK +case 8: +YY_RULE_SETUP +#line 158 "dt_lex.l" +return (DT_KEY_DEFAULT); + YY_BREAK +case 9: +YY_RULE_SETUP +#line 159 "dt_lex.l" +return (DT_KEY_DO); + YY_BREAK +case 10: +YY_RULE_SETUP +#line 160 "dt_lex.l" +return (DT_KEY_DOUBLE); + YY_BREAK +case 11: +YY_RULE_SETUP +#line 161 "dt_lex.l" +return (DT_KEY_ELSE); + YY_BREAK +case 12: +YY_RULE_SETUP +#line 162 "dt_lex.l" +return (DT_KEY_ENUM); + YY_BREAK +case 13: +YY_RULE_SETUP +#line 163 "dt_lex.l" +return (DT_KEY_EXTERN); + YY_BREAK +case 14: +YY_RULE_SETUP +#line 164 "dt_lex.l" +return (DT_KEY_FLOAT); + YY_BREAK +case 15: +YY_RULE_SETUP +#line 165 "dt_lex.l" +return (DT_KEY_FOR); + YY_BREAK +case 16: +YY_RULE_SETUP +#line 166 "dt_lex.l" +return (DT_KEY_GOTO); + YY_BREAK +case 17: +YY_RULE_SETUP +#line 167 "dt_lex.l" +return (DT_KEY_IF); + YY_BREAK +case 18: +YY_RULE_SETUP +#line 168 "dt_lex.l" +return (DT_KEY_IMPORT); + YY_BREAK +case 19: +YY_RULE_SETUP +#line 169 "dt_lex.l" +return (DT_KEY_INLINE); + YY_BREAK +case 20: +YY_RULE_SETUP +#line 170 "dt_lex.l" +return (DT_KEY_INT); + YY_BREAK +case 21: +YY_RULE_SETUP +#line 171 "dt_lex.l" +return (DT_KEY_LONG); + YY_BREAK +case 22: +YY_RULE_SETUP +#line 172 "dt_lex.l" +return (DT_TOK_OFFSETOF); + YY_BREAK +case 23: +YY_RULE_SETUP +#line 173 "dt_lex.l" +return (DT_KEY_PROBE); + YY_BREAK +case 24: +YY_RULE_SETUP +#line 174 "dt_lex.l" +return (DT_KEY_PROVIDER); + YY_BREAK +case 25: +YY_RULE_SETUP +#line 175 "dt_lex.l" +return (DT_KEY_REGISTER); + YY_BREAK +case 26: +YY_RULE_SETUP +#line 176 "dt_lex.l" +return (DT_KEY_RESTRICT); + YY_BREAK +case 27: +YY_RULE_SETUP +#line 177 "dt_lex.l" +return (DT_KEY_RETURN); + YY_BREAK +case 28: +YY_RULE_SETUP +#line 178 "dt_lex.l" +return (DT_KEY_SELF); + YY_BREAK +case 29: +YY_RULE_SETUP +#line 179 "dt_lex.l" +return (DT_KEY_SHORT); + YY_BREAK +case 30: +YY_RULE_SETUP +#line 180 "dt_lex.l" +return (DT_KEY_SIGNED); + YY_BREAK +case 31: +YY_RULE_SETUP +#line 181 "dt_lex.l" +return (DT_TOK_SIZEOF); + YY_BREAK +case 32: +YY_RULE_SETUP +#line 182 "dt_lex.l" +return (DT_KEY_STATIC); + YY_BREAK +case 33: +YY_RULE_SETUP +#line 183 "dt_lex.l" +return (DT_KEY_STRING); + YY_BREAK +case 34: +YY_RULE_SETUP +#line 184 "dt_lex.l" +return (DT_TOK_STRINGOF); + YY_BREAK +case 35: +YY_RULE_SETUP +#line 185 "dt_lex.l" +return (DT_KEY_STRUCT); + YY_BREAK +case 36: +YY_RULE_SETUP +#line 186 "dt_lex.l" +return (DT_KEY_SWITCH); + YY_BREAK +case 37: +YY_RULE_SETUP +#line 187 "dt_lex.l" +return (DT_KEY_THIS); + YY_BREAK +case 38: +YY_RULE_SETUP +#line 188 "dt_lex.l" +return (DT_KEY_XLATOR); + YY_BREAK +case 39: +YY_RULE_SETUP +#line 189 "dt_lex.l" +return (DT_KEY_TYPEDEF); + YY_BREAK +case 40: +YY_RULE_SETUP +#line 190 "dt_lex.l" +return (DT_KEY_UNION); + YY_BREAK +case 41: +YY_RULE_SETUP +#line 191 "dt_lex.l" +return (DT_KEY_UNSIGNED); + YY_BREAK +case 42: +YY_RULE_SETUP +#line 192 "dt_lex.l" +return (DT_KEY_VOID); + YY_BREAK +case 43: +YY_RULE_SETUP +#line 193 "dt_lex.l" +return (DT_KEY_VOLATILE); + YY_BREAK +case 44: +YY_RULE_SETUP +#line 194 "dt_lex.l" +return (DT_KEY_WHILE); + YY_BREAK +case 45: +YY_RULE_SETUP +#line 195 "dt_lex.l" +return (DT_TOK_XLATE); + YY_BREAK +case 46: +YY_RULE_SETUP +#line 197 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_AUTO); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 198 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_CHAR); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 199 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_CONST); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 200 "dt_lex.l" +{ yybegin(YYS_DEFINE); return (DT_KEY_COUNTER); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 201 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_DOUBLE); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 202 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_ENUM); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 203 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_EXTERN); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 204 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_FLOAT); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 205 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_IMPORT); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 206 "dt_lex.l" +{ yybegin(YYS_DEFINE); return (DT_KEY_INLINE); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 207 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_INT); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 208 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_LONG); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 209 "dt_lex.l" +{ yybegin(YYS_DEFINE); return (DT_KEY_PROVIDER); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 210 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_REGISTER); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 211 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_RESTRICT); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 212 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_SELF); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 213 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_SHORT); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 214 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_SIGNED); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 215 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_STATIC); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 216 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_STRING); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 217 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_STRUCT); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 218 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_THIS); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 219 "dt_lex.l" +{ yybegin(YYS_DEFINE); return (DT_KEY_XLATOR); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 220 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_TYPEDEF); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 221 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_UNION); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 222 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_UNSIGNED); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 223 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_VOID); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 224 "dt_lex.l" +{ yybegin(YYS_EXPR); return (DT_KEY_VOLATILE); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 226 "dt_lex.l" +{ + int i = atoi(yytext + 2); + char *v = ""; + + /* + * A macro argument reference substitutes the text of + * an argument in place of the current token. When we + * see $$ we fetch the saved string from pcb_sargv + * (or use the default argument if the option has been + * set and the argument hasn't been specified) and + * return a token corresponding to this string. + */ + if (i < 0 || (i >= yypcb->pcb_sargc && + !(yypcb->pcb_cflags & DTRACE_C_DEFARG))) { + xyerror(D_MACRO_UNDEF, "macro argument %s is " + "not defined\n", yytext); + } + + if (i < yypcb->pcb_sargc) { + v = yypcb->pcb_sargv[i]; /* get val from pcb */ + yypcb->pcb_sflagv[i] |= DT_IDFLG_REF; + } + + if ((yylval.l_str = strdup(v)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + (void) stresc2chr(yylval.l_str); + return (DT_TOK_STRING); + } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 256 "dt_lex.l" +{ + int i = atoi(yytext + 1); + char *p, *v = "0"; + + /* + * A macro argument reference substitutes the text of + * one identifier or integer pattern for another. When + * we see $ we fetch the saved string from pcb_sargv + * (or use the default argument if the option has been + * set and the argument hasn't been specified) and + * return a token corresponding to this string. + */ + if (i < 0 || (i >= yypcb->pcb_sargc && + !(yypcb->pcb_cflags & DTRACE_C_DEFARG))) { + xyerror(D_MACRO_UNDEF, "macro argument %s is " + "not defined\n", yytext); + } + + if (i < yypcb->pcb_sargc) { + v = yypcb->pcb_sargv[i]; /* get val from pcb */ + yypcb->pcb_sflagv[i] |= DT_IDFLG_REF; + } + + /* + * If the macro text is not a valid integer or ident, + * then we treat it as a string. The string may be + * optionally enclosed in quotes, which we strip. + */ + if (strbadidnum(v)) { + size_t len = strlen(v); + + if (len != 1 && *v == '"' && v[len - 1] == '"') + yylval.l_str = strndup(v + 1, len - 2); + else + yylval.l_str = strndup(v, len); + + if (yylval.l_str == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + (void) stresc2chr(yylval.l_str); + return (DT_TOK_STRING); + } + + /* + * If the macro text is not a string an begins with a + * digit or a +/- sign, process it as an integer token. + */ + if (isdigit(v[0]) || v[0] == '-' || v[0] == '+') { +#ifdef VBOX + int rc; +#endif + if (isdigit(v[0])) + yyintprefix = 0; + else + yyintprefix = *v++; + +#ifndef VBOX + errno = 0; + yylval.l_int = strtoull(v, &p, 0); + (void) strncpy(yyintsuffix, p, + sizeof (yyintsuffix)); +#else + rc = RTStrToUInt64Ex(v, &p, 0, &yylval.l_int); + RTStrCopy(yyintsuffix, sizeof(yyintsuffix), p); +#endif + yyintdecimal = *v != '0'; + +#ifndef VBOX + if (errno == ERANGE) +#else + if (rc == VWRN_NUMBER_TOO_BIG || rc == VWRN_NEGATIVE_UNSIGNED) +#endif + xyerror(D_MACRO_OFLOW, "macro argument" + " %s constant %s results in integer" + " overflow\n", yytext, v); + + return (DT_TOK_INT); + } + + return (id_or_type(v)); + } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 337 "dt_lex.l" +{ + dt_ident_t *idp = dt_idhash_lookup( + yypcb->pcb_hdl->dt_macros, yytext + 2); + + char s[16]; /* enough for UINT_MAX + \0 */ + + if (idp == NULL) { + xyerror(D_MACRO_UNDEF, "macro variable %s " + "is not defined\n", yytext); + } + + /* + * For the moment, all current macro variables are of + * type id_t (refer to dtrace_update() for details). + */ + (void) snprintf(s, sizeof (s), "%u", idp->di_id); + if ((yylval.l_str = strdup(s)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + return (DT_TOK_STRING); + } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 359 "dt_lex.l" +{ + dt_ident_t *idp = dt_idhash_lookup( + yypcb->pcb_hdl->dt_macros, yytext + 1); + + if (idp == NULL) { + xyerror(D_MACRO_UNDEF, "macro variable %s " + "is not defined\n", yytext); + } + + /* + * For the moment, all current macro variables are of + * type id_t (refer to dtrace_update() for details). + */ + yylval.l_int = (intmax_t)(int)idp->di_id; + yyintprefix = 0; + yyintsuffix[0] = '\0'; + yyintdecimal = 1; + + return (DT_TOK_INT); + } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 380 "dt_lex.l" +{ + return (id_or_type(yytext)); + } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 384 "dt_lex.l" +{ + if ((yylval.l_str = strdup(yytext)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + return (DT_TOK_AGG); + } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 390 "dt_lex.l" +{ + if ((yylval.l_str = strdup("@_")) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + return (DT_TOK_AGG); + } + YY_BREAK +case 81: +#line 397 "dt_lex.l" +case 82: +#line 398 "dt_lex.l" +case 83: +YY_RULE_SETUP +#line 398 "dt_lex.l" +{ + char *p; + +#ifndef VBOX + errno = 0; + yylval.l_int = strtoull(yytext, &p, 0); + (void) strncpy(yyintsuffix, p, sizeof (yyintsuffix)); +#else + int rc = RTStrToUInt64Ex(yytext, &p, 0, &yylval.l_int); + RTStrCopy(yyintsuffix, sizeof(yyintsuffix), p); +#endif + yyintprefix = 0; + yyintdecimal = yytext[0] != '0'; + +#ifndef VBOX + if (errno == ERANGE) +#else + if (rc == VWRN_NUMBER_TOO_BIG || rc == VWRN_NEGATIVE_UNSIGNED) +#endif + xyerror(D_INT_OFLOW, "constant %s results in " + "integer overflow\n", yytext); + + if (*p != '\0' && strchr("uUlL", *p) == NULL) { + xyerror(D_INT_DIGIT, "constant %s contains " + "invalid digit %c\n", yytext, *p); + } + + if ((YYSTATE) != S3) + return (DT_TOK_INT); + + yypragma = dt_node_link(yypragma, + dt_node_int(yylval.l_int)); + } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 431 "dt_lex.l" +yyerror("floating-point constants are not permitted\n"); + YY_BREAK +/* VBOX changed: +\"{RGX_STR}$ | +\"{RGX_STR}$ xyerror(D_STR_NL, "newline encountered in string literal"); + input: */ +case 85: +YY_RULE_SETUP +#line 437 "dt_lex.l" +xyerror(D_STR_NL, "newline encountered in string literal"); + YY_BREAK +case 86: +#line 440 "dt_lex.l" +case 87: +YY_RULE_SETUP +#line 440 "dt_lex.l" +{ + /* + * Quoted string -- convert C escape sequences and + * return the string as a token. + */ + yylval.l_str = strndup(yytext + 1, yyleng - 2); + + if (yylval.l_str == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + (void) stresc2chr(yylval.l_str); + if ((YYSTATE) != S3) + return (DT_TOK_STRING); + + yypragma = dt_node_link(yypragma, + dt_node_string(yylval.l_str)); + } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 458 "dt_lex.l" +xyerror(D_CHR_NL, "newline encountered in character constant"); + YY_BREAK +case 89: +YY_RULE_SETUP +#line 460 "dt_lex.l" +{ + char *s, *p, *q; + size_t nbytes; + + /* + * Character constant -- convert C escape sequences and + * return the character as an integer immediate value. + */ + if (yyleng == 2) + xyerror(D_CHR_NULL, "empty character constant"); + + s = yytext + 1; + yytext[yyleng - 1] = '\0'; + nbytes = stresc2chr(s); + yylval.l_int = 0; + yyintprefix = 0; + yyintsuffix[0] = '\0'; + yyintdecimal = 1; + + if (nbytes > sizeof (yylval.l_int)) { + xyerror(D_CHR_OFLOW, "character constant is " + "too long"); + } +#ifdef _LITTLE_ENDIAN + p = ((char *)&yylval.l_int) + nbytes - 1; + for (q = s; nbytes != 0; nbytes--) + *p-- = *q++; +#else + bcopy(s, ((char *)&yylval.l_int) + + sizeof (yylval.l_int) - nbytes, nbytes); +#endif + return (DT_TOK_INT); + } + YY_BREAK +case 90: +#line 495 "dt_lex.l" +case 91: +YY_RULE_SETUP +#line 495 "dt_lex.l" +{ + yypcb->pcb_cstate = (YYSTATE); + BEGIN(S1); + } + YY_BREAK +case 92: +#line 501 "dt_lex.l" +case 93: +YY_RULE_SETUP +#line 501 "dt_lex.l" +; /* discard any #! lines */ + YY_BREAK +case 94: +#line 504 "dt_lex.l" +case 95: +#line 505 "dt_lex.l" +case 96: +YY_RULE_SETUP +#line 505 "dt_lex.l" +{ + assert(yypragma == NULL); + yypcb->pcb_cstate = (YYSTATE); + BEGIN(S3); + } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 511 "dt_lex.l" +; /* discard */ + YY_BREAK +case 98: +YY_RULE_SETUP +#line 512 "dt_lex.l" +; /* discard */ + YY_BREAK +case 99: +YY_RULE_SETUP +#line 514 "dt_lex.l" +{ + int c, tok; + + /* + * The use of "/" as the predicate delimiter and as the + * integer division symbol requires special lookahead + * to avoid a shift/reduce conflict in the D grammar. + * We look ahead to the next non-whitespace character. + * If we encounter EOF, ";", "{", or "/", then this "/" + * closes the predicate and we return DT_TOK_EPRED. + * If we encounter anything else, it's DT_TOK_DIV. + */ + while ((c = input()) != 0) { + if (strchr("\f\n\r\t\v ", c) == NULL) + break; + } + + if (c == 0 || c == ';' || c == '{' || c == '/') { + if (yypcb->pcb_parens != 0) { + yyerror("closing ) expected in " + "predicate before /\n"); + } + if (yypcb->pcb_brackets != 0) { + yyerror("closing ] expected in " + "predicate before /\n"); + } + tok = DT_TOK_EPRED; + } else + tok = DT_TOK_DIV; + + if (c != EOF) unput(c); + return (tok); + } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 548 "dt_lex.l" +{ + yypcb->pcb_parens++; + return (DT_TOK_LPAR); + } + YY_BREAK +case 101: +YY_RULE_SETUP +#line 553 "dt_lex.l" +{ + if (--yypcb->pcb_parens < 0) + yyerror("extra ) in input stream\n"); + return (DT_TOK_RPAR); + } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 559 "dt_lex.l" +{ + yypcb->pcb_brackets++; + return (DT_TOK_LBRAC); + } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 564 "dt_lex.l" +{ + if (--yypcb->pcb_brackets < 0) + yyerror("extra ] in input stream\n"); + return (DT_TOK_RBRAC); + } + YY_BREAK +case 104: +#line 571 "dt_lex.l" +case 105: +YY_RULE_SETUP +#line 571 "dt_lex.l" +{ + yypcb->pcb_braces++; + return ('{'); + } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 576 "dt_lex.l" +{ + if (--yypcb->pcb_braces < 0) + yyerror("extra } in input stream\n"); + return ('}'); + } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 582 "dt_lex.l" +return (DT_TOK_BOR); + YY_BREAK +case 108: +YY_RULE_SETUP +#line 583 "dt_lex.l" +return (DT_TOK_XOR); + YY_BREAK +case 109: +YY_RULE_SETUP +#line 584 "dt_lex.l" +return (DT_TOK_BAND); + YY_BREAK +case 110: +YY_RULE_SETUP +#line 585 "dt_lex.l" +return (DT_TOK_LAND); + YY_BREAK +case 111: +YY_RULE_SETUP +#line 586 "dt_lex.l" +return (DT_TOK_LXOR); + YY_BREAK +case 112: +YY_RULE_SETUP +#line 587 "dt_lex.l" +return (DT_TOK_LOR); + YY_BREAK +case 113: +YY_RULE_SETUP +#line 588 "dt_lex.l" +return (DT_TOK_EQU); + YY_BREAK +case 114: +YY_RULE_SETUP +#line 589 "dt_lex.l" +return (DT_TOK_NEQ); + YY_BREAK +case 115: +YY_RULE_SETUP +#line 590 "dt_lex.l" +return (DT_TOK_LT); + YY_BREAK +case 116: +YY_RULE_SETUP +#line 591 "dt_lex.l" +return (DT_TOK_LE); + YY_BREAK +case 117: +YY_RULE_SETUP +#line 592 "dt_lex.l" +return (DT_TOK_GT); + YY_BREAK +case 118: +YY_RULE_SETUP +#line 593 "dt_lex.l" +return (DT_TOK_GE); + YY_BREAK +case 119: +YY_RULE_SETUP +#line 594 "dt_lex.l" +return (DT_TOK_LSH); + YY_BREAK +case 120: +YY_RULE_SETUP +#line 595 "dt_lex.l" +return (DT_TOK_RSH); + YY_BREAK +case 121: +YY_RULE_SETUP +#line 596 "dt_lex.l" +return (DT_TOK_ADD); + YY_BREAK +case 122: +YY_RULE_SETUP +#line 597 "dt_lex.l" +return (DT_TOK_SUB); + YY_BREAK +case 123: +YY_RULE_SETUP +#line 598 "dt_lex.l" +return (DT_TOK_MUL); + YY_BREAK +case 124: +YY_RULE_SETUP +#line 599 "dt_lex.l" +return (DT_TOK_MOD); + YY_BREAK +case 125: +YY_RULE_SETUP +#line 600 "dt_lex.l" +return (DT_TOK_BNEG); + YY_BREAK +case 126: +YY_RULE_SETUP +#line 601 "dt_lex.l" +return (DT_TOK_LNEG); + YY_BREAK +case 127: +YY_RULE_SETUP +#line 602 "dt_lex.l" +return (DT_TOK_QUESTION); + YY_BREAK +case 128: +YY_RULE_SETUP +#line 603 "dt_lex.l" +return (DT_TOK_COLON); + YY_BREAK +case 129: +YY_RULE_SETUP +#line 604 "dt_lex.l" +return (DT_TOK_DOT); + YY_BREAK +case 130: +YY_RULE_SETUP +#line 605 "dt_lex.l" +return (DT_TOK_PTR); + YY_BREAK +case 131: +YY_RULE_SETUP +#line 606 "dt_lex.l" +return (DT_TOK_ASGN); + YY_BREAK +case 132: +YY_RULE_SETUP +#line 607 "dt_lex.l" +return (DT_TOK_ADD_EQ); + YY_BREAK +case 133: +YY_RULE_SETUP +#line 608 "dt_lex.l" +return (DT_TOK_SUB_EQ); + YY_BREAK +case 134: +YY_RULE_SETUP +#line 609 "dt_lex.l" +return (DT_TOK_MUL_EQ); + YY_BREAK +case 135: +YY_RULE_SETUP +#line 610 "dt_lex.l" +return (DT_TOK_DIV_EQ); + YY_BREAK +case 136: +YY_RULE_SETUP +#line 611 "dt_lex.l" +return (DT_TOK_MOD_EQ); + YY_BREAK +case 137: +YY_RULE_SETUP +#line 612 "dt_lex.l" +return (DT_TOK_AND_EQ); + YY_BREAK +case 138: +YY_RULE_SETUP +#line 613 "dt_lex.l" +return (DT_TOK_XOR_EQ); + YY_BREAK +case 139: +YY_RULE_SETUP +#line 614 "dt_lex.l" +return (DT_TOK_OR_EQ); + YY_BREAK +case 140: +YY_RULE_SETUP +#line 615 "dt_lex.l" +return (DT_TOK_LSH_EQ); + YY_BREAK +case 141: +YY_RULE_SETUP +#line 616 "dt_lex.l" +return (DT_TOK_RSH_EQ); + YY_BREAK +case 142: +YY_RULE_SETUP +#line 617 "dt_lex.l" +return (DT_TOK_ADDADD); + YY_BREAK +case 143: +YY_RULE_SETUP +#line 618 "dt_lex.l" +return (DT_TOK_SUBSUB); + YY_BREAK +case 144: +YY_RULE_SETUP +#line 619 "dt_lex.l" +return (DT_TOK_ELLIPSIS); + YY_BREAK +case 145: +YY_RULE_SETUP +#line 620 "dt_lex.l" +return (DT_TOK_COMMA); + YY_BREAK +case 146: +YY_RULE_SETUP +#line 621 "dt_lex.l" +return (';'); + YY_BREAK +case 147: +YY_RULE_SETUP +#line 622 "dt_lex.l" +; /* discard */ + YY_BREAK +case 148: +YY_RULE_SETUP +#line 623 "dt_lex.l" +; /* discard */ + YY_BREAK +case 149: +YY_RULE_SETUP +#line 624 "dt_lex.l" +yyerror("syntax error near \"%c\"\n", yytext[0]); + YY_BREAK +case 150: +YY_RULE_SETUP +#line 626 "dt_lex.l" +yyerror("/* encountered inside a comment\n"); + YY_BREAK +case 151: +YY_RULE_SETUP +#line 627 "dt_lex.l" +BEGIN(yypcb->pcb_cstate); + YY_BREAK +/* VBOX - START */ +case YY_STATE_EOF(S1): +#line 629 "dt_lex.l" +yyerror("end-of-file encountered before matching */\n"); + YY_BREAK +/* VBOX - END */ +case 152: +YY_RULE_SETUP +#line 631 "dt_lex.l" +; /* discard */ + YY_BREAK +case 153: +YY_RULE_SETUP +#line 633 "dt_lex.l" +{ + /* + * S2 has an ambiguity because RGX_PSPEC includes '*' + * as a glob character and '*' also can be DT_TOK_STAR. + * Since lex always matches the longest token, this + * rule can be matched by an input string like "int*", + * which could begin a global variable declaration such + * as "int*x;" or could begin a RGX_PSPEC with globbing + * such as "int* { trace(timestamp); }". If C_PSPEC is + * not set, we must resolve the ambiguity in favor of + * the type and perform lexer pushback if the fragment + * before '*' or entire fragment matches a type name. + * If C_PSPEC is set, we always return a PSPEC token. + * If C_PSPEC is off, the user can avoid ambiguity by + * including a ':' delimiter in the specifier, which + * they should be doing anyway to specify the provider. + */ + if (!(yypcb->pcb_cflags & DTRACE_C_PSPEC) && + strchr(yytext, ':') == NULL) { + + char *p = strchr(yytext, '*'); + char *q = yytext + yyleng - 1; + + if (p != NULL && p > yytext) + *p = '\0'; /* prune yytext */ + + if (dt_type_lookup(yytext, NULL) == 0) { + yylval.l_str = strdup(yytext); + + if (yylval.l_str == NULL) { + longjmp(yypcb->pcb_jmpbuf, + EDT_NOMEM); + } + + if (p != NULL && p > yytext) { + for (*p = '*'; q >= p; q--) + unput(*q); + } + + yybegin(YYS_EXPR); + return (DT_TOK_TNAME); + } + + if (p != NULL && p > yytext) + *p = '*'; /* restore yytext */ + } + + if ((yylval.l_str = strdup(yytext)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + return (DT_TOK_PSPEC); + } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 686 "dt_lex.l" +return (DT_TOK_DIV); + YY_BREAK +case 155: +YY_RULE_SETUP +#line 687 "dt_lex.l" +return (DT_TOK_COMMA); + YY_BREAK +case 156: +YY_RULE_SETUP +#line 689 "dt_lex.l" +; /* discard */ + YY_BREAK +case 157: +YY_RULE_SETUP +#line 690 "dt_lex.l" +yyerror("syntax error near \"%c\"\n", yytext[0]); + YY_BREAK +case 158: +YY_RULE_SETUP +#line 692 "dt_lex.l" +{ + dt_pragma(yypragma); + yypragma = NULL; + BEGIN(yypcb->pcb_cstate); + } + YY_BREAK +case 159: +YY_RULE_SETUP +#line 698 "dt_lex.l" +; /* discard */ + YY_BREAK +case 160: +YY_RULE_SETUP +#line 700 "dt_lex.l" +{ + dt_node_t *dnp; + + if ((yylval.l_str = strdup(yytext)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + /* + * We want to call dt_node_ident() here, but we can't + * because it will expand inlined identifiers, which we + * don't want to do from #pragma context in order to + * support pragmas that apply to the ident itself. We + * call dt_node_string() and then reset dn_op instead. + */ + dnp = dt_node_string(yylval.l_str); + dnp->dn_kind = DT_NODE_IDENT; + dnp->dn_op = DT_TOK_IDENT; + yypragma = dt_node_link(yypragma, dnp); + } + YY_BREAK +/* VBOX - BEGIN */ +case YY_STATE_EOF(S3): +#line 720 "dt_lex.l" +yyerror("end-of-file encountered before end of control line\n"); + YY_BREAK +/* VBOX - END */ +case 161: +YY_RULE_SETUP +#line 722 "dt_lex.l" +yyerror("syntax error near \"%c\"\n", yytext[0]); + YY_BREAK +case 162: +YY_RULE_SETUP +#line 724 "dt_lex.l" +ECHO; + YY_BREAK +#line 2426 "dt_lex.c" + case YY_STATE_EOF(INITIAL): + case YY_STATE_EOF(S0): + case YY_STATE_EOF(S2): + case YY_STATE_EOF(S4): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 510 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 510 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 509); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + if ( c == '\n' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + yy_current_buffer->yy_at_bol = (c == '\n'); + if ( yy_current_buffer->yy_at_bol ) + ++yylineno; + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 724 "dt_lex.l" + + +/* + * yybegin provides a wrapper for use from C code around the lex BEGIN() macro. + * We use two main states for lexing because probe descriptions use a syntax + * that is incompatible with the normal D tokens (e.g. names can contain "-"). + * yybegin also handles the job of switching between two lists of dt_nodes + * as we allocate persistent definitions, like inlines, and transient nodes + * that will be freed once we are done parsing the current program file. + */ +void +yybegin(yystate_t state) +{ +#if YYDEBUG /* VBOX: ifdef YYDEBUG => if YYDEBUG */ + yydebug = _dtrace_debug; +#endif + if (yypcb->pcb_yystate == state) + return; /* nothing to do if we're in the state already */ + + if (yypcb->pcb_yystate == YYS_DEFINE) { + yypcb->pcb_list = yypcb->pcb_hold; + yypcb->pcb_hold = NULL; + } + + switch (state) { + case YYS_CLAUSE: + BEGIN(S2); + break; + case YYS_DEFINE: + assert(yypcb->pcb_hold == NULL); + yypcb->pcb_hold = yypcb->pcb_list; + yypcb->pcb_list = NULL; + /*FALLTHRU*/ + case YYS_EXPR: + BEGIN(S0); + break; + case YYS_DONE: + break; + case YYS_CONTROL: + BEGIN(S4); + break; + default: + xyerror(D_UNKNOWN, "internal error -- bad yystate %d\n", state); + } + + yypcb->pcb_yystate = state; +} + +void +yyinit(dt_pcb_t *pcb) +{ + yypcb = pcb; + yylineno = 1; + yypragma = NULL; +#ifndef USING_FLEX + yysptr = yysbuf; +#else + yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); +#endif +} + +/* + * Given a lexeme 's' (typically yytext), set yylval and return an appropriate + * token to the parser indicating either an identifier or a typedef name. + * User-defined global variables always take precedence over types, but we do + * use some heuristics because D programs can look at an ever-changing set of + * kernel types and also can implicitly instantiate variables by assignment, + * unlike in C. The code here is ordered carefully as lookups are not cheap. + */ +static int +id_or_type(const char *s) +{ + dtrace_hdl_t *dtp = yypcb->pcb_hdl; + dt_decl_t *ddp = yypcb->pcb_dstack.ds_decl; + int c0, c1, ttok = DT_TOK_TNAME; + dt_ident_t *idp; + + if ((s = yylval.l_str = strdup(s)) == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + + /* + * If the lexeme is a global variable or likely identifier or *not* a + * type_name, then it is an identifier token. + */ + if (dt_idstack_lookup(&yypcb->pcb_globals, s) != NULL || + dt_idhash_lookup(yypcb->pcb_idents, s) != NULL || + dt_type_lookup(s, NULL) != 0) + return (DT_TOK_IDENT); + + /* + * If we're in the midst of parsing a declaration and a type_specifier + * has already been shifted, then return DT_TOK_IDENT instead of TNAME. + * This semantic is necessary to permit valid ISO C code such as: + * + * typedef int foo; + * struct s { foo foo; }; + * + * without causing shift/reduce conflicts in the direct_declarator part + * of the grammar. The result is that we must check for conflicting + * redeclarations of the same identifier as part of dt_node_decl(). + */ + if (ddp != NULL && ddp->dd_name != NULL) + return (DT_TOK_IDENT); + + /* + * If the lexeme is a type name and we are not in a program clause, + * then always interpret it as a type and return DT_TOK_TNAME. + */ + if ((YYSTATE) != S0) + return (DT_TOK_TNAME); + + /* + * If the lexeme matches a type name but is in a program clause, then + * it could be a type or it could be an undefined variable. Peek at + * the next token to decide. If we see ++, --, [, or =, we know there + * might be an assignment that is trying to create a global variable, + * so we optimistically return DT_TOK_IDENT. There is no harm in being + * wrong: a type_name followed by ++, --, [, or = is a syntax error. + */ + while ((c0 = input()) != 0) { + if (strchr("\f\n\r\t\v ", c0) == NULL) + break; + } + + switch (c0) { + case '+': + case '-': + if ((c1 = input()) == c0) + ttok = DT_TOK_IDENT; + if (c1 != EOF) unput(c1); + break; + + case '=': + if ((c1 = input()) != c0) + ttok = DT_TOK_IDENT; + if (c1 != EOF) unput(c1); + break; + case '[': + ttok = DT_TOK_IDENT; + break; + } + + if (ttok == DT_TOK_IDENT) { + idp = dt_idhash_insert(yypcb->pcb_idents, s, DT_IDENT_SCALAR, 0, + 0, _dtrace_defattr, 0, &dt_idops_thaw, NULL, dtp->dt_gen); + + if (idp == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + } + + if (c0 != EOF) unput(c0); + return (ttok); +} + +#ifndef USING_FLEX + +static int +input(void) +{ + int c; + + if (yysptr > yysbuf) + c = *--yysptr; + else if (yypcb->pcb_fileptr != NULL) + c = fgetc(yypcb->pcb_fileptr); + else if (yypcb->pcb_strptr < yypcb->pcb_string + yypcb->pcb_strlen) + c = *(unsigned char *)(yypcb->pcb_strptr++); + else + c = EOF; + + if (c == '\n') + yylineno++; + + if (c != EOF) + return (c); + + if ((YYSTATE) == S1) + yyerror("end-of-file encountered before matching */\n"); + + if ((YYSTATE) == S3) + yyerror("end-of-file encountered before end of control line\n"); + + if (yypcb->pcb_fileptr != NULL && ferror(yypcb->pcb_fileptr)) + longjmp(yypcb->pcb_jmpbuf, EDT_FIO); + + return (0); /* EOF */ +} + +static void +unput(int c) +{ + if (c == '\n') + yylineno--; + + *yysptr++ = c; + yytchar = c; +} + +#endif /* USING_FLEX */ diff --git a/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceLibCWrappers.h b/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceLibCWrappers.h new file mode 100644 index 00000000..b2345519 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceLibCWrappers.h @@ -0,0 +1,101 @@ +/* $Id: VBoxDTraceLibCWrappers.h $ */ +/** @file + * VBoxDTraceTLibCWrappers.h - IPRT wrappers/fake for lib C stuff. + * + * Contributed by: bird + */ + +/* + * Copyright (C) 2012-2023 Oracle and/or its affiliates. + * + * This file is part of VirtualBox base platform packages, as + * available from http://www.virtualbox.org. + * + * The contents of this file are subject to the terms of the Common + * Development and Distribution License Version 1.0 (CDDL) only, as it + * comes in the "COPYING.CDDL" file of the VirtualBox distribution. + * + * SPDX-License-Identifier: CDDL-1.0 + */ + +#ifndef VBOX_INCLUDED_SRC_VBoxDTrace_include_VBoxDTraceLibCWrappers_h +#define VBOX_INCLUDED_SRC_VBoxDTrace_include_VBoxDTraceLibCWrappers_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#include +#include +#include +#ifdef RT_OS_WINDOWS +# include +#else +# include +# include /* Workaround for syslimit.h bug in gcc 4.8.3 on gentoo. */ +# ifdef RT_OS_DARWIN +# include /* PATH_MAX */ +# elif !defined(RT_OS_SOLARIS) && !defined(RT_OS_FREEBSD) +# include /* PATH_MAX */ +# endif +# include /* basename */ +# include +# include /* bzero & bcopy.*/ +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + + +#undef gethrtime +#define gethrtime() RTTimeNanoTS() +#undef strcasecmp +#define strcasecmp(a_psz1, a_psz2) RTStrICmp(a_psz1, a_psz2) +#undef strncasecmp +#define strncasecmp(a_psz1, a_psz2, a_cch) RTStrNICmp(a_psz1, a_psz2, a_cch) +#undef strlcpy +#define strlcpy(a_pszDst, a_pszSrc, a_cbDst) ((void)RTStrCopy(a_pszDst, a_cbDst, a_pszSrc)) + +#undef assert +#define assert(expr) Assert(expr) + +#undef PATH_MAX +#define PATH_MAX RTPATH_MAX + +#undef getpid +#define getpid RTProcSelf + +#undef basename +#define basename(a_pszPath) RTPathFilename(a_pszPath) + +#undef malloc +#define malloc(a_cb) RTMemAlloc(a_cb) +#undef calloc +#define calloc(a_cItems, a_cb) RTMemAllocZ((size_t)(a_cb) * (a_cItems)) +#undef realloc +#define realloc(a_pvOld, a_cbNew) RTMemRealloc(a_pvOld, a_cbNew) +#undef free +#define free(a_pv) RTMemFree(a_pv) + +/* Not using RTStrDup and RTStrNDup here because the allocation won't be freed + by RTStrFree and thus may cause trouble when using the efence. */ +#undef strdup +#define strdup(a_psz) ((char *)RTMemDup(a_psz, strlen(a_psz) + 1)) +#undef strndup +#define strndup(a_psz, a_cchMax) ((char *)RTMemDupEx(a_psz, RTStrNLen(a_psz, a_cchMax), 1)) + +/* For various stupid reasons, these are duplicated in VBoxDTraceTypes.h. */ +#undef bcopy +#define bcopy(a_pSrc, a_pDst, a_cb) ((void)memmove(a_pDst, a_pSrc, a_cb)) +#undef bzero +#define bzero(a_pDst, a_cb) ((void)memset(a_pDst, 0, a_cb)) +#undef bcmp +#define bcmp(a_p1, a_p2, a_cb) (memcmp(a_p1, a_p2, a_cb)) + +#endif /* !VBOX_INCLUDED_SRC_VBoxDTrace_include_VBoxDTraceLibCWrappers_h */ + diff --git a/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h b/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h new file mode 100644 index 00000000..691ddc2f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h @@ -0,0 +1,472 @@ + +/* $Id: VBoxDTraceTypes.h $ */ +/** @file + * VBoxDTraceTypes.h - Fake a bunch of Solaris types. + * + * Contributed by: bird + */ + +/* + * Copyright (C) 2012-2023 Oracle and/or its affiliates. + * + * This file is part of VirtualBox base platform packages, as + * available from http://www.virtualbox.org. + * + * The contents of this file are subject to the terms of the Common + * Development and Distribution License Version 1.0 (CDDL) only, as it + * comes in the "COPYING.CDDL" file of the VirtualBox distribution. + * + * SPDX-License-Identifier: CDDL-1.0 + */ + +#ifndef VBOX_INCLUDED_SRC_VBoxDTrace_include_VBoxDTraceTypes_h +#define VBOX_INCLUDED_SRC_VBoxDTrace_include_VBoxDTraceTypes_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#include +#include +#include +#include +#include +#ifdef IN_RING0 +# include +#endif +#ifdef IN_RING3 +# include +# include +# ifdef RT_OS_LINUX +# include /* avoid greg_t trouble */ +# endif +# if defined(_MSC_VER) +# include +# endif +#endif + +RT_C_DECLS_BEGIN + +struct modctl; + +typedef unsigned char uchar_t; +typedef unsigned short ushort_t; +typedef unsigned int uint_t; +typedef uintptr_t ulong_t; +#ifndef RT_OS_SOLARIS +typedef int64_t longlong_t; +typedef uint64_t u_longlong_t; +typedef uint64_t hrtime_t; +# ifndef RT_OS_FREEBSD +typedef uint32_t id_t; +# endif +typedef uint32_t zoneid_t; +#endif +#if (!defined(__NGREG) && !defined(NGREG)) || !defined(RT_OS_LINUX) +typedef RTCCINTREG greg_t; +#else +AssertCompileSize(greg_t, sizeof(RTCCINTREG)); +#endif +typedef uintptr_t pc_t; +typedef unsigned int model_t; +typedef RTCPUID processorid_t; +#if defined(_MSC_VER) || defined(IN_RING0) +typedef RTUID uid_t; +typedef RTPROCESS pid_t; +#endif +#if defined(_MSC_VER) || defined(IN_RING0) || defined(RT_OS_LINUX) +typedef char *caddr_t; +#endif + +#if !defined(NANOSEC) || !defined(RT_OS_SOLARIS) +# define NANOSEC RT_NS_1SEC +#endif +#if !defined(MICROSEC) || !defined(RT_OS_SOLARIS) +# define MICROSEC RT_US_1SEC +#endif +#if !defined(MILLISEC) || !defined(RT_OS_SOLARIS) +# define MILLISEC RT_MS_1SEC +#endif +#if !defined(SEC) || !defined(RT_OS_SOLARIS) +# define SEC (1) +#endif +#define MAXPATHLEN RTPATH_MAX +#undef PATH_MAX +#define PATH_MAX RTPATH_MAX +#undef NBBY +#define NBBY (8) +#define NCPU RTCPUSET_MAX_CPUS +#define B_FALSE (0) +#define B_TRUE (1) +#define MIN(a1, a2) RT_MIN(a1, a2) +#define MAX(a1, a2) RT_MAX(a1, a2) +#define ABS(a_iValue) RT_ABS(a_iValue) +#define IS_P2ALIGNED(uWhat, uAlign) ( !((uWhat) & ((uAlign) - 1)) ) +#define P2ROUNDUP(uWhat, uAlign) ( ((uWhat) + (uAlign) - 1) & ~(uAlign - 1) ) +#define roundup(uWhat, uUnit) ( ( (uWhat) + ((uUnit) - 1)) / (uUnit) * (uUnit) ) + +#if defined(RT_ARCH_X86) +# ifndef __i386 +# define __i386 1 +# endif +# ifndef __x86 +# define __x86 1 +# endif +# ifndef _IPL32 +# define _IPL32 1 +# endif +# if !defined(_LITTLE_ENDIAN) || (!defined(RT_OS_SOLARIS) && !defined(RT_OS_FREEBSD)) +# define _LITTLE_ENDIAN 1 +# endif + +#elif defined(RT_ARCH_AMD64) +# ifndef __x86_64 +# define __x86_64 1 +# endif +# ifndef __x86 +# define __x86 1 +# endif +# ifndef _LP64 +# define _LP64 1 +# endif +# if !defined(_LITTLE_ENDIAN) || (!defined(RT_OS_SOLARIS) && !defined(RT_OS_FREEBSD)) +# define _LITTLE_ENDIAN 1 +# endif + +#else +# error "unsupported arch!" +#endif + +/** Mark a cast added when porting the code to VBox. + * Avoids lots of \#ifdef VBOX otherwise needed to mark up the changes. */ +#define VBDTCAST(a_Type) (a_Type) +/** Mark a type change made when porting the code to VBox. + * This is usually signed -> unsigned type changes that avoids a whole lot of + * comparsion warnings. */ +#define VBDTTYPE(a_VBox, a_Org) a_VBox +/** Mark missing void in a parameter list. */ +#define VBDTVOID void +/** Mark missing static in a function definition. */ +#define VBDTSTATIC static +#define VBDTUNASS(a_Value) = a_Value +#define VBDTGCC(a_Value) = a_Value +#define VBDTMSC(a_Value) = a_Value + +/* + * string + */ +#ifdef IN_RING0 +# undef bcopy +# define bcopy(a_pSrc, a_pDst, a_cb) ((void)memmove(a_pDst, a_pSrc, a_cb)) +# undef bzero +# define bzero(a_pDst, a_cb) ((void)memset(a_pDst, 0, a_cb)) +# undef bcmp +# define bcmp(a_p1, a_p2, a_cb) (memcmp(a_p1, a_p2, a_cb)) +#endif +#if defined(_MSC_VER) || defined(IN_RING0) +# define snprintf (int)RTStrPrintf /** @todo wrong return value */ +# define vsnprintf (int)RTStrPrintfV /** @todo wrong return value */ +#endif + +/* + * Bitmap stuff. + */ +#define BT_SIZEOFMAP(a_cBits) ( (a_cBits + 63) / 8 ) +#define BT_SET(a_aulBitmap, iBit) ASMBitSet(a_aulBitmap, iBit) +#define BT_CLEAR(a_aulBitmap, iBit) ASMBitClear(a_aulBitmap, iBit) +#define BT_TEST(a_aulBitmap, iBit) ASMBitTest(a_aulBitmap, iBit) +#if ARCH_BITS == 32 +# define BT_NBIPUL 32 +# define BT_ULSHIFT 5 /* log2(32) = 5 */ +# define BT_ULMASK 0x1f +# define BT_BITOUL(a_cBits) ( ((a_cBits) + 31) / 32 ) +#elif ARCH_BITS == 64 +# define BT_NBIPUL 64 +# define BT_ULSHIFT 6 /* log2(32) = 6 */ +# define BT_ULMASK 0x3f +# define BT_BITOUL(a_cBits) ( ((a_cBits) + 63) / 64 ) +#else +# error Bad ARCH_BITS... +#endif + + +#ifdef IN_RING0 + +/* + * Kernel stuff... + */ +#define CPU_ON_INTR(a_pCpu) (false) + +#define KERNELBASE VBoxDtGetKernelBase() +uintptr_t VBoxDtGetKernelBase(void); + + +typedef struct VBoxDtCred +{ + int32_t cr_refs; + RTUID cr_uid; + RTUID cr_ruid; + RTUID cr_suid; + RTGID cr_gid; + RTGID cr_rgid; + RTGID cr_sgid; + zoneid_t cr_zone; +} cred_t; +#define PRIV_POLICY_ONLY(a_pCred, a_uPriv, a_fAll) (true) +#define priv_isequalset(a, b) (true) +#define crgetuid(a_pCred) ((a_pCred)->cr_uid) +#define crgetzoneid(a_pCred) ((a_pCred)->cr_zone) +#define crhold VBoxDtCredHold +#define crfree VBoxDtCredFree +void VBoxDtCredHold(struct VBoxDtCred *pCred); +void VBoxDtCredFree(struct VBoxDtCred *pCred); + + +typedef struct RTTIMER *cyclic_id_t; +#define CYCLIC_NONE ((struct RTTIMER *)NULL) +#define cyclic_remove(a_hTimer) RTTimerDestroy(a_hTimer) + +typedef struct VBoxDtThread +{ + /** The next thread with the same hash table entry. + * Or the next free thread. */ + struct VBoxDtThread *pNext; + /** Age list node. */ + RTLISTNODE AgeEntry; + /** The native thread handle. */ + RTNATIVETHREAD hNative; + /** The process ID. */ + RTPROCESS uPid; + + uint32_t t_predcache; + uintptr_t t_dtrace_scrpc; + uintptr_t t_dtrace_astpc; + hrtime_t t_dtrace_vtime; + hrtime_t t_dtrace_start; + uint8_t t_dtrace_stop; +} kthread_t; +struct VBoxDtThread *VBoxDtGetCurrentThread(void); +#define curthread (VBoxDtGetCurrentThread()) + + +typedef struct VBoxDtProcess proc_t; +# if 0 /* not needed ? */ +struct VBoxDtProcess proc_t; +{ +/* uint32_t p_flag; - don't bother with this */ + RTPROCESS p_pid; + struct dtrace_helpers *p_dtrace_helpers; +} +proc_t *VBoxDtGetCurrentProc(void); +# define curproc (VBoxDtGetCurrentProc()) +/*# define SNOCD RT_BIT(0) - don't bother with this */ +# endif + +typedef struct VBoxDtTaskQueue taskq_t; + +typedef struct VBoxDtMutex +{ + RTSEMMUTEX hMtx; + RTNATIVETHREAD volatile hOwner; +} kmutex_t; +#define mutex_enter VBoxDtMutexEnter +#define mutex_exit VBoxDtMutexExit +#define MUTEX_HELD(a_pMtx) VBoxDtMutexIsOwner(a_pMtx) +#define MUTEX_NOT_HELD(a_pMtx) (!VBoxDtMutexIsOwner(a_pMtx)) +#define mod_lock g_DummyMtx +#define cpu_lock g_DummyMtx +int VBoxDtMutexInit(struct VBoxDtMutex *pMtx); +void VBoxDtMutexDelete(struct VBoxDtMutex *pMtx); +void VBoxDtMutexEnter(struct VBoxDtMutex *pMtx); +void VBoxDtMutexExit(struct VBoxDtMutex *pMtx); +bool VBoxDtMutexIsOwner(struct VBoxDtMutex *pMtx); +extern struct VBoxDtMutex g_DummyMtx; + + +typedef struct VBoxDtCpuCore +{ + RTCPUID cpu_id; + uintptr_t cpuc_dtrace_illval; + uint16_t volatile cpuc_dtrace_flags; + +} cpucore_t; + +#define CPU_DTRACE_BADADDR RT_BIT(0) +#define CPU_DTRACE_BADALIGN RT_BIT(1) +#define CPU_DTRACE_BADSTACK RT_BIT(2) +#define CPU_DTRACE_KPRIV RT_BIT(3) +#define CPU_DTRACE_DIVZERO RT_BIT(4) +#define CPU_DTRACE_ILLOP RT_BIT(5) +#define CPU_DTRACE_NOSCRATCH RT_BIT(6) +#define CPU_DTRACE_UPRIV RT_BIT(7) +#define CPU_DTRACE_TUPOFLOW RT_BIT(8) +#define CPU_DTRACE_ENTRY RT_BIT(9) +#define CPU_DTRACE_FAULT UINT16_C(0x03ff) +#define CPU_DTRACE_DROP RT_BIT(12) +#define CPU_DTRACE_ERROR UINT16_C(0x13ff) +#define CPU_DTRACE_NOFAULT RT_BIT(15) + +extern cpucore_t g_aVBoxDtCpuCores[RTCPUSET_MAX_CPUS]; +#define cpu_core (g_aVBoxDtCpuCores) + +struct VBoxDtCred *VBoxDtGetCurrentCreds(void); +#define CRED() VBoxDtGetCurrentCreds() + +proc_t *VBoxDtThreadToProc(kthread_t *); + + +#define ASSERT(a_Expr) Assert(a_Expr) +#define panic VBoxDtPanic +void VBoxDtPanic(const char *pszFormat, ...); +#define cmn_err VBoxDtCmnErr +void VBoxDtCmnErr(int iLevel, const char *pszFormat, ...); +#define CE_WARN 10 +#define CE_NOTE 11 +#define uprintf VBoxDtUPrintf +#define vuprintf VBoxDtUPrintfV +void VBoxDtUPrintf(const char *pszFormat, ...); +void VBoxDtUPrintfV(const char *pszFormat, va_list va); + +/* + * Memory allocation wrappers. + */ +#define KM_SLEEP RT_BIT(0) +#define KM_NOSLEEP RT_BIT(1) +#define kmem_alloc VBoxDtKMemAlloc +#define kmem_zalloc VBoxDtKMemAllocZ +#define kmem_free VBoxDtKMemFree +void *VBoxDtKMemAlloc(size_t cbMem, uint32_t fFlags); +void *VBoxDtKMemAllocZ(size_t cbMem, uint32_t fFlags); +void VBoxDtKMemFree(void *pvMem, size_t cbMem); + + +typedef struct VBoxDtMemCache kmem_cache_t; +#define kmem_cache_create VBoxDtKMemCacheCreate +#define kmem_cache_destroy VBoxDtKMemCacheDestroy +#define kmem_cache_alloc VBoxDtKMemCacheAlloc +#define kmem_cache_free VBoxDtKMemCacheFree +struct VBoxDtMemCache *VBoxDtKMemCacheCreate(const char *pszName, size_t cbBuf, size_t cbAlign, + PFNRT pfnCtor, PFNRT pfnDtor, PFNRT pfnReclaim, + void *pvUser, void *pvVM, uint32_t fFlags); +void VBoxDtKMemCacheDestroy(struct VBoxDtMemCache *pCache); +void *VBoxDtKMemCacheAlloc(struct VBoxDtMemCache *pCache, uint32_t fFlags); +void VBoxDtKMemCacheFree(struct VBoxDtMemCache *pCache, void *pvMem); + + +typedef struct VBoxDtVMem vmem_t; +#define VM_SLEEP RT_BIT(0) +#define VM_BESTFIT RT_BIT(1) +#define VMC_IDENTIFIER RT_BIT(16) +#define vmem_create VBoxDtVMemCreate +#define vmem_destroy VBoxDtVMemDestroy +#define vmem_alloc VBoxDtVMemAlloc +#define vmem_free VBoxDtVMemFree +struct VBoxDtVMem *VBoxDtVMemCreate(const char *pszName, void *pvBase, size_t cb, size_t cbUnit, + PFNRT pfnAlloc, PFNRT pfnFree, struct VBoxDtVMem *pSrc, + size_t cbQCacheMax, uint32_t fFlags); +void VBoxDtVMemDestroy(struct VBoxDtVMem *pVMemArena); +void *VBoxDtVMemAlloc(struct VBoxDtVMem *pVMemArena, size_t cbMem, uint32_t fFlags); +void VBoxDtVMemFree(struct VBoxDtVMem *pVMemArena, void *pvMem, size_t cbMem); + +/* + * Copy In/Out + */ +#define copyin VBoxDtCopyIn +#define copyout VBoxDtCopyOut +int VBoxDtCopyIn(void const *pvUser, void *pvDst, size_t cb); +int VBoxDtCopyOut(void const *pvSrc, void *pvUser, size_t cb); + +/* + * Device numbers. + */ +typedef uint64_t dev_t; +typedef uint32_t major_t; +typedef uint32_t minor_t; +#define makedevice(a_Maj, a_Min) RT_MAKE_U64(a_Min, a_Maj) +#define getemajor(a_Dev) RT_HIDWORD(a_Dev) +#define geteminor(a_Dev) RT_LODWORD(a_Dev) +#define getminor(a_Dev) RT_LODWORD(a_Dev) + +/* + * DDI + */ +# define DDI_SUCCESS (0) +# define DDI_FAILURE (-1) +# if 0 /* not needed */ +# define ddi_soft_state_init VBoxDtDdiSoftStateInit +# define ddi_soft_state_fini VBoxDtDdiSoftStateTerm +# define ddi_soft_state_zalloc VBoxDtDdiSoftStateAllocZ +# define ddi_get_soft_state VBoxDtDdiSoftStateGet +# define ddi_soft_state_free VBoxDtDdiSoftStateFree +int VBoxDtDdiSoftStateInit(void **ppvSoftStates, size_t cbSoftState, uint32_t cMaxItems); +int VBoxDtDdiSoftStateTerm(void **ppvSoftStates); +int VBoxDtDdiSoftStateAllocZ(void *pvSoftStates, RTDEV uMinor); +int VBoxDtDdiSoftStateFree(void *pvSoftStates, RTDEV uMinor); +void *VBoxDtDdiSoftStateGet(void *pvSoftStates, RTDEV uMinor); + +typedef enum { DDI_ATT_CMD_DUMMY } ddi_attach_cmd_t; +typedef enum { DDI_DETACH, DDI_SUSPEND } ddi_detach_cmd_t; +typedef struct VBoxDtDevInfo dev_info_t; +# define ddi_driver_major VBoxDtDdiDriverMajor +# define ddi_report_dev VBoxDtDdiReportDev +major_t VBoxDtDdiDriverMajor(struct VBoxDtDevInfo *pDevInfo); +void VBoxDtDdiReportDev(struct VBoxDtDevInfo *pDevInfo); +# endif + +/* + * DTrace bits we've made external. + */ +extern int dtrace_attach(void); +extern int dtrace_detach(void); +struct dtrace_state; +extern int dtrace_open(struct dtrace_state **ppState, struct VBoxDtCred *cred_p); +extern int dtrace_ioctl(struct dtrace_state *state, int cmd, intptr_t arg, int32_t *rv); +extern int dtrace_close(struct dtrace_state *state); + +#endif /* IN_RING0 */ + + +#ifdef IN_RING3 +/* + * Make life a little easier in ring-3. + */ + +/* Replacement for strndup(), requires editing the code unfortunately. */ +# define MY_STRDUPA(a_pszRes, a_pszSrc) \ + do { \ + size_t cb = strlen(a_pszSrc) + 1; \ + (a_pszRes) = (char *)alloca(cb); \ + memcpy(a_pszRes, a_pszSrc, cb); \ + } while (0) + +/* + * gelf + */ +# include +typedef Elf64_Half GElf_Half; +typedef Elf64_Xword GElf_Xword; +typedef Elf64_Shdr GElf_Shdr; +typedef Elf64_Ehdr GElf_Ehdr; +typedef Elf64_Sym GElf_Sym; +typedef Elf64_Addr GElf_Addr; +#define GELF_ST_INFO ELF64_ST_INFO +#define GELF_ST_TYPE ELF64_ST_TYPE +#define GELF_ST_BIND ELF64_ST_BIND + +/* + * MSC stuff. + */ +# ifdef _MSC_VER +# ifndef SIZE_MAX +# if ARCH_BITS == 32 +# define SIZE_MAX UINT32_MAX +# else +# define SIZE_MAX UINT64_MAX +# endif +# endif +# endif /* _MSC_VER */ + +#endif /* IN_RING3 */ + +RT_C_DECLS_END +#endif /* !VBOX_INCLUDED_SRC_VBoxDTrace_include_VBoxDTraceTypes_h */ + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/COPYING b/src/VBox/ExtPacks/VBoxDTrace/onnv/COPYING new file mode 100644 index 00000000..eaceed4c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/COPYING @@ -0,0 +1,378 @@ +The ExtPacks/VBoxDTrace/onnv sources are licensed under the Common Development +and Distribution License, Version 1.0 (CDDL), as shown below. + +--- + + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0 + +1. Definitions. + + 1.1. "Contributor" means each individual or entity that creates + or contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Software, prior Modifications used by a Contributor (if any), + and the Modifications made by that particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or (b) + Modifications, or (c) the combination of files containing + Original Software with files containing Modifications, in + each case including portions thereof. + + 1.4. "Executable" means the Covered Software in any form other + than Source Code. + + 1.5. "Initial Developer" means the individual or entity that first + makes Original Software available under this License. + + 1.6. "Larger Work" means a work which combines Covered Software or + portions thereof with code not governed by the terms of this + License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed + herein. + + 1.9. "Modifications" means the Source Code and Executable form of + any of the following: + + A. Any file that results from an addition to, deletion from or + modification of the contents of a file containing Original + Software or previous Modifications; + + B. Any new file that contains any part of the Original + Software or previous Modifications; or + + C. Any new file that is contributed or otherwise made + available under the terms of this License. + + 1.10. "Original Software" means the Source Code and Executable + form of computer software code that is originally released + under this License. + + 1.11. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, + process, and apparatus claims, in any patent Licensable by + grantor. + + 1.12. "Source Code" means (a) the common form of computer software + code in which modifications are made and (b) associated + documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms + of, this License. For legal entities, "You" includes any + entity which controls, is controlled by, or is under common + control with You. For purposes of this definition, + "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by + contract or otherwise, or (b) ownership of more than fifty + percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, the Initial + Developer hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer, to use, + reproduce, modify, display, perform, sublicense and + distribute the Original Software (or portions thereof), + with or without Modifications, and/or as part of a Larger + Work; and + + (b) under Patent Claims infringed by the making, using or + selling of Original Software, to make, have made, use, + practice, sell, and offer for sale, and/or otherwise + dispose of the Original Software (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are + effective on the date Initial Developer first distributes + or otherwise makes the Original Software available to a + third party under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: (1) for code that You delete from the Original + Software, or (2) for infringements caused by: (i) the + modification of the Original Software, or (ii) the + combination of the Original Software with other software + or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and + subject to third party intellectual property claims, each + Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor to use, reproduce, + modify, display, perform, sublicense and distribute the + Modifications created by such Contributor (or portions + thereof), either on an unmodified basis, with other + Modifications, as Covered Software and/or as part of a + Larger Work; and + + (b) under Patent Claims infringed by the making, using, or + selling of Modifications made by that Contributor either + alone and/or in combination with its Contributor Version + (or portions of such combination), to make, use, sell, + offer for sale, have made, and/or otherwise dispose of: + (1) Modifications made by that Contributor (or portions + thereof); and (2) the combination of Modifications made by + that Contributor with its Contributor Version (or portions + of such combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are + effective on the date Contributor first distributes or + otherwise makes the Modifications available to a third + party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: (1) for any code that Contributor has deleted + from the Contributor Version; (2) for infringements caused + by: (i) third party modifications of Contributor Version, + or (ii) the combination of Modifications made by that + Contributor with other software (except as part of the + Contributor Version) or other devices; or (3) under Patent + Claims infringed by Covered Software in the absence of + Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make + available in Executable form must also be made available in Source + Code form and that Source Code form must be distributed only under + the terms of this License. You must include a copy of this + License with every copy of the Source Code form of the Covered + Software You distribute or otherwise make available. You must + inform recipients of any such Covered Software in Executable form + as to how they can obtain such Covered Software in Source Code + form in a reasonable manner on or through a medium customarily + used for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You contribute are + governed by the terms of this License. You represent that You + believe Your Modifications are Your original creation(s) and/or + You have sufficient rights to grant the rights conveyed by this + License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications that + identifies You as the Contributor of the Modification. You may + not remove or alter any copyright, patent or trademark notices + contained within the Covered Software, or any notices of licensing + or any descriptive text giving attribution to any Contributor or + the Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered Software in + Source Code form that alters or restricts the applicable version + of this License or the recipients' rights hereunder. You may + choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of + Covered Software. However, you may do so only on Your own behalf, + and not on behalf of the Initial Developer or any Contributor. + You must make it absolutely clear that any such warranty, support, + indemnity or liability obligation is offered by You alone, and You + hereby agree to indemnify the Initial Developer and every + Contributor for any liability incurred by the Initial Developer or + such Contributor as a result of warranty, support, indemnity or + liability terms You offer. + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered Software + under the terms of this License or under the terms of a license of + Your choice, which may contain terms different from this License, + provided that You are in compliance with the terms of this License + and that the license for the Executable form does not attempt to + limit or alter the recipient's rights in the Source Code form from + the rights set forth in this License. If You distribute the + Covered Software in Executable form under a different license, You + must make it absolutely clear that any terms which differ from + this License are offered by You alone, not by the Initial + Developer or Contributor. You hereby agree to indemnify the + Initial Developer and every Contributor for any liability incurred + by the Initial Developer or such Contributor as a result of any + such terms You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software with + other code not governed by the terms of this License and + distribute the Larger Work as a single product. In such a case, + You must make sure the requirements of this License are fulfilled + for the Covered Software. + +4. Versions of the License. + + 4.1. New Versions. + + Sun Microsystems, Inc. is the initial license steward and may + publish revised and/or new versions of this License from time to + time. Each version will be given a distinguishing version number. + Except as provided in Section 4.3, no one other than the license + steward has the right to modify this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise make the + Covered Software available under the terms of the version of the + License under which You originally received the Covered Software. + If the Initial Developer includes a notice in the Original + Software prohibiting it from being distributed or otherwise made + available under any subsequent version of the License, You must + distribute and make the Covered Software available under the terms + of the version of the License under which You originally received + the Covered Software. Otherwise, You may also choose to use, + distribute or otherwise make the Covered Software available under + the terms of any subsequent version of the License published by + the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a new + license for Your Original Software, You may create and use a + modified version of this License if You: (a) rename the license + and remove any references to the name of the license steward + (except to note that the license differs from this License); and + (b) otherwise make it clear that the license contains terms which + differ from this License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" + BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED + SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR + PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY + COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE + INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY + NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF + WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS + DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to + cure such breach within 30 days of becoming aware of the breach. + Provisions which, by their nature, must remain in effect beyond + the termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding + declaratory judgment actions) against Initial Developer or a + Contributor (the Initial Developer or Contributor against whom You + assert such claim is referred to as "Participant") alleging that + the Participant Software (meaning the Contributor Version where + the Participant is a Contributor or the Original Software where + the Participant is the Initial Developer) directly or indirectly + infringes any patent, then any and all rights granted directly or + indirectly to You by such Participant, the Initial Developer (if + the Initial Developer is not the Participant) and all Contributors + under Sections 2.1 and/or 2.2 of this License shall, upon 60 days + notice from Participant terminate prospectively and automatically + at the expiration of such 60 day notice period, unless if within + such 60 day period You withdraw Your claim with respect to the + Participant Software against such Participant either unilaterally + or pursuant to a written agreement with Participant. + + 6.3. In the event of termination under Sections 6.1 or 6.2 above, + all end user licenses that have been validly granted by You or any + distributor hereunder prior to termination (excluding licenses + granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE + INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF + COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE + LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK + STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL + INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT + APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO + NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR + CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT + APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is + defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial + computer software" (as that term is defined at 48 + C.F.R. 252.227-7014(a)(1)) and "commercial computer software + documentation" as such terms are used in 48 C.F.R. 12.212 + (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 + C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all + U.S. Government End Users acquire Covered Software with only those + rights set forth herein. This U.S. Government Rights clause is in + lieu of, and supersedes, any other FAR, DFAR, or other clause or + provision that addresses Government rights in computer software + under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed + by the law of the jurisdiction specified in a notice contained + within the Original Software (except to the extent applicable law, + if any, provides otherwise), excluding such jurisdiction's + conflict-of-law provisions. Any litigation relating to this + License shall be subject to the jurisdiction of the courts located + in the jurisdiction and venue specified in a notice contained + within the Original Software, with the losing party responsible + for costs, including, without limitation, court costs and + reasonable attorneys' fees and expenses. The application of the + United Nations Convention on Contracts for the International Sale + of Goods is expressly excluded. Any law or regulation which + provides that the language of a contract shall be construed + against the drafter shall not apply to this License. You agree + that You alone are responsible for compliance with the United + States export administration regulations (and the export control + laws and regulation of any other countries) when You use, + distribute or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or + indirectly, out of its utilization of rights under this License + and You agree to work with Initial Developer and Contributors to + distribute such responsibility on an equitable basis. Nothing + herein is intended or shall be deemed to constitute any admission + of liability. + +-------------------------------------------------------------------- + +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND +DISTRIBUTION LICENSE (CDDL) + +For Covered Software in this distribution, this License shall be +governed by the laws of Germany. Legal venue shall be Stuttgart, +Germany. diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile new file mode 100644 index 00000000..ebb091d5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile @@ -0,0 +1,57 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +PROG= dtrace + +include ../Makefile.cmd + +SUBDIRS= $(MACH) demo test +$(BUILD64)SUBDIRS += $(MACH64) + +all := TARGET = all +install := TARGET = install +clean := TARGET = clean +clobber := TARGET = clobber +lint := TARGET = lint + +.KEEP_STATE: + +all: $(SUBDIRS) + +clean clobber lint: $(SUBDIRS) + +install: $(SUBDIRS) + -$(RM) $(ROOTUSRSBINPROG) + -$(LN) $(ISAEXEC) $(ROOTUSRSBINPROG) + +$(SUBDIRS): FRC + @cd $@; pwd; $(MAKE) $(TARGET) + +FRC: + +include ../Makefile.targ diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile.com b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile.com new file mode 100644 index 00000000..2f69e31b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile.com @@ -0,0 +1,57 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +PROG = dtrace +OBJS = dtrace.o +SRCS = $(OBJS:%.o=../%.c) + +include ../../Makefile.cmd + +CFLAGS += $(CCVERBOSE) +CFLAGS64 += $(CCVERBOSE) +LDLIBS += -ldtrace -lproc -lctf -lelf + +FILEMODE = 0555 + +CLEANFILES += $(OBJS) + +.KEEP_STATE: + +all: $(PROG) + +$(PROG): $(OBJS) + $(LINK.c) -o $@ $(OBJS) $(LDLIBS) + $(POST_PROCESS) ; $(STRIP_STABS) + +clean: + -$(RM) $(CLEANFILES) + +lint: lint_SRCS + +%.o: ../%.c + $(COMPILE.c) $< + +include ../../Makefile.targ diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/amd64/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/amd64/Makefile new file mode 100644 index 00000000..a34a1e5e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/amd64/Makefile @@ -0,0 +1,32 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License, Version 1.0 only +# (the "License"). You may not use this file except in compliance +# with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +include ../Makefile.com +include ../../Makefile.cmd.64 + +install: all $(ROOTUSRSBINPROG64) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/amd64/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/amd64/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/Makefile new file mode 100644 index 00000000..7da281ed --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/Makefile @@ -0,0 +1,167 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL 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) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +# + +include ../../Makefile.cmd + +i386_DFILES = \ + iprb.d + +DFILES = \ + applicat.d \ + badopen.d \ + begin.d \ + callout.d \ + clause.d \ + clear.d \ + countdown.d \ + counter.d \ + dateprof.d \ + delay.d \ + denorm.d \ + end.d \ + error.d \ + errorpath.d \ + find.d \ + firebird.d \ + hello.d \ + howlong.d \ + interp.d \ + interval.d \ + intr.d \ + iocpu.d \ + iosnoop.d \ + iothrough.d \ + iotime.d \ + ipio.d \ + ipproto.d \ + tcprst.d \ + kstat.d \ + ksyms.d \ + libc.d \ + lquantize.d \ + lwptime.d \ + normalize.d \ + nscd.d \ + pri.d \ + printa.d \ + pritime.d \ + prof.d \ + profpri.d \ + progtime.d \ + putnext.d \ + qlen.d \ + qtime.d \ + renormalize.d \ + restest.d \ + ring.d \ + rtime.d \ + rwinfo.d \ + rwtime.d \ + sig.d \ + soffice.d \ + spec.d \ + specopen.d \ + ssd.d \ + syscall.d \ + tcp1stbyte.d \ + tcpbytes.d \ + tcpbytesstat.d \ + tcpconnlat.d \ + tcpio.d \ + tcpioflags.d \ + tcpsnoop.d \ + tcpstate.d \ + tcptop.d \ + tick.d \ + ticktime.d \ + time.d \ + tracewrite.d \ + trunc.d \ + trussrw.d \ + udpbytes.d \ + udpbytesstat.d \ + udpio.d \ + udpsnoop.d \ + udptop.d \ + userfunc.d \ + whatfor.d \ + whatlock.d \ + where.d \ + whererun.d \ + whoexec.d \ + whofor.d \ + whoio.d \ + whopreempt.d \ + whoqueue.d \ + whosteal.d \ + whowrite.d \ + writes.d \ + writesbycmd.d \ + writesbycmdfd.d \ + writetime.d \ + writetimeq.d \ + xioctl.d \ + xterm.d \ + xwork.d \ + $($(MACH)_DFILES) + +HTMLFILES = index.html + +DEMOFILES = \ + $(DFILES) \ + $(HTMLFILES) \ + sunlogo.gif + +MKDEMO = mkdemo +CLEANFILES += $(DFILES) $(MKDEMO) + +ROOTDEMODIR = $(ROOT)/usr/demo/dtrace +ROOTDEMOFILES = $(DEMOFILES:%=$(ROOTDEMODIR)/%) + +all: $(DEMOFILES) + +clobber clean: + -$(RM) $(CLEANFILES) + +clean.lint install_h lint: + +install: $(ROOTDEMOFILES) + +$(ROOTDEMODIR): + $(INS.dir) + +$(ROOTDEMODIR)/%: % + $(INS.file) + +$(HTMLFILES): $(DFILES) $(MKDEMO) + ./$(MKDEMO) $@ + +$(DFILES): $(MKDEMO) + ./$(MKDEMO) $@ + +$(ROOTDEMOFILES): $(ROOTDEMODIR) + +$(ROOTDEMODIR) := DIRMODE = 755 + +$(ROOTDEMOFILES) := FILEMODE = 644 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/act/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/act/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/act/time.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/act/time.d new file mode 100644 index 00000000..b7afd4cb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/act/time.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet +#pragma D option destructive +#pragma D option switchrate=5sec + +tick-1sec +/n++ < 5/ +{ + printf("walltime : %Y\n", walltimestamp); + printf("date : "); + system("date"); + printf("\n"); +} + +tick-1sec +/n == 5/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/clear.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/clear.d new file mode 100644 index 00000000..4b90a09a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/clear.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +BEGIN +{ + last = timestamp; +} + +syscall:::entry +{ + @func[execname] = count(); +} + +tick-10sec +{ + normalize(@func, (timestamp - last) / 1000000000); + printa(@func); + clear(@func); + last = timestamp; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/dateprof.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/dateprof.d new file mode 100644 index 00000000..19a63c5e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/dateprof.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::exec:return, +syscall::exece:return +/execname == "date"/ +{ + self->start = vtimestamp; +} + +syscall:::entry +/self->start/ +{ + /* + * We linearly quantize on the current virtual time minus our + * process's start time. We divide by 1000 to yield microseconds + * rather than nanoseconds. The range runs from 0 to 10 milliseconds + * in steps of 100 microseconds; we expect that no date(1) process + * will take longer than 10 milliseconds to complete. + */ + @["system calls over time"] = + lquantize((vtimestamp - self->start) / 1000, 0, 10000, 100); +} + +syscall::rexit:entry +/self->start/ +{ + self->start = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/denorm.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/denorm.d new file mode 100644 index 00000000..6e58596f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/denorm.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +BEGIN +{ + start = timestamp; +} + +syscall:::entry +{ + @func[execname] = count(); +} + +END +{ + this->seconds = (timestamp - start) / 1000000000; + printf("Ran for %d seconds.\n", this->seconds); + + printf("Per-second rate:\n"); + normalize(@func, this->seconds); + printa(@func); + + printf("\nRaw counts:\n"); + denormalize(@func); + printa(@func); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/lquantize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/lquantize.d new file mode 100644 index 00000000..833c73ac --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/lquantize.d @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::write:entry +{ + @fds[execname] = lquantize(arg0, 0, 100, 1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/normalize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/normalize.d new file mode 100644 index 00000000..cce12027 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/normalize.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +BEGIN +{ + /* + * Get the start time, in nanoseconds. + */ + start = timestamp; +} + +syscall:::entry +{ + @func[execname] = count(); +} + +END +{ + /* + * Normalize the aggregation based on the number of seconds we have + * been running. (There are 1,000,000,000 nanoseconds in one second.) + */ + normalize(@func, (timestamp - start) / 1000000000); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/renormalize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/renormalize.d new file mode 100644 index 00000000..a6a15107 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/renormalize.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +BEGIN +{ + start = timestamp; +} + +syscall:::entry +{ + @func[execname] = count(); +} + +tick-10sec +{ + normalize(@func, (timestamp - start) / 1000000000); + printa(@func); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/trunc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/trunc.d new file mode 100644 index 00000000..76965f8b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/trunc.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +BEGIN +{ + last = timestamp; +} + +syscall:::entry +{ + @func[execname] = count(); +} + +tick-10sec +{ + trunc(@func, 10); + normalize(@func, (timestamp - last) / 1000000000); + printa(@func); + clear(@func); + last = timestamp; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writes.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writes.d new file mode 100644 index 00000000..9de61541 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writes.d @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::write:entry +{ + @counts["write system calls"] = count(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writesbycmd.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writesbycmd.d new file mode 100644 index 00000000..bcbefae1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writesbycmd.d @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::write:entry +{ + @counts[execname] = count(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writesbycmdfd.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writesbycmdfd.d new file mode 100644 index 00000000..8b92cb83 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writesbycmdfd.d @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::write:entry +{ + @counts[execname, arg0] = count(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writetime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writetime.d new file mode 100644 index 00000000..b770f5b0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writetime.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::write:entry +{ + self->ts = timestamp; +} + +syscall::write:return +/self->ts/ +{ + @time[execname] = avg(timestamp - self->ts); + self->ts = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writetimeq.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writetimeq.d new file mode 100644 index 00000000..9b494090 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/agg/writetimeq.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::write:entry +{ + self->ts = timestamp; +} + +syscall::write:return +/self->ts/ +{ + @time[execname] = quantize(timestamp - self->ts); + self->ts = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/anon/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/anon/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/anon/iprb.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/anon/iprb.d new file mode 100644 index 00000000..f73f6a73 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/anon/iprb.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +fbt::iprbattach:entry +{ + self->trace = 1; +} + +fbt::: +/self->trace/ +{} + +fbt::iprbattach:return +{ + self->trace = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/buf/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/buf/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/buf/ring.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/buf/ring.d new file mode 100644 index 00000000..116bbd41 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/buf/ring.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option bufpolicy=ring +#pragma D option bufsize=16k + +syscall:::entry +/execname == $1/ +{ + trace(timestamp); +} + +syscall::rexit:entry +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/chapters b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/chapters new file mode 100644 index 00000000..2160a0cf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/chapters @@ -0,0 +1,125 @@ +name: book +title: Solaris Dynamic Tracing Guide +index: 0 +url: http://wikis.sun.com/display/DTrace/Documentation + +name: act +title: Actions and Subroutines +index: 10 +url: http://wikis.sun.com/display/DTrace/Actions+and+Subroutines + +name: agg +title: Aggregations +index: 9 +url: http://wikis.sun.com/display/DTrace/Aggregations + +name: anon +title: Anonymous Tracing +index: 34 +url: http://wikis.sun.com/display/DTrace/Anonymous+Tracing + +name: buf +title: Buffers and Buffering +index: 11 +url: http://wikis.sun.com/display/DTrace/Buffers+and+Buffering + +name: dtrace +title: dtrace Provider +index: 17 +url: http://wikis.sun.com/display/DTrace/dtrace+Provider + +name: fbt +title: fbt Provider +index: 20 +url: http://wikis.sun.com/display/DTrace/fbt+Provider + +name: intro +title: Introduction +index: 1 +url: http://wikis.sun.com/display/DTrace/Introduction + +name: io +title: io Provider +index: 27 +url: http://wikis.sun.com/display/DTrace/io+Provider + +name: lockstat +title: lockstat Provider +index: 18 +url: http://wikis.sun.com/display/DTrace/lockstat+Provider + +name: out +title: Output Formatting +index: 12 +url: http://wikis.sun.com/display/DTrace/Output+Formatting + +name: proc +title: proc Provider +index: 25 +url: http://wikis.sun.com/display/DTrace/proc+Provider + +name: profile +title: profile Provider +index: 19 +url: http://wikis.sun.com/display/DTrace/profile+Provider + +name: sched +title: sched Provider +index: 26 +url: http://wikis.sun.com/display/DTrace/sched+Provider + +name: script +title: Scripting +index: 15 +url: http://wikis.sun.com/display/DTrace/Scripting + +name: sdt +title: sdt Provider +index: 22 +url: http://wikis.sun.com/display/DTrace/sdt+Provider + +name: spec +title: Speculative Tracing +index: 13 +url: http://wikis.sun.com/display/DTrace/Speculative+Tracing + +name: struct +title: Structs and Unions +index: 7 +url: http://wikis.sun.com/display/DTrace/Structs+and+Unions + +name: sysinfo +title: sysinfo Provider +index: 23 +url: http://wikis.sun.com/display/DTrace/sysinfo+Provider + +name: user +title: User Process Tracing +index: 32 +url: http://wikis.sun.com/display/DTrace/User+Process+Tracing + +name: vars +title: Variables +index: 3 +url: http://wikis.sun.com/display/DTrace/Variables + +name: vminfo +title: vminfo Provider +index: 24 +url: http://wikis.sun.com/display/DTrace/vminfo+Provider + +name: ip +title: ip Provider +index: 101 +url: http://wikis.sun.com/display/DTrace/ip+Provider + +name: tcp +title: tcp Provider +index: 102 +url: http://wikis.sun.com/display/DTrace/tcp+Provider + +name: udp +title: udp Provider +index: 103 +url: http://wikis.sun.com/display/DTrace/udp+Provider + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/begin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/begin.d new file mode 100644 index 00000000..a3786017 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/begin.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +BEGIN +{ + prot[0] = "---"; + prot[1] = "r--"; + prot[2] = "-w-"; + prot[3] = "rw-"; + prot[4] = "--x"; + prot[5] = "r-x"; + prot[6] = "-wx"; + prot[7] = "rwx"; +} + +syscall::mmap:entry +{ + printf("mmap with prot = %s", prot[arg2 & 0x7]); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/end.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/end.d new file mode 100644 index 00000000..4390b10a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/end.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +BEGIN +{ + start = timestamp; +} + +/* + * ... other tracing actions... + */ + +END +{ + printf("total time: %d secs", (timestamp - start) / 1000000000); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/error.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/error.d new file mode 100644 index 00000000..97115763 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/dtrace/error.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +BEGIN +{ + *(char *)NULL; +} + +ERROR +{ + printf("Hit an error!"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/delay.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/delay.d new file mode 100644 index 00000000..1a523336 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/delay.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +fbt::delay:entry, +fbt::drv_usecwait:entry +{ + self->in = timestamp +} + +fbt::delay:return, +fbt::drv_usecwait:return +/self->in/ +{ + @snoozers[stack()] = quantize(timestamp - self->in); + self->in = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/putnext.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/putnext.d new file mode 100644 index 00000000..dd91ea06 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/putnext.d @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +fbt::putnext:entry +{ + @calls[stringof(args[0]->q_qinfo->qi_minfo->mi_idname)] = count(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/ssd.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/ssd.d new file mode 100644 index 00000000..6b78ab9d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/ssd.d @@ -0,0 +1,31 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +fbt:ssd::return +/arg1 == EIO/ +{ + printf("%s+%x returned EIO.", probefunc, arg0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/xioctl.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/xioctl.d new file mode 100644 index 00000000..33147682 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/fbt/xioctl.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * To make the output more readable, we want to indent every function entry + * (and unindent every function return). This is done by setting the + * "flowindent" option. + */ +#pragma D option flowindent + +syscall::ioctl:entry +/execname == "xclock" && guard++ == 0/ +{ + self->traceme = 1; + printf("fd: %d", arg0); +} + +fbt::: +/self->traceme/ +{} + +syscall::ioctl:return +/self->traceme/ +{ + self->traceme = 0; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/countdown.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/countdown.d new file mode 100644 index 00000000..3fdb7904 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/countdown.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +dtrace:::BEGIN +{ + i = 10; +} + +profile:::tick-1sec +/i > 0/ +{ + trace(i--); +} + +profile:::tick-1sec +/i == 0/ +{ + trace("blastoff!"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/counter.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/counter.d new file mode 100644 index 00000000..bda153a8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/counter.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Count off and report the number of seconds elapsed + */ +dtrace:::BEGIN +{ + i = 0; +} + +profile:::tick-1sec +{ + i = i + 1; + trace(i); +} + +dtrace:::END +{ + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/hello.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/hello.d new file mode 100644 index 00000000..b5842915 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/hello.d @@ -0,0 +1,31 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +BEGIN +{ + trace("hello, world"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/rwtime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/rwtime.d new file mode 100644 index 00000000..c005fbc4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/rwtime.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::read:entry, +syscall::write:entry +/pid == $1/ +{ + ts[probefunc] = timestamp; +} + +syscall::read:return, +syscall::write:return +/pid == $1 && ts[probefunc] != 0/ +{ + printf("%d nsecs", timestamp - ts[probefunc]); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/trussrw.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/trussrw.d new file mode 100644 index 00000000..590782f2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/intro/trussrw.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::read:entry, +syscall::write:entry +/pid == $1/ +{ + printf("%s(%d, 0x%x, %4d)", probefunc, arg0, arg1, arg2); +} + +syscall::read:return, syscall::write:return +/pid == $1/ +{ + printf("\t\t = %d\n", arg1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/applicat.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/applicat.d new file mode 100644 index 00000000..44bce364 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/applicat.d @@ -0,0 +1,32 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +io:::start +/execname == "soffice.bin" && args[2]->fi_name == "applicat.rdb"/ +{ + @ = lquantize(args[2]->fi_offset != -1 ? + args[2]->fi_offset / (1000 * 1024) : -1, 0, 1000); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iocpu.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iocpu.d new file mode 100644 index 00000000..6957071c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iocpu.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +sched:::on-cpu +/execname == "soffice.bin"/ +{ + self->on = vtimestamp; +} + +sched:::off-cpu +/self->on/ +{ + @time[""] = sum(vtimestamp - self->on); + self->on = 0; +} + +io:::wait-start +/execname == "soffice.bin"/ +{ + self->wait = timestamp; +} + +io:::wait-done +/self->wait/ +{ + @io[args[2]->fi_name] = sum(timestamp - self->wait); + @time[""] = sum(timestamp - self->wait); + self->wait = 0; +} + +END +{ + printf("Time breakdown (milliseconds):\n"); + normalize(@time, 1000000); + printa(" %-50s %15@d\n", @time); + + printf("\nI/O wait breakdown (milliseconds):\n"); + normalize(@io, 1000000); + printa(" %-50s %15@d\n", @io); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iosnoop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iosnoop.d new file mode 100644 index 00000000..1db6290c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iosnoop.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +BEGIN +{ + printf("%10s %58s %2s\n", "DEVICE", "FILE", "RW"); +} + +io:::start +{ + printf("%10s %58s %2s\n", args[1]->dev_statname, + args[2]->fi_pathname, args[0]->b_flags & B_READ ? "R" : "W"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iothrough.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iothrough.d new file mode 100644 index 00000000..b5b2e7e3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iothrough.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +io:::start +{ + start[args[0]->b_edev, args[0]->b_blkno] = timestamp; +} + +io:::done +/start[args[0]->b_edev, args[0]->b_blkno]/ +{ + /* + * We want to get an idea of our throughput to this device in KB/sec. + * What we have, however, is nanoseconds and bytes. That is we want + * to calculate: + * + * bytes / 1024 + * ------------------------ + * nanoseconds / 1000000000 + * + * But we can't calculate this using integer arithmetic without losing + * precision (the denomenator, for one, is between 0 and 1 for nearly + * all I/Os). So we restate the fraction, and cancel: + * + * bytes 1000000000 bytes 976562 + * --------- * ------------- = --------- * ------------- + * 1024 nanoseconds 1 nanoseconds + * + * This is easy to calculate using integer arithmetic; this is what + * we do below. + */ + this->elapsed = timestamp - start[args[0]->b_edev, args[0]->b_blkno]; + @[args[1]->dev_statname, args[1]->dev_pathname] = + quantize((args[0]->b_bcount * 976562) / this->elapsed); + start[args[0]->b_edev, args[0]->b_blkno] = 0; +} + +END +{ + printa(" %s (%s)\n%@d\n", @); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iotime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iotime.d new file mode 100644 index 00000000..0e0f6ac7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iotime.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 D option quiet + +BEGIN +{ + printf("%10s %58s %2s %7s\n", "DEVICE", "FILE", "RW", "MS"); +} + +io:::start +{ + start[args[0]->b_edev, args[0]->b_blkno] = timestamp; +} + +io:::done +/start[args[0]->b_edev, args[0]->b_blkno]/ +{ + this->elapsed = timestamp - start[args[0]->b_edev, args[0]->b_blkno]; + printf("%10s %58s %2s %3d.%03d\n", args[1]->dev_statname, + args[2]->fi_pathname, args[0]->b_flags & B_READ ? "R" : "W", + this->elapsed / 1000000, (this->elapsed / 1000) % 1000); + start[args[0]->b_edev, args[0]->b_blkno] = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whoio.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whoio.d new file mode 100644 index 00000000..f660b343 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whoio.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +io:::start +{ + @[args[1]->dev_statname, execname, pid] = sum(args[0]->b_bcount); +} + +END +{ + printf("%10s %20s %10s %15s\n", "DEVICE", "APP", "PID", "BYTES"); + printa("%10s %20s %10d %15@d\n", @); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whowrite.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whowrite.d new file mode 100644 index 00000000..6a4ffdd8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whowrite.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +io:::start +/args[0]->b_flags & B_WRITE/ +{ + @[execname, args[2]->fi_dirname] = count(); +} + +END +{ + printf("%20s %51s %5s\n", "WHO", "WHERE", "COUNT"); + printa("%20s %51s %5@d\n", @); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/ipio.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/ipio.d new file mode 100644 index 00000000..0a7cc6f3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/ipio.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 D option quiet +#pragma D option switchrate=10hz + +dtrace:::BEGIN +{ + printf(" %3s %10s %15s %15s %8s %6s\n", "CPU", "DELTA(us)", + "SOURCE", "DEST", "INT", "BYTES"); + last = timestamp; +} + +ip:::send +{ + this->elapsed = (timestamp - last) / 1000; + printf(" %3d %10d %15s -> %15s %8s %6d\n", cpu, this->elapsed, + args[2]->ip_saddr, args[2]->ip_daddr, args[3]->if_name, + args[2]->ip_plength); + last = timestamp; +} + +ip:::receive +{ + this->elapsed = (timestamp - last) / 1000; + printf(" %3d %10d %15s <- %15s %8s %6d\n", cpu, this->elapsed, + args[2]->ip_daddr, args[2]->ip_saddr, args[3]->if_name, + args[2]->ip_plength); + last = timestamp; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/ipproto.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/ipproto.d new file mode 100644 index 00000000..f5f3656e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/ipproto.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 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +dtrace:::BEGIN +{ + printf("Tracing... Hit Ctrl-C to end.\n"); +} + +ip:::send, +ip:::receive +{ + this->protostr = args[2]->ip_ver == 4 ? + args[4]->ipv4_protostr : args[5]->ipv6_nextstr; + @num[args[2]->ip_saddr, args[2]->ip_daddr, this->protostr] = count(); +} + +dtrace:::END +{ + printf(" %-28s %-28s %6s %8s\n", "SADDR", "DADDR", "PROTO", "COUNT"); + printa(" %-28s %-28s %6s %@8d\n", @num); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/tcprst.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/tcprst.d new file mode 100755 index 00000000..a2d88e1c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/ip/tcprst.d @@ -0,0 +1,284 @@ +#!/usr/sbin/dtrace -Cqs +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL 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 D option dynvarsize=64m + +#define TH_RST 0x04 +#define MAX_RECORDS 10 +#define M_CTL 0x0d + +#define PRINT_MAIN_HEADER() \ + (printf("\n%-25s %-6s %-25s %-6s %-10s %-10s %8s %8s\n", \ + "LADDR", "LPORT", "RADDR", "RPORT", "ISS", "IRS", \ + "SND_CNT", "RCV_CNT")) + +#define PRINT_RECORD_HEADER() \ + (printf("%-20s %-20s %-3s %15s %15s %8s %8s %5s\n", \ + "PROBENAME", "TIME", "S/R", "SEQ", "ACK", "DATALEN", \ + "WND", "FLAGS")) + +#define PRINT_MAIN_HEADER_VALUES() \ + (printf("%-25s %-6d %-25s %-6d %-10d %-10d %8d %8d\n", \ + laddr[self->conn_id], lport[self->conn_id], \ + faddr[self->conn_id], fport[self->conn_id], \ + iss[self->conn_id], irs[self->conn_id], \ + send_count[self->conn_id], recv_count[self->conn_id])) + +#define PRINT_HEADER() \ + PRINT_MAIN_HEADER(); PRINT_MAIN_HEADER_VALUES(); \ + PRINT_RECORD_HEADER() + +#define PRINT_RECORD(i) \ + (printf("%-20s %-20Y %-3s %15d %15d %8d %8d %2x\n", \ + probe_name[self->conn_id, i], \ + conn_time[self->conn_id, i], \ + send_recv[self->conn_id, i], \ + seqno[self->conn_id, i], \ + ack[self->conn_id, i], \ + datalen[self->conn_id, i], \ + wnd[self->conn_id, i], \ + flags[self->conn_id, i])) + +tcp-trace-* +{ + /* extract connection details */ + + this->mp = (mblk_t *)arg0; + this->mp = (this->mp->b_datap->db_type == M_CTL? + this->mp->b_cont : this->mp); + self->tcpp = (tcp_t *)arg1; + this->connp = (conn_t *)self->tcpp->tcp_connp; + + self->iph = (ipha_t *)this->mp->b_rptr; + this->iph_length = + (int)(((ipha_t *)self->iph)->ipha_version_and_hdr_length + & 0xF) << 2; + self->tcph = (tcpha_t *)((char *)self->iph + this->iph_length); + this->tcph_length = + (((tcph_t *)self->tcph)->th_offset_and_rsrvd[0] >>2) &(0xF << 2); + + /* ports */ + self->i_lport = ntohs(this->connp->u_port.tcpu_ports.tcpu_lport); + self->i_fport = ntohs(this->connp->u_port.tcpu_ports.tcpu_fport); + + /* IP addresses */ + this->i_fad = (in6_addr_t *)&this->connp->connua_v6addr.connua_faddr; + this->i_lad = (in6_addr_t *)&this->connp->connua_v6addr.connua_laddr; + + /* the address would either be IPv6 or IPv4-mapped-IPv6 */ + self->i_faddr = inet_ntop(AF_INET6, (void *)this->i_fad); + self->i_laddr = inet_ntop(AF_INET6, (void *)this->i_lad); + + /* create connection identifier, so we can track packets by conn */ + self->conn_id = (uint64_t)self->tcpp->tcp_connp; +} + +tcp-trace-* +/first[self->conn_id] == 0/ +{ + /* initialize counters - this is the first packet for this connection */ + pcount[self->conn_id] = -1; + rollover[self->conn_id] = 0; + end_ptr[self->conn_id] = 0; + num[self->conn_id] = 0; + + first[self->conn_id] = 1; + + /* connection info */ + laddr[self->conn_id] = self->i_laddr; + faddr[self->conn_id] = self->i_faddr; + lport[self->conn_id] = self->i_lport; + fport[self->conn_id] = self->i_fport; + iss[self->conn_id] = self->tcpp->tcp_iss; + irs[self->conn_id] = self->tcpp->tcp_irs; + +} + +tcp-trace-* +{ + /* counters, to keep track of how much info to dump */ + pcount[self->conn_id]++; + rollover[self->conn_id] |= pcount[self->conn_id]/MAX_RECORDS; + pcount[self->conn_id] = pcount[self->conn_id]%MAX_RECORDS; + self->pcount = pcount[self->conn_id]; + end_ptr[self->conn_id] = self->pcount; + num[self->conn_id] = (rollover[self->conn_id]? + MAX_RECORDS : pcount[self->conn_id] + 1); + conn_time[self->conn_id, self->pcount] = walltimestamp; + + /* tcp state info */ + seqno[self->conn_id, self->pcount] = ntohl(self->tcph->tha_seq); + ack[self->conn_id, self->pcount] = ntohl(self->tcph->tha_ack); + datalen[self->conn_id, self->pcount] = ntohs(self->iph->ipha_length); + wnd[self->conn_id, self->pcount] = ntohs(self->tcph->tha_win); + probe_name[self->conn_id, self->pcount] = probename; + + /* flag 0x04 indicates a RST packet */ + flags[self->conn_id, self->pcount] = self->tcph->tha_flags; + self->flags = self->tcph->tha_flags; +} + +tcp-trace-send +{ + send_count[self->conn_id]++; + send_recv[self->conn_id, self->pcount] = "S"; +} + +tcp-trace-recv +{ + recv_count[self->conn_id]++; + send_recv[self->conn_id, self->pcount] = "R"; +} + +tcp-trace-* +/(self->flags & TH_RST)/ +{ + PRINT_HEADER(); + + self->i = (end_ptr[self->conn_id] + MAX_RECORDS - num[self->conn_id] + + 1)%MAX_RECORDS; +} + +tcp-trace-* +/(self->flags & TH_RST) && (num[self->conn_id] >= 10)/ +{ + PRINT_RECORD(self->i); + self->i = (self->i + 1)%MAX_RECORDS; + + num[self->conn_id]--; +} + +tcp-trace-* +/(self->flags & TH_RST) && (num[self->conn_id] >= 9)/ +{ + PRINT_RECORD(self->i); + self->i = (self->i + 1)%MAX_RECORDS; + + num[self->conn_id]--; +} + +tcp-trace-* +/(self->flags & TH_RST) && (num[self->conn_id] >= 8)/ +{ + PRINT_RECORD(self->i); + self->i = (self->i + 1)%MAX_RECORDS; + + num[self->conn_id]--; +} + +tcp-trace-* +/(self->flags & TH_RST) && (num[self->conn_id] >= 7)/ +{ + PRINT_RECORD(self->i); + self->i = (self->i + 1)%MAX_RECORDS; + + num[self->conn_id]--; +} + +tcp-trace-* +/(self->flags & TH_RST) && (num[self->conn_id] >= 6)/ +{ + PRINT_RECORD(self->i); + self->i = (self->i + 1)%MAX_RECORDS; + + num[self->conn_id]--; +} + +tcp-trace-* +/(self->flags & TH_RST) && (num[self->conn_id] >= 5)/ +{ + PRINT_RECORD(self->i); + self->i = (self->i + 1)%MAX_RECORDS; + + num[self->conn_id]--; +} + +tcp-trace-* +/(self->flags & TH_RST) && (num[self->conn_id] >= 4)/ +{ + PRINT_RECORD(self->i); + self->i = (self->i + 1)%MAX_RECORDS; + + num[self->conn_id]--; +} + +tcp-trace-* +/(self->flags & TH_RST) && (num[self->conn_id] >= 3)/ +{ + PRINT_RECORD(self->i); + self->i = (self->i + 1)%MAX_RECORDS; + + num[self->conn_id]--; +} + +tcp-trace-* +/(self->flags & TH_RST) && (num[self->conn_id] >= 2)/ +{ + PRINT_RECORD(self->i); + self->i = (self->i + 1)%MAX_RECORDS; + + num[self->conn_id]--; +} + +tcp-trace-* +/(self->flags & TH_RST) && (num[self->conn_id] >= 1)/ +{ + PRINT_RECORD(self->i); + self->i = (self->i + 1)%MAX_RECORDS; + + num[self->conn_id]--; + self->reset = self->conn_id; +} + +tcp-trace-* +/self->reset/ +{ + pcount[self->reset] = -1; + rollover[self->reset] = 0; + end_ptr[self->reset] = 0; + num[self->reset] = 0; + + self->reset = 0; +} + +conn-destroy +{ + /* clear old connection state */ + this->conn_id = (uint64_t)arg0; + + pcount[this->conn_id] = -1; + rollover[this->conn_id] = 0; + end_ptr[this->conn_id] = 0; + num[this->conn_id] = 0; + first[this->conn_id] = 0; + + laddr[this->conn_id] = 0; + faddr[this->conn_id] = 0; + lport[this->conn_id] = 0; + fport[this->conn_id] = 0; + iss[this->conn_id] = 0; + irs[this->conn_id] = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/lockstat/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/lockstat/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/lockstat/whatlock.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/lockstat/whatlock.d new file mode 100644 index 00000000..7ad20c5c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/lockstat/whatlock.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +lockstat:::adaptive-acquire +/execname == "date"/ +{ + @locks["adaptive"] = count(); +} + +lockstat:::spin-acquire +/execname == "date"/ +{ + @locks["spin"] = count(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/mkdemo.pl b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/mkdemo.pl new file mode 100644 index 00000000..f2bc3ec7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/mkdemo.pl @@ -0,0 +1,227 @@ +#!/usr/perl5/bin/perl -w +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +require 5.005; + +use strict; +use warnings; +use Time::localtime; +use File::Basename; + +our ($cmd, $chapfile, $htmlfile, $dtrace_url, %chaps); + +$cmd = "mkdemo"; +$chapfile = "chapters"; +$htmlfile = "index.html"; +$dtrace_url = "http://www.sun.com/bigadmin/content/dtrace"; + +sub chaps_read { + my $fatal; + my %hash; + + open(CHAPS, "$chapfile"); + + while () { + my $field; + my $value; + + chop; + + if (/^#/) { + next; + } + + if (!/:/) { + if (exists $hash{'name'}) { + if (exists $chaps{$hash{'name'}}) { + print "$cmd: chapter $hash{'name'} "; + print "has two entries.\n"; + $fatal = 1; + } + + $chaps{$hash{'name'}} = { %hash }; + %hash = (); + next; + } + + %hash = (); + next; + } + + ($field, $value) = split /:\s*/, $_, 2; + + if ($field eq "descr") { + $value .= " "; + } + + $hash{$field} .= $value; + } + + if ($fatal) { + print "$cmd: fatal errors; cannot proceed.\n"; + exit; + } + + close (CHAPS); +} + +sub chaps_ascending { + $chaps{$a}{index} <=> $chaps{$b}{index}; +} + +sub demo_process { + my $chap = $_[0]; + my $demo = $_[1]; + my $year = localtime->year() + 1900; + + open DEMO, "<$chap/$demo" or die "Can't open demo $chap/$demo"; + open OUT, ">$demo" or die "Can't open $demo"; + + while () { + print OUT $_; + + if (/Use is subject to license terms/) { + print OUT <$outfile" or die "Can't open $outfile."; + + print HTML "\n\n"; + print HTML "Example DTrace Scripts\n"; + print HTML "\n\n"; + + print HTML "\n

\n\n"; + print HTML "

\n"; + print HTML "
"; + print HTML "

DTrace Examples

\n"; + + print HTML "

\n"; + print HTML "Here are the DTrace scripts\n"; + print HTML "that are used as examples in the\n"; + print HTML "$chaps{book}{title}. "; + print HTML "For more information on any one script, follow the link\n"; + print HTML "to its corresponding chapter.\n"; + print HTML "

\n


\n"; + + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + + foreach $chap (sort chaps_ascending (keys %chaps)) { + my @demos; + my $demo; + + # + # Open the directory associated with the chapter. + # + if ($chap =~ /^book$/) { + next; + } + + opendir(DEMOS, $chap) || die("Cannot open directory $chap"); + @demos = readdir(DEMOS); + closedir(DEMOS); + + print HTML "\n"; + print HTML "\n"; + + print HTML "\n"; + } + + print HTML "
"; + print HTML "ChapterScript
"; + print HTML ""; + print HTML "$chaps{$chap}{title}\n"; + + foreach $demo (sort(@demos)) { + if ($demo !~ /^[a-z].*\.d$/) { + next; + } + + print HTML "\n"; + + demo_process($chap, $demo); + } + + print HTML "
$demo"; + print HTML "
\n


Copyright "; + print HTML localtime->year() + 1900; + print HTML " Sun Microsystems\n"; + print HTML "
\n"; + print HTML "\n\n"; + close HTML; +} + +chaps_read(); + +if (basename($ARGV[0]) ne "$htmlfile") { + demo_find(basename($ARGV[0])); +} else { + chaps_process($htmlfile); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/out/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/out/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/out/printa.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/out/printa.d new file mode 100644 index 00000000..f3cee56c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/out/printa.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +profile:::profile-997 +{ + @a[caller] = count(); +} + +END +{ + printa("%@8u %a\n", @a); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/lwptime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/lwptime.d new file mode 100644 index 00000000..53949af4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/lwptime.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +proc:::lwp-start +/tid != 1/ +{ + self->start = timestamp; +} + +proc:::lwp-exit +/self->start/ +{ + @[execname] = quantize(timestamp - self->start); + self->start = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/progtime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/progtime.d new file mode 100644 index 00000000..8bfa369f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/progtime.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +proc:::start +{ + self->start = timestamp; +} + +proc:::exit +/self->start/ +{ + @[execname] = quantize(timestamp - self->start); + self->start = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/sig.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/sig.d new file mode 100644 index 00000000..07d9b25c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/sig.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +proc:::signal-send +{ + @[execname, stringof(args[1]->pr_fname), args[2]] = count(); +} + +END +{ + printf("%20s %20s %12s %s\n", + "SENDER", "RECIPIENT", "SIG", "COUNT"); + printa("%20s %20s %12d %@d\n", @); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/whoexec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/whoexec.d new file mode 100644 index 00000000..ee0fe4ff --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/proc/whoexec.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +proc:::exec +{ + self->parent = execname; +} + +proc:::exec-success +/self->parent != NULL/ +{ + @[self->parent, execname] = count(); + self->parent = NULL; +} + +proc:::exec-failure +/self->parent != NULL/ +{ + self->parent = NULL; +} + +END +{ + printf("%-20s %-20s %s\n", "WHO", "WHAT", "COUNT"); + printa("%-20s %-20s %@d\n", @); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/prof.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/prof.d new file mode 100644 index 00000000..4eedf502 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/prof.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +profile-97 +/pid != 0/ +{ + @proc[pid, execname] = count(); +} + +END +{ + printf("%-8s %-40s %s\n", "PID", "CMD", "COUNT"); + printa("%-8d %-40s %@d\n", @proc); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/profpri.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/profpri.d new file mode 100644 index 00000000..615594b5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/profpri.d @@ -0,0 +1,31 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +profile-1001 +/pid == $1/ +{ + @proc[execname] = lquantize(curlwpsinfo->pr_pri, 0, 100, 10); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/restest.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/restest.d new file mode 100644 index 00000000..390ea124 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/profile/restest.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +profile-5000 +{ + /* + * We divide by 1,000,000 to convert nanoseconds to milliseconds, and + * then we take the value mod 10 to get the current millisecond within + * a 10 millisecond window. On platforms that do not support truly + * arbitrary resolution profile probes, all of the profile-5000 probes + * will fire on roughly the same millisecond. On platforms that + * support a truly arbitrary resolution, the probe firings will be + * evenly distributed across the milliseconds. + */ + @ms = lquantize((timestamp / 1000000) % 10, 0, 10, 1); +} + +tick-1sec +/i++ >= 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/firebird.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/firebird.d new file mode 100644 index 00000000..ab65e956 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/firebird.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +sched:::sleep +/execname == "MozillaFirebird" && curlwpsinfo->pr_stype == SOBJ_CV/ +{ + bedtime[curlwpsinfo->pr_addr] = timestamp; +} + +sched:::wakeup +/execname == "MozillaFirebird" && bedtime[args[0]->pr_addr]/ +{ + @[args[1]->pr_pid, args[0]->pr_lwpid, pid, curlwpsinfo->pr_lwpid] = + quantize(timestamp - bedtime[args[0]->pr_addr]); + bedtime[args[0]->pr_addr] = 0; +} + +sched:::wakeup +/bedtime[args[0]->pr_addr]/ +{ + bedtime[args[0]->pr_addr] = 0; +} + +END +{ + printa("%d/%d sleeping on %d/%d:\n%@d\n", @); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/howlong.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/howlong.d new file mode 100644 index 00000000..0fcfa1c1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/howlong.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +sched:::off-cpu +/curlwpsinfo->pr_state == SSLEEP/ +{ + self->cpu = cpu; + self->ts = timestamp; +} + +sched:::on-cpu +/self->ts/ +{ + @[self->cpu == cpu ? + "sleep time, no CPU migration" : "sleep time, CPU migration"] = + lquantize((timestamp - self->ts) / 1000000, 0, 500, 25); + self->ts = 0; + self->cpu = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/nscd.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/nscd.d new file mode 100644 index 00000000..8e30ac44 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/nscd.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +sched:::sleep +/curlwpsinfo->pr_stype == SOBJ_SHUTTLE/ +{ + bedtime[curlwpsinfo->pr_addr] = timestamp; +} + +sched:::wakeup +/execname == "nscd" && bedtime[args[0]->pr_addr]/ +{ + @[stringof(curpsinfo->pr_fname), stringof(args[1]->pr_fname)] = + quantize(timestamp - bedtime[args[0]->pr_addr]); + bedtime[args[0]->pr_addr] = 0; +} + +sched:::wakeup +/bedtime[args[0]->pr_addr]/ +{ + bedtime[args[0]->pr_addr] = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/pri.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/pri.d new file mode 100644 index 00000000..ea76fd79 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/pri.d @@ -0,0 +1,31 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +sched:::change-pri +{ + @[stringof(args[0]->pr_clname)] = + lquantize(args[2] - args[0]->pr_pri, -50, 50, 5); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/pritime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/pritime.d new file mode 100644 index 00000000..2c80e6a7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/pritime.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +BEGIN +{ + start = timestamp; +} + +sched:::change-pri +/args[1]->pr_pid == $1 && args[0]->pr_lwpid == $2/ +{ + printf("%d %d\n", timestamp - start, args[2]); +} + +tick-1sec +/++n == 5/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/qlen.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/qlen.d new file mode 100644 index 00000000..a34ae4cf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/qlen.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +sched:::enqueue +{ + this->len = qlen[args[2]->cpu_id]++; + @[args[2]->cpu_id] = lquantize(this->len, 0, 100); +} + +sched:::dequeue +/qlen[args[2]->cpu_id]/ +{ + qlen[args[2]->cpu_id]--; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/qtime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/qtime.d new file mode 100644 index 00000000..54ebf5f5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/qtime.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 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +sched:::enqueue +{ + ts[args[0]->pr_lwpid, args[1]->pr_pid, args[2]->cpu_id] = + timestamp; +} + +sched:::dequeue +/ts[args[0]->pr_lwpid, args[1]->pr_pid, args[2]->cpu_id]/ +{ + @[args[2]->cpu_id] = quantize(timestamp - + ts[args[0]->pr_lwpid, args[1]->pr_pid, args[2]->cpu_id]); + ts[args[0]->pr_lwpid, args[1]->pr_pid, args[2]->cpu_id] = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/tick.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/tick.d new file mode 100644 index 00000000..88427593 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/tick.d @@ -0,0 +1,31 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +sched:::tick, +sched:::enqueue +{ + @[probename] = lquantize((timestamp / 1000000) % 10, 0, 10); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/ticktime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/ticktime.d new file mode 100644 index 00000000..e24a80ad --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/ticktime.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +uint64_t last[int]; + +sched:::tick +/last[cpu]/ +{ + @[cpu] = min(timestamp - last[cpu]); +} + +sched:::tick +{ + last[cpu] = timestamp; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whatfor.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whatfor.d new file mode 100644 index 00000000..d8b6edb0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whatfor.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +sched:::off-cpu +/curlwpsinfo->pr_state == SSLEEP/ +{ + /* + * We're sleeping. Track our sobj type. + */ + self->sobj = curlwpsinfo->pr_stype; + self->bedtime = timestamp; +} + +sched:::off-cpu +/curlwpsinfo->pr_state == SRUN/ +{ + self->bedtime = timestamp; +} + +sched:::on-cpu +/self->bedtime && !self->sobj/ +{ + @["preempted"] = quantize(timestamp - self->bedtime); + self->bedtime = 0; +} + +sched:::on-cpu +/self->sobj/ +{ + @[self->sobj == SOBJ_MUTEX ? "kernel-level lock" : + self->sobj == SOBJ_RWLOCK ? "rwlock" : + self->sobj == SOBJ_CV ? "condition variable" : + self->sobj == SOBJ_SEMA ? "semaphore" : + self->sobj == SOBJ_USER ? "user-level lock" : + self->sobj == SOBJ_USER_PI ? "user-level prio-inheriting lock" : + self->sobj == SOBJ_SHUTTLE ? "shuttle" : "unknown"] = + quantize(timestamp - self->bedtime); + + self->sobj = 0; + self->bedtime = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/where.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/where.d new file mode 100644 index 00000000..af026244 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/where.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +sched:::on-cpu +{ + self->ts = timestamp; +} + +sched:::off-cpu +/self->ts/ +{ + @[cpu] = quantize(timestamp - self->ts); + self->ts = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whererun.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whererun.d new file mode 100644 index 00000000..ddd13f75 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whererun.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +dtrace:::BEGIN +{ + start = timestamp; +} + +sched:::on-cpu +/execname == $$1/ +{ + self->ts = timestamp; +} + +sched:::off-cpu +/self->ts/ +{ + @[cpu] = sum(timestamp - self->ts); + self->ts = 0; +} + +profile:::tick-1sec +/++x == 10/ +{ + exit(0); +} + +dtrace:::END +{ + printf("CPU distribution over %d seconds:\n\n", + (timestamp - start) / 1000000000); + printf("CPU microseconds\n--- ------------\n"); + normalize(@, 1000); + printa("%3d %@d\n", @); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whofor.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whofor.d new file mode 100644 index 00000000..f0243d60 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whofor.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +sched:::sleep +/!(curlwpsinfo->pr_flag & PR_ISSYS) && curlwpsinfo->pr_stype == SOBJ_CV/ +{ + bedtime[curlwpsinfo->pr_addr] = timestamp; +} + +sched:::wakeup +/bedtime[args[0]->pr_addr]/ +{ + @[stringof(args[1]->pr_fname), execname] = + quantize(timestamp - bedtime[args[0]->pr_addr]); + bedtime[args[0]->pr_addr] = 0; +} + +END +{ + printa("%s sleeping on %s:\n%@d\n", @); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whopreempt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whopreempt.d new file mode 100644 index 00000000..e8dd8633 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whopreempt.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +sched:::preempt +{ + self->preempt = 1; +} + +sched:::remain-cpu +/self->preempt/ +{ + self->preempt = 0; +} + +sched:::off-cpu +/self->preempt/ +{ + /* + * If we were told to preempt ourselves, see who we ended up giving + * the CPU to. + */ + @[stringof(args[1]->pr_fname), args[0]->pr_pri, execname, + curlwpsinfo->pr_pri] = count(); + self->preempt = 0; +} + +END +{ + printf("%30s %3s %30s %3s %5s\n", "PREEMPTOR", "PRI", + "PREEMPTED", "PRI", "#"); + printa("%30s %3d %30s %3d %5@d\n", @); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whoqueue.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whoqueue.d new file mode 100644 index 00000000..c2ab47a3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whoqueue.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet +#pragma D option nspec=4 +#pragma D option specsize=100k + +int maxlen; +int spec[int]; + +sched:::enqueue +{ + this->len = ++qlen[this->cpu = args[2]->cpu_id]; + in[args[0]->pr_addr] = timestamp; +} + +sched:::enqueue +/this->len > maxlen && spec[this->cpu]/ +{ + /* + * There is already a speculation for this CPU. We just set a new + * record, so we'll discard the old one. + */ + discard(spec[this->cpu]); +} + +sched:::enqueue +/this->len > maxlen/ +{ + /* + * We have a winner. Set the new maximum length and set the timestamp + * of the longest length. + */ + maxlen = this->len; + longtime[this->cpu] = timestamp; + + /* + * Now start a new speculation, and speculatively trace the length. + */ + this->spec = spec[this->cpu] = speculation(); + speculate(this->spec); + printf("Run queue of length %d:\n", this->len); +} + +sched:::dequeue +/(this->in = in[args[0]->pr_addr]) && + this->in <= longtime[this->cpu = args[2]->cpu_id]/ +{ + speculate(spec[this->cpu]); + printf(" %d/%d (%s)\n", + args[1]->pr_pid, args[0]->pr_lwpid, + stringof(args[1]->pr_fname)); +} + +sched:::dequeue +/qlen[args[2]->cpu_id]/ +{ + in[args[0]->pr_addr] = 0; + this->len = --qlen[args[2]->cpu_id]; +} + +sched:::dequeue +/this->len == 0 && spec[this->cpu]/ +{ + /* + * We just processed the last thread that was enqueued at the time + * of longest length; commit the speculation, which by now contains + * each thread that was enqueued when the queue was longest. + */ + commit(spec[this->cpu]); + spec[this->cpu] = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whosteal.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whosteal.d new file mode 100644 index 00000000..c698e4f1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/whosteal.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +sched:::dequeue +/args[2]->cpu_id != -1 && cpu != args[2]->cpu_id && + (curlwpsinfo->pr_flag & PR_IDLE)/ +{ + @[stringof(args[1]->pr_fname), args[2]->cpu_id] = + lquantize(cpu, 0, 100); +} + +END +{ + printa("%s stolen from CPU %d by:\n%@d\n", @); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/xterm.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/xterm.d new file mode 100644 index 00000000..bb5ed33c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/xterm.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +dtrace:::BEGIN +{ + start = timestamp; +} + +sched:::wakeup +/stringof(args[1]->pr_fname) == "xterm"/ +{ + @[execname] = lquantize((timestamp - start) / 1000000000, 0, 10); +} + +profile:::tick-1sec +/++x == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/xwork.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/xwork.d new file mode 100644 index 00000000..cbaf1057 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sched/xwork.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +self int last; + +sched:::wakeup +/self->last && args[0]->pr_stype == SOBJ_CV/ +{ + @[stringof(args[1]->pr_fname)] = sum(vtimestamp - self->last); + self->last = 0; +} + +sched:::wakeup +/execname == "Xsun" && self->last == 0/ +{ + self->last = vtimestamp; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/interp.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/interp.d new file mode 100644 index 00000000..c3e419ec --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/interp.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#!/usr/sbin/dtrace -s + +BEGIN +{ + trace("hello"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/syscall.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/syscall.d new file mode 100644 index 00000000..c47fb922 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/syscall.d @@ -0,0 +1,31 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall:::entry +/pid == $target/ +{ + @[probefunc] = count(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/tracewrite.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/tracewrite.d new file mode 100644 index 00000000..c1336cf7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/script/tracewrite.d @@ -0,0 +1,32 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#!/usr/sbin/dtrace -s + +syscall::write:entry +/pid == $1/ +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/callout.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/callout.d new file mode 100644 index 00000000..2044536f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/callout.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +sdt:::callout-start +{ + @callouts[((callout_t *)arg0)->c_func] = count(); +} + +tick-1sec +{ + printa("%40a %10@d\n", @callouts); + clear(@callouts); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/interval.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/interval.d new file mode 100644 index 00000000..d4a6a320 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/interval.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma D option quiet + +sdt:::callout-start +{ + self->callout = ((callout_t *)arg0)->c_func; +} + +fbt::timeout:entry +/self->callout && arg2 <= 100/ +{ + /* + * In this case, we are most interested in interval timeout(9F)s that + * are short. We therefore do a linear quantization from 0 ticks to + * 100 ticks. The system clock's frequency ? set by the variable + * "hz" ? defaults to 100, so 100 system clock ticks is one second. + */ + @callout[self->callout] = lquantize(arg2, 0, 100); +} + +sdt:::callout-end +{ + self->callout = NULL; +} + +END +{ + printa("%a\n%@d\n\n", @callout); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/intr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/intr.d new file mode 100644 index 00000000..5233450f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sdt/intr.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +interrupt-start +{ + self->ts = vtimestamp; +} + +interrupt-complete +/self->ts/ +{ + this->devi = (struct dev_info *)arg0; + @[stringof(`devnamesp[this->devi->devi_major].dn_name), + this->devi->devi_instance] = quantize(vtimestamp - self->ts); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/spec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/spec.d new file mode 100644 index 00000000..dc162a1b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/spec.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::open:entry +{ + self->spec = speculation(); +} + +syscall::: +/self->spec/ +{ + speculate(self->spec); + printf("this is speculative"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/specopen.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/specopen.d new file mode 100644 index 00000000..f1975ff8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/spec/specopen.d @@ -0,0 +1,93 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#!/usr/sbin/dtrace -Fs + +syscall::open:entry, +syscall::open64:entry +{ + /* + * The call to speculation() creates a new speculation. If this fails, + * dtrace(1M) will generate an error message indicating the reason for + * the failed speculation(), but subsequent speculative tracing will be + * silently discarded. + */ + self->spec = speculation(); + speculate(self->spec); + + /* + * Because this printf() follows the speculate(), it is being + * speculatively traced; it will only appear in the data buffer if the + * speculation is subsequently commited. + */ + printf("%s", stringof(copyinstr(arg0))); +} + +fbt::: +/self->spec/ +{ + /* + * A speculate() with no other actions speculates the default action: + * tracing the EPID. + */ + speculate(self->spec); +} + +syscall::open:return, +syscall::open64:return +/self->spec/ +{ + /* + * To balance the output with the -F option, we want to be sure that + * every entry has a matching return. Because we speculated the + * open entry above, we want to also speculate the open return. + * This is also a convenient time to trace the errno value. + */ + speculate(self->spec); + trace(errno); +} + +syscall::open:return, +syscall::open64:return +/self->spec && errno != 0/ +{ + /* + * If errno is non-zero, we want to commit the speculation. + */ + commit(self->spec); + self->spec = 0; +} + +syscall::open:return, +syscall::open64:return +/self->spec && errno == 0/ +{ + /* + * If errno is not set, we discard the speculation. + */ + discard(self->spec); + self->spec = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/kstat.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/kstat.d new file mode 100644 index 00000000..1b40ddaa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/kstat.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +pid$1:libkstat:kstat_data_lookup:entry +{ + self->ksname = arg1; +} + +pid$1:libkstat:kstat_data_lookup:return +/self->ksname != NULL && arg1 != NULL/ +{ + this->ksp = (kstat_named_t *) copyin(arg1, sizeof (kstat_named_t)); + printf("%s has ui64 value %u\n", + copyinstr(self->ksname), this->ksp->value.ui64); +} + +pid$1:libkstat:kstat_data_lookup:return +/self->ksname != NULL && arg1 == NULL/ +{ + self->ksname = NULL; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/ksyms.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/ksyms.d new file mode 100644 index 00000000..ab2f1cb5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/ksyms.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * When our strings(1) invocation starts a read(2), set a watched flag on + * the current thread. When the read(2) finishes, clear the watched flag. + */ +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; +} + +/* + * Instrument uiomove(9F). The prototype for this function is as follows: + * int uiomove(caddr_t addr, size_t nbytes, enum uio_rw rwflag, uio_t *uio); + */ +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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/rwinfo.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/rwinfo.d new file mode 100644 index 00000000..866678ef --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/struct/rwinfo.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +struct callinfo { + uint64_t ts; /* timestamp of last syscall entry */ + uint64_t elapsed; /* total elapsed time in nanoseconds */ + uint64_t calls; /* number of calls made */ + size_t maxbytes; /* maximum byte count argument */ +}; + +struct callinfo i[string]; /* declare i as an associative array */ + +syscall::read:entry, syscall::write:entry +/pid == $1/ +{ + 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 == $1/ +{ + 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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sysinfo/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sysinfo/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sysinfo/find.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sysinfo/find.d new file mode 100644 index 00000000..d927072c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/sysinfo/find.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall:::entry +/execname == "find"/ +{ + self->syscall = probefunc; + self->insys = 1; +} + +sysinfo:::xcalls +/execname == "find"/ +{ + @[self->insys ? self->syscall : ""] = count(); +} + +syscall:::return +/self->insys/ +{ + self->insys = 0; + self->syscall = NULL; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcp1stbyte.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcp1stbyte.d new file mode 100755 index 00000000..94001296 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcp1stbyte.d @@ -0,0 +1,37 @@ +#!/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 (c) 2010, Oracle and/or its affiliates. All rights reserved. + */ + +tcp:::connect-established +{ + start[args[1]->cs_cid] = timestamp; +} + +tcp:::receive +/start[args[1]->cs_cid] && (args[2]->ip_plength - args[4]->tcp_offset) > 0/ +{ + @latency["1st Byte Latency (ns)", args[2]->ip_saddr] = + quantize(timestamp - start[args[1]->cs_cid]); + start[args[1]->cs_cid] = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpbytes.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpbytes.d new file mode 100755 index 00000000..7fb68de9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpbytes.d @@ -0,0 +1,36 @@ +#!/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 (c) 2010, Oracle and/or its affiliates. All rights reserved. + */ + +tcp:::receive +{ + @bytes[args[2]->ip_saddr, args[4]->tcp_dport] = + sum(args[2]->ip_plength - args[4]->tcp_offset); +} + +tcp:::send +{ + @bytes[args[2]->ip_daddr, args[4]->tcp_sport] = + sum(args[2]->ip_plength - args[4]->tcp_offset); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpbytesstat.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpbytesstat.d new file mode 100755 index 00000000..ecd9b044 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpbytesstat.d @@ -0,0 +1,45 @@ +#!/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 (c) 2010, Oracle and/or its affiliates. All rights reserved. + */ + +#pragma D option quiet + +tcp:::receive +{ + @bytes[args[2]->ip_saddr, args[4]->tcp_dport] = + sum(args[2]->ip_plength - args[4]->tcp_offset); +} + +tcp:::send +{ + @bytes[args[2]->ip_daddr, args[4]->tcp_sport] = + sum(args[2]->ip_plength - args[4]->tcp_offset); +} + +profile:::tick-1sec +{ + printf("\n %-32s %16s\n", "HOST", "BYTES/s"); + printa(" %-32s %@16d\n", @bytes); + trunc(@bytes); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpconnlat.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpconnlat.d new file mode 100755 index 00000000..bc395f97 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpconnlat.d @@ -0,0 +1,37 @@ +#!/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 (c) 2010, Oracle and/or its affiliates. All rights reserved. + */ + +tcp:::connect-request +{ + start[args[1]->cs_cid] = timestamp; +} + +tcp:::connect-established +/start[args[1]->cs_cid] / +{ + @latency["Connect Latency (ns)", args[3]->tcps_raddr] = + quantize(timestamp - start[args[1]->cs_cid]); + start[args[1]->cs_cid] = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpio.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpio.d new file mode 100755 index 00000000..b3628430 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpio.d @@ -0,0 +1,32 @@ +#!/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 (c) 2010, Oracle and/or its affiliates. All rights reserved. + */ + +tcp:::send, +tcp:::receive +{ + printf("%15s:%-5d -> %15s:%-5d", + args[2]->ip_saddr, args[4]->tcp_sport, + args[2]->ip_daddr, args[4]->tcp_dport); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpioflags.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpioflags.d new file mode 100755 index 00000000..cdfbd2aa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpioflags.d @@ -0,0 +1,64 @@ +#!/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 (c) 2010, Oracle and/or its affiliates. All rights reserved. + */ + +#pragma D option quiet +#pragma D option switchrate=10hz + +dtrace:::BEGIN +{ + printf(" %15s:%-5s %15s:%-5s %6s %s\n", + "LADDR", "PORT", "RADDR", "PORT", "BYTES", "FLAGS"); +} + +tcp:::send +{ + this->length = args[2]->ip_plength - args[4]->tcp_offset; + printf(" %15s:%-5d -> %15s:%-5d %6d (", + args[2]->ip_saddr, args[4]->tcp_sport, + args[2]->ip_daddr, args[4]->tcp_dport, this->length); +} + +tcp:::receive +{ + this->length = args[2]->ip_plength - args[4]->tcp_offset; + printf(" %15s:%-5d <- %15s:%-5d %6d (", + args[2]->ip_daddr, args[4]->tcp_dport, + args[2]->ip_saddr, args[4]->tcp_sport, this->length); +} + +tcp:::send, +tcp:::receive +{ + printf("%s", args[4]->tcp_flags & TH_FIN ? "FIN|" : ""); + printf("%s", args[4]->tcp_flags & TH_SYN ? "SYN|" : ""); + printf("%s", args[4]->tcp_flags & TH_RST ? "RST|" : ""); + printf("%s", args[4]->tcp_flags & TH_PUSH ? "PUSH|" : ""); + printf("%s", args[4]->tcp_flags & TH_ACK ? "ACK|" : ""); + printf("%s", args[4]->tcp_flags & TH_URG ? "URG|" : ""); + printf("%s", args[4]->tcp_flags & TH_ECE ? "ECE|" : ""); + printf("%s", args[4]->tcp_flags & TH_CWR ? "CWR|" : ""); + printf("%s", args[4]->tcp_flags == 0 ? "null " : ""); + printf("\b)\n"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpsnoop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpsnoop.d new file mode 100755 index 00000000..9d44519e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpsnoop.d @@ -0,0 +1,78 @@ +#!/usr/sbin/dtrace -s +/* + * tcpsnoop - snoop TCP network packets by process. + * Written using DTrace tcp Provider. + * + * This analyses TCP network packets and prints the responsible PID plus + * standard details such as IP address and port. This captures traffic + * from existing and newly created TCP connections. It can help identify + * which processes are causing TCP traffic. + * + * SEE ALSO: snoop -rS + * + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * + * Portions Copyright 2010 Brendan Gregg + */ + +#pragma D option quiet +#pragma D option switchrate=10hz + +dtrace:::BEGIN +{ + printf("%6s %6s %15s:%-5s %15s:%-5s %6s %s\n", + "TIME", "PID", "LADDR", "PORT", "RADDR", "PORT", "BYTES", "FLAGS"); +} + +tcp:::send +{ + this->length = args[2]->ip_plength - args[4]->tcp_offset; + printf("%6d %6d %15s:%-5d -> %15s:%-5d %6d (", + timestamp/1000, args[1]->cs_pid, args[2]->ip_saddr, + args[4]->tcp_sport, args[2]->ip_daddr, args[4]->tcp_dport, + this->length); +} + +tcp:::receive +{ + this->length = args[2]->ip_plength - args[4]->tcp_offset; + printf("%6d %6d %15s:%-5d <- %15s:%-5d %6d (", + timestamp/1000, args[1]->cs_pid, args[2]->ip_daddr, + args[4]->tcp_dport, args[2]->ip_saddr, args[4]->tcp_sport, + this->length); +} + +tcp:::send, +tcp:::receive +{ + printf("%s", args[4]->tcp_flags & TH_FIN ? "FIN|" : ""); + printf("%s", args[4]->tcp_flags & TH_SYN ? "SYN|" : ""); + printf("%s", args[4]->tcp_flags & TH_RST ? "RST|" : ""); + printf("%s", args[4]->tcp_flags & TH_PUSH ? "PUSH|" : ""); + printf("%s", args[4]->tcp_flags & TH_ACK ? "ACK|" : ""); + printf("%s", args[4]->tcp_flags & TH_URG ? "URG|" : ""); + printf("%s", args[4]->tcp_flags & TH_ECE ? "ECE|" : ""); + printf("%s", args[4]->tcp_flags & TH_CWR ? "CWR|" : ""); + printf("%s", args[4]->tcp_flags == 0 ? "null " : ""); + printf("\b)\n"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpstate.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpstate.d new file mode 100755 index 00000000..38f0470a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcpstate.d @@ -0,0 +1,39 @@ +#!/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 (c) 2010, Oracle and/or its affiliates. All rights reserved. + */ + +#pragma D option quiet + +dtrace:::BEGIN +{ + printf("%-10s %-10s %-20s %-20s\n", "C", "PID", "PREV", "NEW"); +} + + +tcp:::state-change +{ + printf("%-10d %-10d %-20s -> %-20s\n", cpu, args[1]->cs_pid, + tcp_state_string[args[5]->tcps_state], + tcp_state_string[args[3]->tcps_state]); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcptop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcptop.d new file mode 100755 index 00000000..450f496e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/tcp/tcptop.d @@ -0,0 +1,138 @@ +#!/usr/sbin/dtrace -s +/* + * tcptop: display top TCP network packets by process. + * Written using DTrace tcp Provider. + * + * Usage: dtrace -s tcptop.d [count] [interval] + * + * This analyses TCP network packets and prints the responsible PID plus + * standard details such as IP address and port. This captures traffic + * of newly created TCP connections that were established while this program + * was running along with traffic from existing connections. It can help + * identify which processes is causing TCP traffic. + * + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * + * Portions Copyright 2010 Brendan Gregg + */ + +#pragma D option quiet +#pragma D option defaultargs +#pragma D option switchrate=10hz + +/* + * Print header + */ +dtrace:::BEGIN +{ + /* starting values */ + counts = $1 ? $1 : 10; + secs = $2 ? $2 : 5; + TCP_out = 0; + TCP_in = 0; + + printf("Sampling... Please wait.\n"); +} + + +tcp:::send +/ args[1]->cs_pid != -1 / +{ + @out[args[1]->cs_zoneid, args[1]->cs_pid, args[2]->ip_saddr, + args[4]->tcp_sport, args[2]->ip_daddr, args[4]->tcp_dport] = + sum(args[2]->ip_plength - args[4]->tcp_offset); +} + +tcp:::receive +/ args[1]->cs_pid != -1 / +{ + @out[args[1]->cs_zoneid, args[1]->cs_pid, args[2]->ip_daddr, + args[4]->tcp_dport, args[2]->ip_saddr, args[4]->tcp_sport] = + sum(args[2]->ip_plength - args[4]->tcp_offset); +} + +/* + * TCP Systemwide Stats + */ +mib:::tcpOutDataBytes { TCP_out += args[0]; } +mib:::tcpRetransBytes { TCP_out += args[0]; } +mib:::tcpInDataInorderBytes { TCP_in += args[0]; } +mib:::tcpInDataDupBytes { TCP_in += args[0]; } +mib:::tcpInDataUnorderBytes { TCP_in += args[0]; } + +profile:::tick-1sec +/secs != 0/ +{ + secs--; +} + +/* + * Print Report + */ +profile:::tick-1sec +/secs == 0/ +{ + /* fetch 1 min load average */ + this->load1a = `hp_avenrun[0] / 65536; + this->load1b = ((`hp_avenrun[0] % 65536) * 100) / 65536; + + /* convert TCP counters to Kb */ + TCP_out /= 1024; + TCP_in /= 1024; + + /* print status */ + printf("%Y, load: %d.%02d, TCPin: %6d Kb, TCPout: %6d Kb\n\n", + walltimestamp, this->load1a, this->load1b, TCP_in, TCP_out); + + /* print headers */ + printf("%6s %6s %-15s %5s %-15s %5s %9s\n", + "ZONE", "PID", "LADDR", "LPORT", "RADDR", "RPORT", "SIZE"); + + /* print data */ + printa("%6d %6d %-15s %5d %-15s %5d %@9d\n", @out); + printf("\n"); + + /* clear data */ + trunc(@out); + TCP_in = 0; + TCP_out = 0; + secs = 5; + counts--; +} + +/* + * End of program + */ +profile:::tick-1sec +/counts == 0/ +{ + exit(0); +} + +/* + * Cleanup for Ctrl-C + */ +dtrace:::END +{ + trunc(@out); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpbytes.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpbytes.d new file mode 100755 index 00000000..29d85fcd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpbytes.d @@ -0,0 +1,36 @@ +#!/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 (c) 2010, Oracle and/or its affiliates. All rights reserved. + */ + +udp:::receive +{ + @bytes[args[2]->ip_saddr, args[4]->udp_dport] = + sum(args[4]->udp_length); +} + +udp:::send +{ + @bytes[args[2]->ip_daddr, args[4]->udp_sport] = + sum(args[4]->udp_length); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpbytesstat.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpbytesstat.d new file mode 100755 index 00000000..58fa826a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpbytesstat.d @@ -0,0 +1,45 @@ +#!/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 (c) 2010, Oracle and/or its affiliates. All rights reserved. + */ + +#pragma D option quiet + +udp:::receive +{ + @bytes[args[2]->ip_saddr, args[4]->udp_dport] = + sum(args[4]->udp_length); +} + +udp:::send +{ + @bytes[args[2]->ip_daddr, args[4]->udp_sport] = + sum(args[4]->udp_length); +} + +profile:::tick-1sec +{ + printf("\n %-32s %16s\n", "HOST", "BYTES/s"); + printa(" %-32s %@16d\n", @bytes); + trunc(@bytes); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpio.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpio.d new file mode 100755 index 00000000..78b3f482 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpio.d @@ -0,0 +1,32 @@ +#!/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 (c) 2010, Oracle and/or its affiliates. All rights reserved. + */ + +udp:::send, +udp:::receive +{ + printf("%15s:%-5d -> %15s:%-5d", + args[2]->ip_saddr, args[4]->udp_sport, + args[2]->ip_daddr, args[4]->udp_dport); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpsnoop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpsnoop.d new file mode 100755 index 00000000..fffc2904 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udpsnoop.d @@ -0,0 +1,59 @@ +#!/usr/sbin/dtrace -s +/* + * udpsnoop - snoop UDP network packets by process. + * Written using DTrace udp Provider. + * + * This analyses UDP network packets and prints the responsible PID plus + * standard details such as IP address and port. This captures traffic + * from existing and newly created UDP connections. It can help identify + * which processes are causing UDP traffic. + * + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * + * Portions Copyright 2010 Brendan Gregg + */ + +#pragma D option quiet +#pragma D option switchrate=10hz + +dtrace:::BEGIN +{ + printf("%6s %6s %15s:%-5s %15s:%-5s %6s\n", + "TIME", "PID", "LADDR", "PORT", "RADDR", "PORT", "BYTES"); +} + +udp:::send +{ + printf("%6d %6d %15s:%-5d -> %15s:%-5d %6d\n", + timestamp/1000, args[1]->cs_pid, args[2]->ip_saddr, + args[4]->udp_sport, args[2]->ip_daddr, args[4]->udp_dport, + args[4]->udp_length); +} + +udp:::receive +{ + printf("%6d %6d %15s:%-5d <- %15s:%-5d %6d\n", + timestamp/1000, args[1]->cs_pid, args[2]->ip_daddr, + args[4]->udp_dport, args[2]->ip_saddr, args[4]->udp_sport, + args[4]->udp_length); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udptop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udptop.d new file mode 100755 index 00000000..a626e571 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/udp/udptop.d @@ -0,0 +1,133 @@ +#!/usr/sbin/dtrace -s +/* + * udptop: display top UDP network packets by process. + * Written using DTrace udp Provider. + * + * Usage: dtrace -s udptop.d [count] [interval] + * + * This analyses UDP network packets and prints the responsible PID plus + * standard details such as IP address and port. This captures traffic + * of newly created UDP connections that were established while this program + * was running along with traffic from existing connections. It can help + * identify which processes is causing UDP traffic. + * + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + */ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * + * Portions Copyright 2010 Brendan Gregg + */ + +#pragma D option quiet +#pragma D option defaultargs +#pragma D option switchrate=10hz + +/* + * Print header + */ +dtrace:::BEGIN +{ + /* starting values */ + counts = $1 ? $1 : 10; + secs = $2 ? $2 : 5; + UDP_out = 0; + UDP_in = 0; + + printf("Sampling... Please wait.\n"); +} + + +udp:::send +/ args[1]->cs_pid != -1 / +{ + @out[args[1]->cs_zoneid, args[1]->cs_pid, args[2]->ip_saddr, + args[4]->udp_sport, args[2]->ip_daddr, args[4]->udp_dport] = + sum(args[4]->udp_length); +} + +udp:::receive +/ args[1]->cs_pid != -1 / +{ + @out[args[1]->cs_zoneid, args[1]->cs_pid, args[2]->ip_daddr, + args[4]->udp_dport, args[2]->ip_saddr, args[4]->udp_sport] = + sum(args[4]->udp_length); +} + +/* + * UDP Systemwide Stats + */ +mib:::udpHCOutDatagrams { UDP_out += args[0]; } +mib:::udpHCInDatagrams { UDP_in += args[0]; } + +profile:::tick-1sec +/secs != 0/ +{ + secs--; +} + +/* + * Print Report + */ +profile:::tick-1sec +/secs == 0/ +{ + /* fetch 1 min load average */ + this->load1a = `hp_avenrun[0] / 65536; + this->load1b = ((`hp_avenrun[0] % 65536) * 100) / 65536; + + /* print status */ + printf(%Y, load: %d.%02d, UDP datagrams in: %6d, ", + walltimestamp, this->load1a, this->load1b, UDP_in); + printf("UDP datagrams out: %6d\n\n", UDP_out); + + /* print headers */ + printf("%6s %6s %-15s %5s %-15s %5s %9s\n", + "ZONE", "PID", "LADDR", "LPORT", "RADDR", "RPORT", "SIZE"); + + /* print data */ + printa("%6d %6d %-15s %5d %-15s %5d %@9d\n", @out); + printf("\n"); + + /* clear data */ + trunc(@out); + UDP_in = 0; + UDP_out = 0; + secs = 5; + counts--; +} + +/* + * End of program + */ +profile:::tick-1sec +/counts == 0/ +{ + exit(0); +} + +/* + * Cleanup for Ctrl-C + */ +dtrace:::END +{ + trunc(@out); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/badopen.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/badopen.d new file mode 100644 index 00000000..7e6d22b7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/badopen.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +syscall::open:entry +/pid == $1/ +{ + self->path = copyinstr(arg0); +} + +syscall::open:return +/self->path != NULL && arg1 == -1/ +{ + printf("open for '%s' failed", self->path); + ustack(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/errorpath.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/errorpath.d new file mode 100644 index 00000000..95c82e51 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/errorpath.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +pid$1::$2:entry +{ + self->spec = speculation(); + speculate(self->spec); + printf("%x %x %x %x %x", arg0, arg1, arg2, arg3, arg4); +} + +pid$1::$2: +/self->spec/ +{ + speculate(self->spec); +} + +pid$1::$2:return +/self->spec && arg1 == 0/ +{ + discard(self->spec); + self->spec = 0; +} + +pid$1::$2:return +/self->spec && arg1 != 0/ +{ + commit(self->spec); + self->spec = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/libc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/libc.d new file mode 100644 index 00000000..92b20cfe --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/libc.d @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +pid$target:libc.so::entry +{ + @[probefunc] = count(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/userfunc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/userfunc.d new file mode 100644 index 00000000..0c98d675 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/user/userfunc.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/clause.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/clause.d new file mode 100644 index 00000000..056329fe --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/clause.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +int me; /* an integer global variable */ +this int foo; /* an integer clause-local variable */ + +tick-1sec +{ + /* + * Set foo to be 10 if and only if this is the first clause executed. + */ + this->foo = (me % 3 == 0) ? 10 : this->foo; + printf("Clause 1 is number %d; foo is %d\n", me++ % 3, this->foo++); +} + +tick-1sec +{ + /* + * Set foo to be 20 if and only if this is the first clause executed. + */ + this->foo = (me % 3 == 0) ? 20 : this->foo; + printf("Clause 2 is number %d; foo is %d\n", me++ % 3, this->foo++); +} + +tick-1sec +{ + /* + * Set foo to be 30 if and only if this is the first clause executed. + */ + this->foo = (me % 3 == 0) ? 30 : this->foo; + printf("Clause 3 is number %d; foo is %d\n", me++ % 3, this->foo++); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/rtime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/rtime.d new file mode 100644 index 00000000..e2db52f3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vars/rtime.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +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); + + /* + * We're done with this thread-local variable; assign zero to it to + * allow the DTrace runtime to reclaim the underlying storage. + */ + self->t = 0; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vminfo/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vminfo/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vminfo/soffice.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vminfo/soffice.d new file mode 100644 index 00000000..fa6435cf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/vminfo/soffice.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, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +vminfo:::maj_fault, +vminfo:::zfod, +vminfo:::as_fault +/execname == "soffice.bin" && start == 0/ +{ + /* + * This is the first time that a vminfo probe has been hit; record + * our initial timestamp. + */ + start = timestamp; +} + +vminfo:::maj_fault, +vminfo:::zfod, +vminfo:::as_fault +/execname == "soffice.bin"/ +{ + /* + * Aggregate on the probename, and lquantize() the number of seconds + * since our initial timestamp. (There are 1,000,000,000 nanoseconds + * in a second.) We assume that the script will be terminated before + * 60 seconds elapses. + */ + @[probename] = + lquantize((timestamp - start) / 1000000000, 0, 60); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/dtrace.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/dtrace.c new file mode 100644 index 00000000..624ca872 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/dtrace.c @@ -0,0 +1,2085 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef VBOX +#pragma ident "%Z%%M% %I% %E% SMI" +#endif + +#include +#include +#ifndef _MSC_VER +# include +#endif + +#include +#include +#include +#include +#ifndef VBOX +# include +#endif +#ifndef _MSC_VER +# include +#else +# include +# include +#endif +#include +#include +#include +#include +#ifndef VBOX +#include +#include +#include +#endif + +#ifdef VBOX +# include + +# include +# include +# include +# include +# include +# include +# include +# include + +# include "VBoxDTraceLibCWrappers.h" + +# ifdef _MSC_VER +# pragma warning(disable:4267) /* size_t conversion warnings */ +# pragma warning(disable:4018) /* signed/unsigned mismatch */ +# endif +#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 + +#ifndef VBOX +static const char DTRACE_OPTSTR[] = + "3:6:aAb:Bc:CD:ef:FGhHi:I:lL:m:n:o:p:P:qs:SU:vVwx:X:Z"; +#else +static const RTGETOPTDEF g_aOptions[] = +{ + { "-32", 10064, RTGETOPT_REQ_NOTHING }, + { "-64", 10032, RTGETOPT_REQ_NOTHING }, + { NULL, 'a', RTGETOPT_REQ_NOTHING }, + { NULL, 'A', RTGETOPT_REQ_NOTHING }, + { NULL, 'b', RTGETOPT_REQ_STRING }, + { NULL, 'B', RTGETOPT_REQ_NOTHING }, + { NULL, 'c', RTGETOPT_REQ_STRING }, + { NULL, 'C', RTGETOPT_REQ_NOTHING }, + { NULL, 'D', RTGETOPT_REQ_STRING }, + { NULL, 'e', RTGETOPT_REQ_NOTHING }, + { NULL, 'f', RTGETOPT_REQ_STRING }, + { NULL, 'F', RTGETOPT_REQ_NOTHING }, + { NULL, 'G', RTGETOPT_REQ_NOTHING }, + { NULL, 'h', RTGETOPT_REQ_NOTHING }, + { NULL, 'H', RTGETOPT_REQ_NOTHING }, + { NULL, 'i', RTGETOPT_REQ_STRING }, + { NULL, 'I', RTGETOPT_REQ_STRING }, + { NULL, 'l', RTGETOPT_REQ_NOTHING }, + { NULL, 'L', RTGETOPT_REQ_STRING }, + { NULL, 'M', RTGETOPT_REQ_STRING }, + { NULL, 'n', RTGETOPT_REQ_STRING }, + { NULL, 'o', RTGETOPT_REQ_STRING }, + { NULL, 'p', RTGETOPT_REQ_STRING }, + { NULL, 'P', RTGETOPT_REQ_STRING }, + { NULL, 'q', RTGETOPT_REQ_NOTHING }, + { NULL, 's', RTGETOPT_REQ_STRING }, + { NULL, 'S', RTGETOPT_REQ_NOTHING }, + { NULL, 'U', RTGETOPT_REQ_STRING }, + { NULL, 'v', RTGETOPT_REQ_NOTHING }, + { NULL, 'V', RTGETOPT_REQ_NOTHING }, + { NULL, 'w', RTGETOPT_REQ_NOTHING }, + { NULL, 'x', RTGETOPT_REQ_STRING }, + { NULL, 'X', RTGETOPT_REQ_STRING }, + { NULL, 'Z', RTGETOPT_REQ_NOTHING }, +}; +#endif /* VBOX */ + + +static char **g_argv; +static int g_argc; +#ifndef VBOX /* No linking. */ +static char **g_objv; +static int g_objc; +#endif +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; +#ifdef VBOX /* Added volatile to signal handler variables. */ +static int volatile g_intr; +static int volatile g_impatient; +static int volatile g_newline; +#else +static int g_intr; +static int g_impatient; +static int g_newline; +#endif +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; +#ifndef VBOX /* stdout isn't a necessarily constant usable like this in C code. */ +static FILE *g_ofp = stdout; +#else +static FILE *g_ofp = NULL; +#endif +static dtrace_hdl_t *g_dtp; +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 }; + +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) fputs( + "\tpredicate -> '/' D-expression '/'\n" + "\t action -> '{' D-statements '}'\n", fp); + + (void) fputs( + "\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", fp); + (void) fputs( + "\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", fp); + (void) fputs( + "\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", fp); + (void) fputs( + "\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", fp); + (void) fputs( + "\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", fp); + (void) fputs( + "\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", fp); + + 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, ...) +{ + 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))); + } + + /* + * 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); + } +} + +#ifndef VBOX +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); +} +#endif /* !VBOX */ + +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 ((size_t/*vbox*/)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 ((size_t/*vbox*/)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 ((size_t/*vbox*/)write(fd, &buf[mark], sz - mark) != sz - mark) + fatal("failed to write to %s", fname); + } + + (void) close(fd); + free(buf); +} + +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 ((size_t/*vbox*/)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)) < (ssize_t/*vbox*/)strlen(buf)) { + (void) unlink(tmpname); + fatal("failed to write to %s", tmpname); + } + + (void) close(fd); + +#ifndef _MSC_VER + 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); + } +#endif + + 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); +} + +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; + RT_NOREF1(pgp); + + 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; + + oprintf("dof-data-%d=0x%x", n, *p++); + + while (p < q) + oprintf(",0x%x", *p++); + + oprintf(";\n"); + dtrace_dof_destroy(g_dtp, dof); +} + +#ifndef VBOX +/* + * 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); +} +#endif /* !VBOX */ + +/*ARGSUSED*/ +static int +list_probe(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp, void *arg) +{ + dtrace_probeinfo_t p; + RT_NOREF1(arg); + + 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; + RT_NOREF1(pgp); + + 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) +{ +#ifndef VBOX + 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; + } +#else + RT_NOREF3(P, msg, arg); +#endif /* VBOX */ +} + +/*ARGSUSED*/ +static int +errhandler(const dtrace_errdata_t *data, void *arg) +{ + RT_NOREF1(arg); + error(data->dteda_msg); + return (DTRACE_HANDLE_OK); +} + +/*ARGSUSED*/ +static int +drophandler(const dtrace_dropdata_t *data, void *arg) +{ + RT_NOREF1(arg); + error(data->dtdda_msg); + return (DTRACE_HANDLE_OK); +} + +/*ARGSUSED*/ +static int +setopthandler(const dtrace_setoptdata_t *data, void *arg) +{ + RT_NOREF1(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 ? ":" : ""); + +#ifdef VBOX /* The orignal upsets VC++ 14.1 with variable 'c' shadowing variable in the function. + * This version is faster and does not try to print '\0' as that doesn't look like it's intentional */ +#define BUFDUMPSTR(ptr, field) do { \ + const char *pszField = (ptr)->field; \ + if (pszField) { \ + const char *pszStart = pszField; \ + char ch; \ + printf("%s: %20s => \"", g_pname, #field); \ + while ((ch = *pszField) != '\0') { \ + if (ch != '\n') \ + pszField++; \ + else { \ + printf("%*.*s\\n", (int)(pszField - pszStart), \ + (int)(pszField - pszStart), pszStart); \ + pszStart = ++pszField; \ + } \ + } \ + printf("%*.*s\"", (int)(pszField - pszStart), \ + (int)(pszField - pszStart), pszStart); \ + } else { \ + printf("%s: %20s => \n", g_pname, #field); \ + } \ +} while (0) +#else +#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"); \ + } +#endif + +#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 } + }; + RT_NOREF1(arg); + + 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; + RT_NOREF1(arg); + + 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; + RT_NOREF1(arg); + + 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; +#ifdef _MSC_VER + /* Reinstall signal handler. Seems MSVCRT is System V style. */ + signal(signo, intr); +#else + RT_NOREF(signo); +#endif +} + +#ifdef VBOX +DECLEXPORT(int) RTCALL VBoxDTraceMain(int argc, char **argv) +#else +int +main(int argc, char *argv[]) +#endif +{ + dtrace_bufdesc_t buf; +#ifndef _MSC_VER + struct sigaction act, oact; +#endif + dtrace_status_t status[2]; + dtrace_optval_t opt; + dtrace_cmd_t *dcp; + + int done = 0, mode = 0; + int err, i; +#ifndef VBOX + char c, *p, **v; + struct ps_prochandle *P; + pid_t pid; + + g_pname = basename(argv[0]); +#else + int c; + char *p; + RTGETOPTUNION ValueUnion; + RTGETOPTSTATE GetState; + + err = RTR3InitDll(0); + if (RT_FAILURE(err)) + return RTMsgInitFailure(err); + dtrace_init(); + + g_ofp = stdout; + g_pname = (char *)RTProcShortName(); +#endif + + 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. + */ +#ifndef VBOX + for (optind = 1; optind < argc; optind++) { + while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != EOF) { +#else + RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, 0); + while ((c = RTGetOpt(&GetState, &ValueUnion))) { + { + /* const char *optarg = ValueUnion.psz; - unused */ +#endif + switch (c) { +#ifndef VBOX + case '3': + if (strcmp(optarg, "2") != 0) { + (void) fprintf(stderr, + "%s: illegal option -- 3%s\n", + argv[0], optarg); + return (usage(stderr)); + } +#else + case 10032: +#endif + g_oflags &= ~DTRACE_O_LP64; + g_oflags |= DTRACE_O_ILP32; + break; + +#ifndef VBOX + case '6': + if (strcmp(optarg, "4") != 0) { + (void) fprintf(stderr, + "%s: illegal option -- 6%s\n", + argv[0], optarg); + return (usage(stderr)); + } +#else + case 10064: +#endif + 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; + +#ifndef VBOX + case 'G': + g_mode = DMODE_LINK; + g_oflags |= DTRACE_O_NODEV; + g_cflags |= DTRACE_C_ZDEFS; /* -G implies -Z */ + g_exec = 0; + mode++; + break; +#endif + + case 'l': + g_mode = DMODE_LIST; + g_cflags |= DTRACE_C_ZDEFS; /* -l implies -Z */ + mode++; + break; + + case 'V': + g_mode = DMODE_VERS; + mode++; + break; + +#ifndef VBOX + default: + if (strchr(DTRACE_OPTSTR, c) == NULL) + return (usage(stderr)); +#else + case 'c': + case 'p': + case 'G': + fprintf(stderr, "%s: -%c is not supported\n", g_pname, c); + return (E_USAGE); + + case VINF_GETOPT_NOT_OPTION: + g_argv[g_argc++] = (char *)ValueUnion.psz; + break; + + default: + if (c < 0) { /* Note: Not all options are handled. */ + RTGetOptPrintError(c, &ValueUnion); + return (usage(stderr)); + } +#endif + } + } + +#ifndef VBOX + if (optind < argc) + g_argv[g_argc++] = argv[optind]; +#endif + } + + 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); + +#ifndef VBOX + /* + * 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; + } + } + } +#endif /* !VBOX */ + + /* + * 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)); + } + + (void) dtrace_setopt(g_dtp, "bufsize", "4m"); + (void) dtrace_setopt(g_dtp, "aggsize", "4m"); + + /* + * 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) { +#ifndef VBOX /* No link mode. */ + (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 /* VBOX */ + AssertFailed(); +#endif /* VBOX */ + } 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. + */ +#ifndef VBOX + for (optind = 1; optind < argc; optind++) { + while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != EOF) { +#else + RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, 0); + while ((c = RTGetOpt(&GetState, &ValueUnion))) { + { + char *optarg = (char *)ValueUnion.psz; +#endif + + 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; + +#ifndef VBOX + default: + if (strchr(DTRACE_OPTSTR, c) == NULL) + return (usage(stderr)); +#else + default: + if (c < 0) { /* Note: Not all options are handled. */ + RTGetOptPrintError(c, &ValueUnion); + return (usage(stderr)); + } +#endif + } + } + } + + 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); + } + +#ifndef VBOX + /* + * 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. + */ +# ifndef VBOX + for (optind = 1; optind < argc; optind++) { + while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != EOF) { +# else + RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, 0); + while ((c = RTGetOpt(&GetState, &ValueUnion))) { + { + char *optarg = (char *)ValueUnion.psz; +# endif + switch (c) { + case 'c': + if ((v = make_argv(optarg)) == NULL) + fatal("failed to allocate memory"); + + P = dtrace_proc_create(g_dtp, v[0], v); + 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; + } + } + } +#endif /* !VBOX */ + + /* + * 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) + g_ofile = "/kernel/drv/dtrace.conf"; + + dof_prune(g_ofile); /* strip out any old DOF directives */ + etcsystem_prune(); /* string out any forceload directives */ + + 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); + etcsystem_add(); + error("run update_drv(1M) or reboot to enable changes\n"); + + dtrace_close(g_dtp); + return (g_status); + + case DMODE_LINK: +#ifndef VBOX /* No link mode. */ + 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); +#else /* VBOX */ + AssertFailed(); + dtrace_close(g_dtp); + return (E_USAGE); +#endif /* VBOX */ + + 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) { +#ifndef VBOX + char *p; +#endif + + 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"); + +#ifndef _MSC_VER + (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); +#else + signal(SIGINT, intr); + signal(SIGTERM, intr); +#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. + */ +#ifndef VBOX + for (i = 0; i < g_psc; i++) + dtrace_proc_continue(g_dtp, g_psv[i]); +#endif + + 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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/i386/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/i386/Makefile new file mode 100644 index 00000000..42abe337 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/i386/Makefile @@ -0,0 +1,30 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License, Version 1.0 only +# (the "License"). You may not use this file except in compliance +# with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2003 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +include ../Makefile.com + +install: all $(ROOTUSRSBINPROG32) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/i386/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/i386/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparc/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparc/Makefile new file mode 100644 index 00000000..42abe337 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparc/Makefile @@ -0,0 +1,30 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License, Version 1.0 only +# (the "License"). You may not use this file except in compliance +# with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2003 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +include ../Makefile.com + +install: all $(ROOTUSRSBINPROG32) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparc/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparc/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparcv9/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparcv9/Makefile new file mode 100644 index 00000000..45508077 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparcv9/Makefile @@ -0,0 +1,31 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License, Version 1.0 only +# (the "License"). You may not use this file except in compliance +# with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2003 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +include ../Makefile.com +include ../../Makefile.cmd.64 + +install: all $(ROOTUSRSBINPROG64) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparcv9/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/sparcv9/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile new file mode 100644 index 00000000..b6af1e53 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile @@ -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 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +include $(SRC)/Makefile.master + +SUBDIRS = cmd tst + +ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt + +include Makefile.subdirs + +install: $(ROOTOPTPKG)/README $(SUBDIRS) + +pkg: install + @cd $(SRC)/pkg; pwd; $(MAKE) SUNWdtrt.pub + +$(ROOTOPTPKG)/% := FILEMODE = 0444 + +$(ROOTOPTPKG): + $(INS.dir) + +$(ROOTOPTPKG)/%: ./% $(ROOTOPTPKG) + $(INS.file) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile.subdirs b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile.subdirs new file mode 100644 index 00000000..2ff551ca --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/Makefile.subdirs @@ -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. +# +#ident "%Z%%M% %I% %E% SMI" + +.KEEP_STATE: + +all := TARGET += all +clean := TARGET += clean +clobber := TARGET += clobber +install := TARGET += install +lint := TARGET += lint + +all clean clobber install lint: $(SUBDIRS) + +$(SUBDIRS): FRC + @cd $@; pwd; $(MAKE) $(TARGET) + +FRC: diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/README b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/README new file mode 100644 index 00000000..51ab650f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/Makefile new file mode 100644 index 00000000..28af4ee6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/Makefile @@ -0,0 +1,31 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +include $(SRC)/Makefile.master + +SUBDIRS = scripts baddof badioctl chkargs jdtrace +include ../Makefile.subdirs diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/Makefile new file mode 100644 index 00000000..bb7a746d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/Makefile @@ -0,0 +1,59 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +include $(SRC)/cmd/Makefile.cmd + +.KEEP_STATE: + +ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt +ROOTBIN = $(ROOTOPTPKG)/bin + +LDFLAGS += $(ZNODEFS) $(ZTEXTOFF) +LDLIBS = $(LDLIBS.cmd) +LDLIBS += -ldtrace + +SRCS = baddof +CMDS = $(SRCS:%=$(ROOTBIN)/%) + +$(CMDS) := FILEMODE = 0555 + +all: $(SRCS) + +install: $(CMDS) + +clean lint: + +clobber: + $(RM) $(SRCS) + +$(CMDS): $(ROOTBIN) $(SRCS) + +$(ROOTBIN): + $(INS.dir) + +$(ROOTBIN)/%: % + $(INS.file) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/baddof.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/baddof.c new file mode 100644 index 00000000..1c14c659 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/baddof/baddof.c @@ -0,0 +1,207 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +#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 < 2) + fatal("expected D script as argument\n"); + + if ((fp = fopen(filename, "r")) == NULL) + fatal("couldn't open %s", filename); + + /* + * First, we need to compile our provided D into DOF. + */ + if ((dtp = dtrace_open(DTRACE_VERSION, 0, &err)) == NULL) { + fatal("cannot open dtrace library: %s\n", + dtrace_errmsg(NULL, err)); + } + + pgp = dtrace_program_fcompile(dtp, fp, 0, 0, NULL); + fclose(fp); + + if (pgp == NULL) { + fatal("failed to compile script %s: %s\n", filename, + dtrace_errmsg(dtp, dtrace_errno(dtp))); + } + + dof = dtrace_dof_create(dtp, pgp, 0); + len = ((dof_hdr_t *)dof)->dofh_loadsz; + + if ((copy = malloc(len)) == NULL) + fatal("could not allocate copy of %d bytes", len); + + for (;;) { + bcopy(dof, copy, len); + /* + * Open another instance of the dtrace device. + */ + fd = open("/devices/pseudo/dtrace@0:dtrace", O_RDWR); + + if (fd == -1) + fatal("couldn't open DTrace pseudo device"); + + corrupt(fd, copy, len); + close(fd); + } + + /* NOTREACHED */ + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/badioctl/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/badioctl/Makefile new file mode 100644 index 00000000..6c3257df --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/badioctl/Makefile @@ -0,0 +1,58 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +include $(SRC)/cmd/Makefile.cmd + +.KEEP_STATE: + +ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt +ROOTBIN = $(ROOTOPTPKG)/bin + +LDFLAGS += $(ZNODEFS) $(ZTEXTOFF) +LDLIBS = $(LDLIBS.cmd) + +SRCS = badioctl +CMDS = $(SRCS:%=$(ROOTBIN)/%) + +$(CMDS) := FILEMODE = 0555 + +all: $(SRCS) + +install: $(CMDS) + +clean lint: + +clobber: + $(RM) $(SRCS) + +$(CMDS): $(ROOTBIN) $(SRCS) + +$(ROOTBIN): + $(INS.dir) + +$(ROOTBIN)/%: % + $(INS.file) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/badioctl/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/badioctl/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/badioctl/badioctl.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/badioctl/badioctl.c new file mode 100644 index 00000000..8d6833d5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile new file mode 100644 index 00000000..0510b9bf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile @@ -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 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +include $(SRC)/cmd/Makefile.cmd + +SUBDIRS = $(MACH) +$(BUILD64)SUBDIRS += $(MACH64) + +include ../../Makefile.subdirs diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile.com b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile.com new file mode 100644 index 00000000..f9ad9605 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile.com @@ -0,0 +1,76 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +include $(SRC)/cmd/Makefile.cmd + +.KEEP_STATE: + +ROOTBIN = $(ROOT)/opt/SUNWdtrt/bin +ROOTBIN32 = $(ROOTBIN)/$(MACH32) +ROOTBIN64 = $(ROOTBIN)/$(MACH64) + +PROG = chkargs +LDLIBS = $(LDLIBS.cmd) +LDLIBS += -ldtrace -lctf + +ROOTISAEXEC = $(ROOTBIN)/$(PROG) +ROOTPROG32 = $(ROOTBIN32)/$(PROG) +ROOTPROG64 = $(ROOTBIN64)/$(PROG) + +$(ROOTPROG32) := FILEMODE = 0555 +$(ROOTPROG64) := FILEMODE = 0555 + +all: $(PROG) + +clean lint: + +clobber: + $(RM) $(PROG) $(ROOTISAEXEC) + +$(PROG): ../$(PROG).c + $(LINK.c) -o $@ ../$(PROG).c $(LDLIBS) + $(POST_PROCESS) ; $(STRIP_STABS) + +$(ROOTPROG32): $(ROOTBIN32) $(PROG) + +$(ROOTPROG64): $(ROOTBIN64) $(PROG) + +$(ROOTBIN32)/%: % + $(INS.file) + +$(ROOTBIN64)/%: % + $(INS.file) + +$(ROOTISAEXEC): + $(RM) $@; + $(CP) -p $(ISAEXEC) $@ + +$(ROOTBIN)/%: $(ROOTBIN) + $(INS.dir) + +$(ROOTBIN): + $(INS.dir) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/amd64/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/amd64/Makefile new file mode 100644 index 00000000..38bbfc0a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/amd64/Makefile @@ -0,0 +1,31 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +include ../Makefile.com +include $(SRC)/cmd/Makefile.cmd.64 + +install: $(ROOTPROG64) $(ROOTISAEXEC) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/amd64/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/amd64/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/chkargs.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/chkargs.c new file mode 100644 index 00000000..a7e0222f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/chkargs.c @@ -0,0 +1,149 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +#include +#include + +static int g_count; +static int g_errs; +static int g_fd; +static int g_verbose; +static int g_errexit; +static char *g_progname; + +static int +probe(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp, void *data) +{ + dtrace_probeinfo_t p; + dtrace_argdesc_t arg; + char buf[BUFSIZ]; + int i; + + (void) printf("\r%6d", ++g_count); + (void) fflush(stdout); + + if (dtrace_probe_info(dtp, pdp, &p) != 0) { + (void) printf(" failed to get probe info for " + "%s:%s:%s:%s [%d]\n", pdp->dtpd_provider, pdp->dtpd_mod, + pdp->dtpd_func, pdp->dtpd_name, pdp->dtpd_id); + g_errs++; + return (0); + } + + for (i = 0; i < p.dtp_argc; i++) { + if (p.dtp_argv[i].dtt_type == CTF_ERR) { + bzero(&arg, sizeof (dtrace_argdesc_t)); + arg.dtargd_id = pdp->dtpd_id; + arg.dtargd_ndx = i; + (void) ioctl(g_fd, DTRACEIOC_PROBEARG, &arg); + + (void) printf(" failed to get types for args[%d] " + "of %s:%s:%s:%s [%d]: <%s> -> <%s>\n", i, + pdp->dtpd_provider, pdp->dtpd_mod, pdp->dtpd_func, + pdp->dtpd_name, pdp->dtpd_id, + arg.dtargd_native, arg.dtargd_xlate); + + g_errs++; + + if (g_errexit) + return (-1); + + } else if (g_verbose) { + (void) printf("%d args[%d] : %s\n", pdp->dtpd_id, i, + ctf_type_name(p.dtp_argv[i].dtt_ctfp, + p.dtp_argv[i].dtt_type, buf, sizeof (buf))); + } + } + + return (0); +} + +int +main(int argc, char *argv[]) +{ + dtrace_probedesc_t pd, *pdp = NULL; + dtrace_hdl_t *dtp; + int err, c; + char *p; + + g_progname = argv[0]; + + if ((dtp = dtrace_open(DTRACE_VERSION, 0, &err)) == NULL) { + (void) fprintf(stderr, "%s: failed to open dtrace: %s\n", + g_progname, dtrace_errmsg(dtp, err)); + return (1); + } + + while ((c = getopt(argc, argv, "evx:")) != -1) { + switch (c) { + case 'e': + g_errexit++; + break; + case 'v': + g_verbose++; + break; + case 'x': + if ((p = strchr(optarg, '=')) != NULL) + *p++ = '\0'; + + if (dtrace_setopt(dtp, optarg, p) != 0) { + (void) fprintf(stderr, "%s: failed to set " + "option -x %s: %s\n", g_progname, optarg, + dtrace_errmsg(dtp, dtrace_errno(dtp))); + return (2); + } + break; + + default: + (void) fprintf(stderr, "Usage: %s [-ev] " + "[-x opt[=arg]] [probedesc]\n", g_progname); + return (2); + } + } + + argv += optind; + argc -= optind; + + if (argc > 0) { + if (dtrace_str2desc(dtp, DTRACE_PROBESPEC_NAME, argv[0], &pd)) { + (void) fprintf(stderr, "%s: invalid probe description " + "%s: %s\n", g_progname, argv[0], + dtrace_errmsg(dtp, dtrace_errno(dtp))); + return (2); + } + pdp = &pd; + } + + g_fd = dtrace_ctlfd(dtp); + (void) dtrace_probe_iter(dtp, pdp, probe, NULL); + dtrace_close(dtp); + + (void) printf("\nTotal probes: %d\n", g_count); + (void) printf("Total errors: %d\n\n", g_errs); + + return (g_errs != 0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/i386/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/i386/Makefile new file mode 100644 index 00000000..596e5b08 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/i386/Makefile @@ -0,0 +1,30 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +include ../Makefile.com + +install: $(ROOTPROG32) $(ROOTISAEXEC) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/i386/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/i386/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparc/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparc/Makefile new file mode 100644 index 00000000..596e5b08 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparc/Makefile @@ -0,0 +1,30 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +include ../Makefile.com + +install: $(ROOTPROG32) $(ROOTISAEXEC) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparc/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparc/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparcv9/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparcv9/Makefile new file mode 100644 index 00000000..38bbfc0a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparcv9/Makefile @@ -0,0 +1,31 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +include ../Makefile.com +include $(SRC)/cmd/Makefile.cmd.64 + +install: $(ROOTPROG64) $(ROOTISAEXEC) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparcv9/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/chkargs/sparcv9/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/Getopt.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/Getopt.java new file mode 100644 index 00000000..e06a170d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/JDTrace.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/JDTrace.java new file mode 100644 index 00000000..3c5654d8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/Makefile new file mode 100644 index 00000000..99a571be --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/Makefile @@ -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 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +PROG = jdtrace +SRCS = jdtrace.c + +include $(SRC)/cmd/Makefile.cmd + +ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt +ROOTBIN = $(ROOTOPTPKG)/bin +ROOTLIB = $(ROOTOPTPKG)/lib +ROOTLIBJAVA = $(ROOTLIB)/java + +# Use the proto dtrace.jar if it exists, otherwise use whatever is +# installed on the system. It should be possible to build +# usr/src/cmd/dtrace/test independently, even if only on systems that +# have a compatible dtrace.jar installed. +DTRACE_JAR=usr/share/lib/java/dtrace.jar +PROTO_DTRACE_JAR=$(ROOT)/$(DTRACE_JAR) +INSTALLED_DTRACE_JAR=/$(DTRACE_JAR) +CLASSPATH=$(PROTO_DTRACE_JAR):$(INSTALLED_DTRACE_JAR) +DTEST_DIR=$(SRC)/cmd/dtrace/test +CLASSDIR=classes +LIBDIR=lib +MANIFESTDIR=manifest +MANIFEST=$(MANIFESTDIR)/jdtrace.jar-manifest +JDTRACE_JAR=$(LIBDIR)/jdtrace.jar + +PROTO_JDTRACE_JAR=$(ROOTLIBJAVA)/jdtrace.jar +CMD = $(ROOTBIN)/jdtrace +XLIST = $(ROOTBIN)/exception.lst + +$(PROTO_JDTRACE_JAR) := FILEMODE = 0644 +$(CMD) := FILEMODE = 0555 +$(XLIST) := FILEMODE = 0444 + +all: $(JDTRACE_JAR) $(PROG) + +clean: + -$(RM) $(CLASSDIR)/*.class + +clobber: clean + -$(RM) $(JDTRACE_JAR) + -$(RM) $(PROG) + +lint: + +install: all $(PROTO_JDTRACE_JAR) $(CMD) $(XLIST) + +$(PROG): $(SRCS) + $(LINK.c) -o $@ $(SRCS) $(LDLIBS) + $(POST_PROCESS) ; $(STRIP_STABS) + +JFLAGS= -g -cp $(CLASSPATH) -d $(CLASSDIR) -deprecation +JFLAGS += -target 1.5 +JFLAGS += -Xlint +COMPILE.java=$(JAVAC) $(JFLAGS) +JAVASRC= JDTrace.java Getopt.java + +$(JDTRACE_JAR): $(JAVASRC) + @mkdir -p $(CLASSDIR) + @mkdir -p $(LIBDIR) + $(COMPILE.java) $(JAVASRC) + $(JAR) -cmf $(MANIFEST) $(JDTRACE_JAR) -C $(CLASSDIR) . + +$(PROTO_JDTRACE_JAR): $(ROOTLIBJAVA) + +$(CMD): $(ROOTBIN) + +$(XLIST): $(ROOTBIN) + +$(ROOTBIN): + $(INS.dir) + +$(ROOTLIB): + $(INS.dir) + +$(ROOTLIBJAVA): $(ROOTLIB) + $(INS.dir) + +$(ROOTLIBJAVA)/%.jar: $(LIBDIR)/%.jar + $(INS.file) + +$(ROOTBIN)/%: % + $(INS.file) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/exception.lst b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/exception.lst new file mode 100644 index 00000000..261f8707 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/jdtrace.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/jdtrace.c new file mode 100644 index 00000000..09512656 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/manifest/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/manifest/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/manifest/jdtrace.jar-manifest b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/jdtrace/manifest/jdtrace.jar-manifest new file mode 100644 index 00000000..323c4a4c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/Makefile new file mode 100644 index 00000000..0a7b167c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/Makefile @@ -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. +# +#ident "%Z%%M% %I% %E% SMI" + +include $(SRC)/Makefile.master + +.KEEP_STATE: + +ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt +ROOTBIN = $(ROOTOPTPKG)/bin + +SRCS = dtest itest dstyle +CMDS = $(SRCS:%=$(ROOTBIN)/%) + +$(CMDS) := FILEMODE = 0555 + +all clean clobber lint: + +install: $(CMDS) + +$(CMDS): $(ROOTBIN) + +$(ROOTBIN): + $(INS.dir) + +$(ROOTBIN)/%: %.pl + $(INS.rename) + +$(ROOTBIN)/%: %.sh + $(INS.rename) + +$(ROOTBIN)/%: %.ksh + $(INS.rename) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/dstyle.pl b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/dstyle.pl new file mode 100755 index 00000000..c1075a36 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/dstyle.pl @@ -0,0 +1,235 @@ +#!/usr/perl5/bin/perl +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +require 5.8.4; + +$PNAME = $0; +$PNAME =~ s:.*/::; +$USAGE = "Usage: $PNAME [file ...]\n"; +$errs = 0; + +sub err +{ + my($msg) = @_; + + print "$file: $lineno: $msg\n"; + $errs++; +} + +sub dstyle +{ + open(FILE, "$file"); + $lineno = 0; + $inclause = 0; + $skipnext = 0; + + while () { + $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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/dtest.pl b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/dtest.pl new file mode 100755 index 00000000..3f244295 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/cmd/scripts/dtest.pl @@ -0,0 +1,704 @@ +#!/usr/perl5/bin/perl +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +require 5.8.4; + +use File::Find; +use File::Basename; +use Getopt::Std; +use Cwd; +use Cwd 'abs_path'; + +$PNAME = $0; +$PNAME =~ s:.*/::; +$OPTSTR = 'abd:fghi:jlnqsx:'; +$USAGE = "Usage: $PNAME [-abfghjlnqs] [-d dir] [-i isa] " + . "[-x opt[=arg]] [file | dir ...]\n"; +($MACH = `uname -p`) =~ s/\W*\n//; +($PLATFORM = `uname -i`) =~ s/\W*\n//; + +@dtrace_argv = (); + +$ksh_path = '/usr/bin/ksh'; + +@files = (); +%exceptions = (); +%results = (); +$errs = 0; + +# +# If no test files are specified on the command-line, execute a find on "." +# and append any tst.*.d, tst.*.ksh, err.*.d or drp.*.d files found within +# the directory tree. +# +sub wanted +{ + push(@files, $File::Find::name) + if ($_ =~ /^(tst|err|drp)\..+\.(d|ksh)$/ && -f "$_"); +} + +sub dirname { + my($s) = @_; + my($i); + + $s = substr($s, 0, $i) if (($i = rindex($s, '/')) != -1); + return $i == -1 ? '.' : $i == 0 ? '/' : $s; +} + +sub usage +{ + print $USAGE; + print "\t -a execute test suite using anonymous enablings\n"; + print "\t -b execute bad ioctl test program\n"; + print "\t -d specify directory for test results files and cores\n"; + print "\t -g enable libumem debugging when running tests\n"; + print "\t -f force bypassed tests to run\n"; + print "\t -h display verbose usage message\n"; + print "\t -i specify ISA to test instead of isaexec(3C) default\n"; + print "\t -j execute test suite using jdtrace (Java API) only\n"; + print "\t -l save log file of results and PIDs used by tests\n"; + print "\t -n execute test suite using dtrace(1m) only\n"; + print "\t -q set quiet mode (only report errors and summary)\n"; + print "\t -s save results files even for tests that pass\n"; + print "\t -x pass corresponding -x argument to dtrace(1M)\n"; + exit(2); +} + +sub errmsg +{ + my($msg) = @_; + + print STDERR $msg; + print LOG $msg if ($opt_l); + $errs++; +} + +sub fail +{ + my(@parms) = @_; + my($msg) = $parms[0]; + my($errfile) = $parms[1]; + my($n) = 0; + my($dest) = basename($file); + + while (-d "$opt_d/failure.$n") { + $n++; + } + + unless (mkdir "$opt_d/failure.$n") { + warn "ERROR: failed to make directory $opt_d/failure.$n: $!\n"; + exit(125); + } + + open(README, ">$opt_d/failure.$n/README"); + print README "ERROR: " . $file . " " . $msg; + + if (scalar @parms > 1) { + print README "; see $errfile\n"; + } else { + if (-f "$opt_d/$pid.core") { + print README "; see $pid.core\n"; + } else { + print README "\n"; + } + } + + close(README); + + if (-f "$opt_d/$pid.out") { + rename("$opt_d/$pid.out", "$opt_d/failure.$n/$pid.out"); + link("$file.out", "$opt_d/failure.$n/$dest.out"); + } + + if (-f "$opt_d/$pid.err") { + rename("$opt_d/$pid.err", "$opt_d/failure.$n/$pid.err"); + link("$file.err", "$opt_d/failure.$n/$dest.err"); + } + + if (-f "$opt_d/$pid.core") { + rename("$opt_d/$pid.core", "$opt_d/failure.$n/$pid.core"); + } + + link("$file", "$opt_d/failure.$n/$dest"); + + $msg = "ERROR: " . $dest . " " . $msg; + + if (scalar @parms > 1) { + $msg = $msg . "; see $errfile in failure.$n\n"; + } else { + $msg = $msg . "; details in failure.$n\n"; + } + + errmsg($msg); +} + +sub logmsg +{ + my($msg) = @_; + + print STDOUT $msg unless ($opt_q); + print LOG $msg if ($opt_l); +} + +# Trim leading and trailing whitespace +sub trim { + my($s) = @_; + + $s =~ s/^\s*//; + $s =~ s/\s*$//; + return $s; +} + +# Load exception set of skipped tests from the file at the given +# pathname. The test names are assumed to be paths relative to $dt_tst, +# for example: common/aggs/tst.neglquant.d, and specify tests to be +# skipped. +sub load_exceptions { + my($listfile) = @_; + my($line) = ""; + + %exceptions = (); + if (length($listfile) > 0) { + exit(123) unless open(STDIN, "<$listfile"); + while () { + 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 = "$dir/$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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile new file mode 100644 index 00000000..27c9c699 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile @@ -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 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +include $(SRC)/Makefile.master + +SUBDIRS= common $(MACH:i386=i386 i86xpv) +include ../Makefile.subdirs + +dstyle := TARGET += dstyle + +check: FRC + @$(ECHO) "checking dstyle" + @$(MAKE) dstyle + +dstyle: $(SUBDIRS) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile.com b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile.com new file mode 100644 index 00000000..a23b8d65 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile.com @@ -0,0 +1,104 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL 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" +# + +include $(SRC)/cmd/Makefile.cmd + +.KEEP_STATE: + +ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt +ROOTTST = $(ROOTOPTPKG)/tst +SUBDIR :sh= basename `pwd` +TSTDIR = $(ROOTTST)/$(SUBDIR) +DSTYLE = $(ROOTOPTPKG)/bin/dstyle + +CSRCS :sh= find . -name SCCS -prune -o -name *.c -print | cut -b3- +SSRCS :sh= find . -name SCCS -prune -o -name *.s -print | cut -b3- +DSRCS :sh= find . -name SCCS -prune -o -name *.d -print | cut -b3- + +TSTS :sh= find . -name tst.*.d -o -name err.*.d -o \ + -name tst.*.d.out -o -name err.*.d.out -o -name tst.*.ksh \ + -o -name err.*.ksh -o -name tst.*.ksh.out -o -name drp.*.d \ + -o -name get.*.pl + +EXES :sh= find . -name SCCS -prune -o \( -name *.exe -o -name \*.pl \) -print \ + | cut -b3- +EXES += $(CSRCS:%.c=%.exe) +EXES += $(SSRCS:%.s=%.exe) + +ROOT_TSTS = $(TSTS:%=$(TSTDIR)/%) +ROOT_EXES = $(EXES:%=$(TSTDIR)/%) + +$(ROOT_TSTS) := FILEMODE = 0444 +$(ROOT_EXES) := FILEMODE = 0555 + +all: $(EXES) + +clean lint: + +clobber: FRC + -$(RM) $(CSRCS:%.c=%.exe) $(CSRCS:%.c=%.o) + -$(RM) $(SSRCS:%.s=%.exe) $(SSRCS:%.s=%.o) + -$(RM) $(DSRCS:%.d=%.o) + -$(RM) $(CLOBBERFILES) + +install: $(ROOT_TSTS) $(ROOT_EXES) + +$(ROOT_TSTS): $(TSTDIR) + +$(ROOT_EXES): $(TSTDIR) + +$(TSTDIR): + $(INS.dir) + +$(TSTDIR)/%: % + $(INS) -s -d -m $(DIRMODE) $(@D) + $(INS.file) + +%.exe: %.c + $(LINK.c) -o $@ $< $(LDLIBS) + $(POST_PROCESS) ; $(STRIP_STABS) + +%.exe: %.o + $(LINK.c) -o $@ $< $(LDLIBS) + $(POST_PROCESS) ; $(STRIP_STABS) + +%.o: %.c + $(COMPILE.c) -o $@ $< + $(POST_PROCESS_O) + +%.o: %.s + $(COMPILE.s) -o $@ $< + $(POST_PROCESS_O) + +scripts: FRC + @cd ../cmd/scripts; pwd; $(MAKE) install + +dstyle: FRC + @if [ -n "$(DSRCS)" ]; then $(DSTYLE) $(DSRCS); fi + +FRC: diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/Makefile new file mode 100644 index 00000000..065124ad --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/Makefile @@ -0,0 +1,101 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL 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" +# + +include $(SRC)/Makefile.master +include ../Makefile.com + +SNOOPDIR = $(SRC)/cmd/cmd-inet/usr.sbin/snoop +SNOOPOBJS = nfs4_xdr.o +SNOOPSRCS = ${SNOOPOBJS:%.o=%.c} +CLOBBERFILES += nfs/$(SNOOPOBJS) + +RPCSVCDIR = $(SRC)/head/rpcsvc +RPCSVCOBJS = nfs_prot.o +RPCSVCSRCS = ${RPCSVCOBJS:%o=%c} +CLOBBERFILES += nfs/$(RPCSVCOBJS) $(RPCSVCDIR)/$(RPCSVCSRCS) + +fasttrap/tst.fasttrap.exe := LDLIBS += -ldtrace +fasttrap/tst.stack.exe := LDLIBS += -ldtrace + +sysevent/tst.post.exe := LDLIBS += -lsysevent +sysevent/tst.post_chan.exe := LDLIBS += -lsysevent + +ustack/tst.bigstack.exe := COPTFLAG += -xO1 + +GCC = $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc + +nfs/%.o: $(SNOOPDIR)/%.c + $(COMPILE.c) -o $@ $< -I$(SNOOPDIR) + $(POST_PROCESS_O) +nfs/tst.call.exe: nfs/tst.call.o nfs/$(SNOOPOBJS) + $(LINK.c) -o $@ nfs/tst.call.o nfs/$(SNOOPOBJS) $(LDLIBS) -lnsl + $(POST_PROCESS) ; $(STRIP_STABS) +$(RPCSVCDIR)/%.c: $(RPCSVCDIR)/%.x + $(RPCGEN) -Cc $< > $@ +nfs/$(RPCSVCOBJS): $(RPCSVCDIR)/$(RPCSVCSRCS) + $(COMPILE.c) -o $@ $(RPCSVCDIR)/$(RPCSVCSRCS) + $(POST_PROCESS_O) +nfs/tst.call3.exe: nfs/tst.call3.o nfs/$(RPCSVCOBJS) + $(LINK.c) -o $@ nfs/tst.call3.o nfs/$(RPCSVCOBJS) \ + $(LDLIBS) -lnsl -lrpcsvc + $(POST_PROCESS) ; $(STRIP_STABS) + +pid/tst.gcc.exe: pid/tst.gcc.c + $(GCC) -o pid/tst.gcc.exe pid/tst.gcc.c $(LDFLAGS) + $(POST_PROCESS) ; $(STRIP_STABS) + +usdt/tst.args.exe: usdt/tst.args.o usdt/args.o + $(LINK.c) -o usdt/tst.args.exe usdt/tst.args.o usdt/args.o $(LDLIBS) + $(POST_PROCESS) ; $(STRIP_STABS) + +usdt/args.o: usdt/args.d usdt/tst.args.o + $(COMPILE.d) -o usdt/args.o -s usdt/args.d usdt/tst.args.o + +usdt/tst.argmap.exe: usdt/tst.argmap.o usdt/argmap.o + $(LINK.c) -o usdt/tst.argmap.exe usdt/tst.argmap.o usdt/argmap.o \ + $(LDLIBS) + $(POST_PROCESS) ; $(STRIP_STABS) + +usdt/argmap.o: usdt/argmap.d usdt/tst.argmap.o + $(COMPILE.d) -o usdt/argmap.o -s usdt/argmap.d usdt/tst.argmap.o + +usdt/tst.forker.exe: usdt/tst.forker.o usdt/forker.o + $(LINK.c) -o usdt/tst.forker.exe usdt/tst.forker.o usdt/forker.o \ + $(LDLIBS) + $(POST_PROCESS) ; $(STRIP_STABS) + +usdt/forker.o: usdt/forker.d usdt/tst.forker.o + $(COMPILE.d) -o usdt/forker.o -s usdt/forker.d usdt/tst.forker.o + +usdt/tst.forker.o: usdt/forker.h + +usdt/forker.h: usdt/forker.d + $(DTRACE) -h -s usdt/forker.d -o usdt/forker.h + +SUBDIRS = java_api +include ../../Makefile.subdirs diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_FUNC.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_FUNC.bad.d new file mode 100644 index 00000000..d12454be --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_MDIM.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_MDIM.bad.d new file mode 100644 index 00000000..2c47289b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_NULL.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_NULL.bad.d new file mode 100644 index 00000000..87d18187 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_REDEF.redef.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_REDEF.redef.d new file mode 100644 index 00000000..9b4b425e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.avgtoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.avgtoofew.d new file mode 100644 index 00000000..106f4cde --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.maxnoarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.maxnoarg.d new file mode 100644 index 00000000..181e1962 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.mintoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.mintoofew.d new file mode 100644 index 00000000..3ca34ffb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.quantizetoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.quantizetoofew.d new file mode 100644 index 00000000..b7464552 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d new file mode 100644 index 00000000..262040f1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * stddev() should not accept a non-scalar value + * + * SECTION: Aggregations/Aggregations + * + */ + +#pragma D option quiet + +BEGIN +{ + @a[pid] = stddev(probefunc); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.sumtoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.sumtoofew.d new file mode 100644 index 00000000..a77a2d5d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_AGGARG.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_AGGARG.bad.d new file mode 100644 index 00000000..0e6060ae --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_PROTO.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_CLEAR_PROTO.bad.d new file mode 100644 index 00000000..57fa8841 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_IDENT.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_IDENT.bad.d new file mode 100644 index 00000000..866a7acf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_UNDEF.badaggfunc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_FUNC_UNDEF.badaggfunc.d new file mode 100644 index 00000000..65c12da4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badexpr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badexpr.d new file mode 100644 index 00000000..83e6ab79 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badkey3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.badkey3.d new file mode 100644 index 00000000..67c5b64e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.noeffect.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_IDENT_UNDEF.noeffect.d new file mode 100644 index 00000000..9bdff789 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey1.d new file mode 100644 index 00000000..abf3dd8c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey2.d new file mode 100644 index 00000000..9490b821 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey4.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_KEY_TYPE.badkey4.d new file mode 100644 index 00000000..057746eb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqbad1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqbad1.d new file mode 100644 index 00000000..6bb6765a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqshort.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASETYPE.lqshort.d new file mode 100644 index 00000000..6bb6765a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASEVAL.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_BASEVAL.bad.d new file mode 100644 index 00000000..23d318e7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMTYPE.lqbad1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMTYPE.lqbad1.d new file mode 100644 index 00000000..894f064a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMVAL.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_LIMVAL.bad.d new file mode 100644 index 00000000..0a2f5e7f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.d new file mode 100644 index 00000000..b93ffabf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.order.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHBASE.order.d new file mode 100644 index 00000000..763c1e0b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.d new file mode 100644 index 00000000..d9ba023e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.order.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHLIM.order.d new file mode 100644 index 00000000..62be0c5b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHSTEP.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MATCHSTEP.d new file mode 100644 index 00000000..086f4392 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MISMATCH.lqbadarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_MISMATCH.lqbadarg.d new file mode 100644 index 00000000..a4444ad1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPLARGE.lqtoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPLARGE.lqtoofew.d new file mode 100644 index 00000000..664f70f2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPSMALL.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPSMALL.bad.d new file mode 100644 index 00000000..634e8c06 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPTYPE.lqbadinc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPTYPE.lqbadinc.d new file mode 100644 index 00000000..87c51273 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPVAL.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_LQUANT_STEPVAL.bad.d new file mode 100644 index 00000000..a90d7571 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_AGGARG.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_AGGARG.bad.d new file mode 100644 index 00000000..7e5974c5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_PROTO.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_PROTO.bad.d new file mode 100644 index 00000000..82d819d4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_SCALAR.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_NORMALIZE_SCALAR.bad.d new file mode 100644 index 00000000..14a25864 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_ARG.lquantizetoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_ARG.lquantizetoofew.d new file mode 100644 index 00000000..db4567f8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgnoarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgnoarg.d new file mode 100644 index 00000000..628eeaba --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgtoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.avgtoomany.d new file mode 100644 index 00000000..42e5c1cc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.counttoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.counttoomany.d new file mode 100644 index 00000000..5dc5b800 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizenoarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizenoarg.d new file mode 100644 index 00000000..ae4b6724 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizetoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.lquantizetoomany.d new file mode 100644 index 00000000..bf87a468 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxnoarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxnoarg.d new file mode 100644 index 00000000..aad2c249 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxtoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.maxtoomany.d new file mode 100644 index 00000000..d0fb0918 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.minnoarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.minnoarg.d new file mode 100644 index 00000000..09db51f2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.mintoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.mintoomany.d new file mode 100644 index 00000000..2647402c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizenoarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizenoarg.d new file mode 100644 index 00000000..b33957a2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizetoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.quantizetoomany.d new file mode 100644 index 00000000..9b162bd2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d new file mode 100644 index 00000000..2952cf50 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * stddev() should not accept a call with no arguments + * + * SECTION: Aggregations/Aggregations + * + */ + +#pragma D option quiet + +BEGIN +{ + @a[1] = stddev(); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d new file mode 100644 index 00000000..c42e9628 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * stddev() should not have more than one argument + * + * SECTION: Aggregations/Aggregations + * + */ + +#pragma D option quiet + +BEGIN +{ + @a[1] = stddev(1, 2); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumnoarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumnoarg.d new file mode 100644 index 00000000..4f279017 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumtoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.sumtoomany.d new file mode 100644 index 00000000..5e899be6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_AGGARG.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_AGGARG.bad.d new file mode 100644 index 00000000..69cb7291 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badmany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badmany.d new file mode 100644 index 00000000..61271a74 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badnone.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_PROTO.badnone.d new file mode 100644 index 00000000..e141e6c9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_SCALAR.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/err.D_TRUNC_SCALAR.bad.d new file mode 100644 index 00000000..e5485766 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.allquant.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.allquant.d new file mode 100644 index 00000000..26241b31 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.allquant.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.allquant.d.out new file mode 100644 index 00000000..356d6b46 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg.d new file mode 100644 index 00000000..a4bfd3cd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg.d.out new file mode 100644 index 00000000..e3c0687d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg.d.out @@ -0,0 +1,2 @@ + + 450 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d new file mode 100644 index 00000000..5c1e77d1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d.out new file mode 100644 index 00000000..3fafcd45 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.avg_neg.d.out @@ -0,0 +1,2 @@ + + -450 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clear.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clear.d new file mode 100644 index 00000000..2acd8ee9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clear.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clear.d.out new file mode 100644 index 00000000..486e4ac0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d new file mode 100644 index 00000000..135e511b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d.out new file mode 100644 index 00000000..8d23188f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg.d.out @@ -0,0 +1,2 @@ + + 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d new file mode 100644 index 00000000..0f7a9584 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearavg2.d.out new file mode 100644 index 00000000..7cceedda --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d new file mode 100644 index 00000000..7aefed03 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.cleardenormalize.d.out new file mode 100644 index 00000000..ed7f2f34 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d new file mode 100644 index 00000000..2d0ff838 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearlquantize.d.out new file mode 100644 index 00000000..e7e2a600 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d new file mode 100644 index 00000000..75cfa2d1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearnormalize.d.out new file mode 100644 index 00000000..e568427e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d new file mode 100644 index 00000000..af3ecd56 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d @@ -0,0 +1,57 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Positive stddev() test + * + * SECTION: Aggregations/Aggregations + * + * NOTES: + * Verifies that printing a clear()'d aggregation with an stddev() + * aggregation function doesn't cause problems. + * + */ + +#pragma D option quiet + +tick-10ms +/i++ < 5/ +{ + @a = stddev(timestamp); +} + +tick-10ms +/i == 5/ +{ + exit(2); +} + +END +{ + clear(@a); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out new file mode 100644 index 00000000..8d23188f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out @@ -0,0 +1,2 @@ + + 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count.d new file mode 100644 index 00000000..e81d123d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count.d.out new file mode 100644 index 00000000..d34fd3b0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count.d.out @@ -0,0 +1,2 @@ + + 2 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count2.d new file mode 100644 index 00000000..624b1b4e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count2.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count2.d.out new file mode 100644 index 00000000..4998a339 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count2.d.out @@ -0,0 +1,2 @@ + + tick-count 10 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.count3.d new file mode 100644 index 00000000..5913ff60 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d new file mode 100644 index 00000000..37269e82 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalize.d.out new file mode 100644 index 00000000..fa4d0da7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d new file mode 100644 index 00000000..d63a83e6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.denormalizeonly.d.out new file mode 100644 index 00000000..cc16f277 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d new file mode 100644 index 00000000..8ff3aabf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.fmtnormalize.d.out new file mode 100644 index 00000000..bbf345be --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.forms.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.forms.d new file mode 100644 index 00000000..2b08a12d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.forms.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.forms.d.out new file mode 100644 index 00000000..1f31450d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.goodkey.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.goodkey.d new file mode 100644 index 00000000..46becd56 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.keysort.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.keysort.d new file mode 100644 index 00000000..dbc8b6d2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.keysort.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.keysort.d.out new file mode 100644 index 00000000..250d84b9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d new file mode 100644 index 00000000..dd25f861 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantize.d.out new file mode 100644 index 00000000..fecb4483 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d new file mode 100644 index 00000000..003f846f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantnormal.d.out new file mode 100644 index 00000000..76b55b9c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d new file mode 100644 index 00000000..e9e67165 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantrange.d.out new file mode 100644 index 00000000..88d3505b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d new file mode 100644 index 00000000..ad609ed2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantround.d.out new file mode 100644 index 00000000..1aa94e33 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d new file mode 100644 index 00000000..3905f2bd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.lquantzero.d.out new file mode 100644 index 00000000..330de38a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max.d new file mode 100644 index 00000000..0c973ad5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max.d.out new file mode 100644 index 00000000..d3957f4c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max.d.out @@ -0,0 +1,3 @@ + + 900 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d new file mode 100644 index 00000000..63486e5f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d.out new file mode 100644 index 00000000..8d23188f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.max_neg.d.out @@ -0,0 +1,2 @@ + + 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min.d new file mode 100644 index 00000000..aff5452e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min.d.out new file mode 100644 index 00000000..8d23188f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min.d.out @@ -0,0 +1,2 @@ + + 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d new file mode 100644 index 00000000..20f0a56d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d.out new file mode 100644 index 00000000..461b29cf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.min_neg.d.out @@ -0,0 +1,2 @@ + + -900 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d new file mode 100644 index 00000000..c65fb529 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d @@ -0,0 +1,66 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Multiple aggregates can be used within the same D script. + * + * SECTION: Aggregations/Aggregations + * + */ + +#pragma D option quiet + +BEGIN +{ + time_1 = timestamp; + i = 0; +} + +tick-10ms +/i <= 10/ +{ + time_2 = timestamp; + new_time = time_2 - time_1; + @a[pid] = max(new_time); + @b[pid] = min(new_time); + @c[pid] = avg(new_time); + @d[pid] = sum(new_time); + @e[pid] = quantize(new_time); + @f[pid] = stddev(new_time); + @g[timestamp] = max(new_time); + @h[timestamp] = quantize(new_time); + @i[timestamp] = lquantize(new_time, 0, 10000, 1000); + + time_1 = time_2; + i++; +} + +tick-10ms +/i == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d new file mode 100644 index 00000000..b34d73fa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Test multiple aggregations and the default output order + * + * SECTION: Aggregations/Aggregations; + * Aggregations/Output + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +tick-10ms +/i < 1000/ +{ + @a = avg(i); + @b = sum(i); + @c = min(i); + @d = max(i); + @e = quantize(i); + @f = lquantize(i, 0, 1000, 100); + @g = stddev(i); + + i += 100; +} + +tick-10ms +/i == 1000/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out new file mode 100644 index 00000000..579f78dd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out @@ -0,0 +1,37 @@ + + 450 + 4500 + 0 + 900 + + value ------------- Distribution ------------- count + -1 | 0 + 0 |@@@@ 1 + 1 | 0 + 2 | 0 + 4 | 0 + 8 | 0 + 16 | 0 + 32 | 0 + 64 |@@@@ 1 + 128 |@@@@ 1 + 256 |@@@@@@@@@@@@ 3 + 512 |@@@@@@@@@@@@@@@@ 4 + 1024 | 0 + + + value ------------- Distribution ------------- count + < 0 | 0 + 0 |@@@@ 1 + 100 |@@@@ 1 + 200 |@@@@ 1 + 300 |@@@@ 1 + 400 |@@@@ 1 + 500 |@@@@ 1 + 600 |@@@@ 1 + 700 |@@@@ 1 + 800 |@@@@ 1 + 900 |@@@@ 1 + >= 1000 | 0 + + 287 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d new file mode 100644 index 00000000..21d2fa9e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d @@ -0,0 +1,74 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Test multiple aggregations and overriding default order with + * printa() statements. + * + * SECTION: Aggregations/Aggregations; + * Aggregations/Output + * + * NOTES: This is a simple verifiable test. + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +tick-10ms +/i < 1000/ +{ + @a = count(); + @b = avg(i); + @c = sum(i); + @d = min(i); + @e = max(i); + @f = quantize(i); + @g = lquantize(i, 0, 1000, 100); + @h = stddev(i); + + i += 100; +} + +tick-10ms +/i == 1000/ +{ + printa("%@d\n", @h); + printa("%@d\n", @g); + printa("%@d\n", @f); + printa("%@d\n", @e); + printa("%@d\n", @d); + printa("%@d\n", @c); + printa("%@d\n", @b); + printa("%@d\n", @a); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out new file mode 100644 index 00000000..ab976601 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out @@ -0,0 +1,38 @@ +287 + + value ------------- Distribution ------------- count + < 0 | 0 + 0 |@@@@ 1 + 100 |@@@@ 1 + 200 |@@@@ 1 + 300 |@@@@ 1 + 400 |@@@@ 1 + 500 |@@@@ 1 + 600 |@@@@ 1 + 700 |@@@@ 1 + 800 |@@@@ 1 + 900 |@@@@ 1 + >= 1000 | 0 + + + value ------------- Distribution ------------- count + -1 | 0 + 0 |@@@@ 1 + 1 | 0 + 2 | 0 + 4 | 0 + 8 | 0 + 16 | 0 + 32 | 0 + 64 |@@@@ 1 + 128 |@@@@ 1 + 256 |@@@@@@@@@@@@ 3 + 512 |@@@@@@@@@@@@@@@@ 4 + 1024 | 0 + +900 +0 +4500 +450 +10 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d new file mode 100644 index 00000000..2cfa1848 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.multinormalize.d.out new file mode 100644 index 00000000..992b31e2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d new file mode 100644 index 00000000..d24884b5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.neglquant.d.out new file mode 100644 index 00000000..3b7533b1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negorder.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negorder.d new file mode 100644 index 00000000..440c4839 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negorder.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negorder.d.out new file mode 100644 index 00000000..a03b6850 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negquant.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negquant.d new file mode 100644 index 00000000..bbc7263d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negquant.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negquant.d.out new file mode 100644 index 00000000..f8466b33 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d new file mode 100644 index 00000000..f90eae13 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtrunc.d.out new file mode 100644 index 00000000..c1b07a6d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d new file mode 100644 index 00000000..2a13d659 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.negtruncquant.d.out new file mode 100644 index 00000000..264aa392 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.normalize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.normalize.d new file mode 100644 index 00000000..0bcc0fe9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.normalize.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.normalize.d.out new file mode 100644 index 00000000..11193e65 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.order.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.order.d new file mode 100644 index 00000000..13900116 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.order.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.order.d.out new file mode 100644 index 00000000..505b0f32 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantize.d new file mode 100644 index 00000000..fad472af --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantize.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantize.d.out new file mode 100644 index 00000000..f4882ed2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d new file mode 100644 index 00000000..e547b1ec --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantmany.d.out new file mode 100644 index 00000000..45df2491 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantround.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantround.d new file mode 100644 index 00000000..c40d69c0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantround.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantround.d.out new file mode 100644 index 00000000..9b89ec14 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d new file mode 100644 index 00000000..bfa633cd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.quantzero.d.out new file mode 100644 index 00000000..c2c1cf02 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signature.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signature.d new file mode 100644 index 00000000..baa951a4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d new file mode 100644 index 00000000..ed3d1314 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeys.d.out new file mode 100644 index 00000000..42e619e0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d new file mode 100644 index 00000000..5836c6a5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.signedkeyspos.d.out new file mode 100644 index 00000000..28e95ac3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.stddev.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.stddev.d new file mode 100644 index 00000000..041b8207 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.stddev.d @@ -0,0 +1,64 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Positive stddev() test + * + * SECTION: Aggregations/Aggregations + * + * NOTES: This is a simple verifiable positive test of the stddev() function. + * printa() for one aggregation, default printing behavior for the other + * so that we exercise both code paths. + */ + +#pragma D option quiet + +BEGIN +{ + @a = stddev(5000000000); + @a = stddev(5000000100); + @a = stddev(5000000200); + @a = stddev(5000000300); + @a = stddev(5000000400); + @a = stddev(5000000500); + @a = stddev(5000000600); + @a = stddev(5000000700); + @a = stddev(5000000800); + @a = stddev(5000000900); + @b = stddev(-5000000000); + @b = stddev(-5000000100); + @b = stddev(-5000000200); + @b = stddev(-5000000300); + @b = stddev(-5000000400); + @b = stddev(-5000000500); + @b = stddev(-5000000600); + @b = stddev(-5000000700); + @b = stddev(-5000000800); + @b = stddev(-5000000900); + printa("%@d\n", @a); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out new file mode 100644 index 00000000..0c02852e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out @@ -0,0 +1,3 @@ +287 + + 287 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.subr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.subr.d new file mode 100644 index 00000000..5ca1f1ef --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.sum.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.sum.d new file mode 100644 index 00000000..1b9025af --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.sum.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.sum.d.out new file mode 100644 index 00000000..5d8b37b8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.sum.d.out @@ -0,0 +1,2 @@ + + 4500 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc.d new file mode 100644 index 00000000..d1c1b3cc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc.d.out new file mode 100644 index 00000000..2e18ef8b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d new file mode 100644 index 00000000..5c31069d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.trunc0.d.out new file mode 100644 index 00000000..70dc7a02 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d new file mode 100644 index 00000000..8baa56ab --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.truncquant.d.out new file mode 100644 index 00000000..86975af3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d new file mode 100644 index 00000000..ec0bee32 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/tst.valsortkeypos.d.out new file mode 100644 index 00000000..9b0acf92 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0.d new file mode 100644 index 00000000..0b7b6610 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_1.d new file mode 100644 index 00000000..11017951 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.divby0_2.d new file mode 100644 index 00000000..45469614 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.modby0.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_DIV_ZERO.modby0.d new file mode 100644 index 00000000..b2bf1462 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.addmin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.addmin.d new file mode 100644 index 00000000..f20339c1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.divmin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.divmin.d new file mode 100644 index 00000000..c11e64fd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muladd.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muladd.d new file mode 100644 index 00000000..bb107fb3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muldiv.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/err.D_SYNTAX.muldiv.d new file mode 100644 index 00000000..7d44b6c7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d new file mode 100644 index 00000000..435f09f6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d new file mode 100644 index 00000000..2db1b635 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_ARR_BADREF.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_ARR_BADREF.bad.d new file mode 100644 index 00000000..d31b1f64 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRBIG.toobig.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRBIG.toobig.d new file mode 100644 index 00000000..80422e88 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRNULL.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRNULL.bad.d new file mode 100644 index 00000000..6e7a34ff --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRSUB.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_ARRSUB.bad.d new file mode 100644 index 00000000..f4403677 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_PROTO_TYPE.badtuple.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_DECL_PROTO_TYPE.badtuple.d new file mode 100644 index 00000000..7e879dc6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_IDENT_UNDEF.badureg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/err.D_IDENT_UNDEF.badureg.d new file mode 100644 index 00000000..e48541b6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic1.d new file mode 100644 index 00000000..ba5b2cf0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic2.d new file mode 100644 index 00000000..14e1c5cf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic3.d new file mode 100644 index 00000000..897a12f2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic4.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic4.d new file mode 100644 index 00000000..3635a42d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic5.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic5.d new file mode 100644 index 00000000..866a8c39 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic6.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.basic6.d new file mode 100644 index 00000000..0371db30 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.uregsarray.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/tst.uregsarray.d new file mode 100644 index 00000000..b3fba0ca --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d new file mode 100644 index 00000000..6c4d0251 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test assigning a variable two different incompatible types. This should + * result in a compile-time error. + * + * SECTION: Variables/Associative Arrays + * + */ + +BEGIN +{ + x[123] = `kmem_flags; + x[456] = *`rootvp; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d new file mode 100644 index 00000000..e1f17cbb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test assigning a variable two different incompatible types. This should + * result in a compile-time error. + * + * SECTION: Variables/Associative Arrays + * + */ + +BEGIN +{ + self->x[123] = `kmem_flags; + self->x[456] = *`rootvp; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.this.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.this.d new file mode 100644 index 00000000..2af07ca5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_ARG.badsig.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_ARG.badsig.d new file mode 100644 index 00000000..d682fc68 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toofew.d new file mode 100644 index 00000000..b4e82b85 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_PROTO_LEN.toomany.d new file mode 100644 index 00000000..3dc5f7dd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_SYNTAX.errassign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.D_SYNTAX.errassign.d new file mode 100644 index 00000000..f31b66f1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.tupoflow.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/err.tupoflow.d new file mode 100644 index 00000000..81042026 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.cpyarray.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.cpyarray.d new file mode 100644 index 00000000..ca31cc35 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.diffprofile.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.diffprofile.d new file mode 100644 index 00000000..ad5fb377 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.initialize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.initialize.d new file mode 100644 index 00000000..1ab222b1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.invalidref.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.invalidref.d new file mode 100644 index 00000000..446acfad --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.misc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.misc.d new file mode 100644 index 00000000..43147dec --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d new file mode 100644 index 00000000..f474a572 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.this.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.this.d new file mode 100644 index 00000000..c4d01fa3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.valassign.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.valassign.d.out new file mode 100644 index 00000000..948d82e9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/tst.valassign.d.out @@ -0,0 +1,2 @@ +The value of i is 123 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.begin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.begin.d new file mode 100644 index 00000000..c2a60889 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.tick.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/err.D_PDESC_ZERO.tick.d new file mode 100644 index 00000000..44a363f8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.begin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.begin.d new file mode 100644 index 00000000..43e7744e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.begin.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.begin.d.out new file mode 100644 index 00000000..a9d8ee1e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.multibegin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.multibegin.d new file mode 100644 index 00000000..3d5fd124 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.multibegin.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/tst.multibegin.d.out new file mode 100644 index 00000000..e5bb9966 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_ADDROF_BITFIELD.BitfieldAddress.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_ADDROF_BITFIELD.BitfieldAddress.d new file mode 100644 index 00000000..9c5aca4c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.NegBitField.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.NegBitField.d new file mode 100644 index 00000000..acb296f4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.ZeroBitField.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFCONST.ZeroBitField.d new file mode 100644 index 00000000..dfe24c59 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.ExceedBaseType.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.ExceedBaseType.d new file mode 100644 index 00000000..d9abfd13 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.GreaterThan64.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFSIZE.GreaterThan64.d new file mode 100644 index 00000000..c1e359ed --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFTYPE.badtype.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_DECL_BFTYPE.badtype.d new file mode 100644 index 00000000..5e7b5233 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_OFFSETOF_BITFIELD.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_OFFSETOF_BITFIELD.d new file mode 100644 index 00000000..402a209d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_SIZEOF_BITFIELD.SizeofBitfield.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/err.D_SIZEOF_BITFIELD.SizeofBitfield.d new file mode 100644 index 00000000..70c28340 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/tst.BitFieldPromotion.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/tst.BitFieldPromotion.d new file mode 100644 index 00000000..07ec728b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/tst.SizeofBitField.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/tst.SizeofBitField.d new file mode 100644 index 00000000..ce307de6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.end.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.end.d new file mode 100644 index 00000000..a480d67a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.resize1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.resize1.d new file mode 100644 index 00000000..4731bd1f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.resize2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.resize2.d new file mode 100644 index 00000000..4dfe6b65 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.resize3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.resize3.d new file mode 100644 index 00000000..866a56c6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.zerobuf.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/err.zerobuf.d new file mode 100644 index 00000000..a2e44350 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.alignring.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.alignring.d new file mode 100644 index 00000000..152acb61 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.cputime.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.cputime.ksh new file mode 100644 index 00000000..6ac0fa9e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.dynvarsize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.dynvarsize.d new file mode 100644 index 00000000..c8a07400 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.fill1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.fill1.d new file mode 100644 index 00000000..143ed641 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.fill1.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.fill1.d.out new file mode 100644 index 00000000..fd8abec1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.resize1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.resize1.d new file mode 100644 index 00000000..396a8081 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.resize2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.resize2.d new file mode 100644 index 00000000..50b814b1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.resize3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.resize3.d new file mode 100644 index 00000000..eb362fb3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring1.d new file mode 100644 index 00000000..67e7b875 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring2.d new file mode 100644 index 00000000..cbf48f2b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring2.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring2.d.out new file mode 100644 index 00000000..cc4d41aa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring2.d.out @@ -0,0 +1,6 @@ +0 +1 +2 +3 +4 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring3.d new file mode 100644 index 00000000..68e35889 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring3.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring3.d.out new file mode 100644 index 00000000..99fd231e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.ring3.d.out @@ -0,0 +1,5 @@ +96 +97 +98 +99 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.smallring.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.smallring.d new file mode 100644 index 00000000..2134a0b7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.switch1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.switch1.d new file mode 100644 index 00000000..2840feef --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.switch1.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/tst.switch1.d.out new file mode 100644 index 00000000..ce6c2bcb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.cpuusage.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.cpuusage.d new file mode 100644 index 00000000..e1e0dd83 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.nice.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.nice.d new file mode 100644 index 00000000..c7a4ad21 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.priority.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.priority.d new file mode 100644 index 00000000..6ebb3dfa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.prsize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.prsize.d new file mode 100644 index 00000000..f467f192 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.rssize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/err.D_XLATE_NOCONV.rssize.d new file mode 100644 index 00000000..48057e14 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg0.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg0.d new file mode 100644 index 00000000..ec3c277f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg0clause.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg0clause.d new file mode 100644 index 00000000..4c782f83 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg1.d new file mode 100644 index 00000000..993a3765 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8.d new file mode 100644 index 00000000..b696d7c2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8clause.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.arg1to8clause.d new file mode 100644 index 00000000..fa62b03b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.caller.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.caller.d new file mode 100644 index 00000000..db1eabce --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.caller1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.caller1.d new file mode 100644 index 00000000..f1bfeedf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.epid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.epid.d new file mode 100644 index 00000000..4f04c656 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.epid1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.epid1.d new file mode 100644 index 00000000..4cba65e6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.errno.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.errno.d new file mode 100644 index 00000000..4d7a4ffc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.errno1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.errno1.d new file mode 100644 index 00000000..ed233bf0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.execname.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.execname.d new file mode 100644 index 00000000..b3007de3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.hpriority.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.hpriority.d new file mode 100644 index 00000000..a0d88367 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.id.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.id.d new file mode 100644 index 00000000..291d91d9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.id1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.id1.d new file mode 100644 index 00000000..068cff65 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.ipl.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.ipl.d new file mode 100644 index 00000000..2e6f349d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.ipl1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.ipl1.d new file mode 100644 index 00000000..ef9278d1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo.d new file mode 100644 index 00000000..f0e9d460 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.lwpsinfo1.d new file mode 100644 index 00000000..aa11b07d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.pid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.pid.d new file mode 100644 index 00000000..2dd80d71 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.pid1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.pid1.d new file mode 100644 index 00000000..5cee07c5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.d new file mode 100644 index 00000000..c90f6e93 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.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 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); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.d new file mode 100644 index 00000000..098f38b6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.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 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); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.tid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.tid.d new file mode 100644 index 00000000..1b16c8bb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.tid1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.tid1.d new file mode 100644 index 00000000..a0567e70 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.timestamp.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.timestamp.d new file mode 100644 index 00000000..cd94eac8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.vtimestamp.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/tst.vtimestamp.d new file mode 100644 index 00000000..cdbecfc7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggfun.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggfun.d new file mode 100644 index 00000000..f6877174 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggtup.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.aggtup.d new file mode 100644 index 00000000..1fa49747 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.arrtup.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.arrtup.d new file mode 100644 index 00000000..6c1cdffb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.body.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.body.d new file mode 100644 index 00000000..da499cb5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.both.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.both.d new file mode 100644 index 00000000..00708273 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.pred.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/err.D_IDENT_UNDEF.pred.d new file mode 100644 index 00000000..0bfc86f4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.nopred.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.nopred.d new file mode 100644 index 00000000..44d11675 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.pred.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.pred.d new file mode 100644 index 00000000..43bfedd8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.predfirst.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.predfirst.d new file mode 100644 index 00000000..c7f0b4eb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.predlast.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/tst.predlast.d new file mode 100644 index 00000000..9ed904f7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d new file mode 100644 index 00000000..1015a251 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Test to check that attempting to enable a valid event with a frequency + * lower than the default platform limit will fail. + * + * This test will fail if: + * 1) The system under test does not define the 'PAPI_tot_ins' event. + * 2) The 'dcpc-min-overflow' variable in dcpc.conf has been modified. + */ + +#pragma D option quiet + +BEGIN +{ + exit(0); +} + +cpc:::PAPI_tot_ins-all-100 +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.malformedoverflow.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.malformedoverflow.d new file mode 100644 index 00000000..f9b78094 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.malformedoverflow.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Tests that specifying an overflow value containing extraneous characters + * (only digits are allowed) will fail. + */ + +BEGIN +{ + exit(0); +} + +cpc:::PAPI_tot_ins-all-10000bonehead +{ + @[probename] = count(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.nonexistentevent.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.nonexistentevent.d new file mode 100644 index 00000000..73f9575f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.D_PDESC_ZERO.nonexistentevent.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Tests that attempting to enable a probe containing a non existent event + * will fail. + */ + +BEGIN +{ + exit(0); +} + +cpc:::PAPI_cpc_bad-all-10000 +{ + @[probename] = count(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart1.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart1.ksh new file mode 100755 index 00000000..767d493a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart1.ksh @@ -0,0 +1,78 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + + +# +# This tests that cpustat(1) should fail to start if the cpc provider +# is already calling the shots. +# +# This script will fail if: +# 1) The system under test does not define the 'PAPI_tot_ins' +# generic event. + +script() +{ + $dtrace -o $dtraceout -s /dev/stdin <' + exit 2 +fi + +dtrace=$1 +dtraceout=/tmp/dtrace.out.$$ +script 2>/dev/null & +timeout=15 + +# +# Sleep while the above script fires into life. To guard against dtrace dying +# and us sleeping forever we allow 15 secs for this to happen. This should be +# enough for even the slowest systems. +# +while [ ! -f $dtraceout ]; do + sleep 1 + timeout=$(($timeout-1)) + if [ $timeout -eq 0 ]; then + echo "dtrace failed to start. Exiting." + exit 1 + fi +done + +cpustat -c PAPI_tot_ins 1 5 +status=$? + +rm $dtraceout + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart2.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart2.ksh new file mode 100755 index 00000000..584469c3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cpcvscpustatpart2.ksh @@ -0,0 +1,70 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + + +# +# This tests that enablings from the cpc provider will fail if cpustat(1) is +# already master of the universe. +# +# This script will fail if: +# 1) The system under test does not define the 'PAPI_tot_ins' +# generic event. + +script() +{ + $dtrace -s /dev/stdin <' + exit 2 +fi + +dtrace=$1 +dtraceout=/tmp/dtrace.out.$$ + +cpustat -c PAPI_tot_ins 1 20 & +pid=$! +sleep 5 +script 2>/dev/null + +status=$? + +kill $pid +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cputrackfailtostart.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cputrackfailtostart.ksh new file mode 100755 index 00000000..f62b83d5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cputrackfailtostart.ksh @@ -0,0 +1,77 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. + +# +# This script ensures that cputrack(1M) will fail to start when the cpc +# provider has active enablings. +# +# The script will fail if: +# 1) The system under test does not define the 'PAPI_tot_ins' event. +# + +script() +{ + $dtrace -o $dtraceout -s /dev/stdin <' + exit 2 +fi + +dtrace=$1 +dtraceout=/tmp/dtrace.out.$$ +script 2>/dev/null & +timeout=15 + +# +# Sleep while the above script fires into life. To guard against dtrace dying +# and us sleeping forever we allow 15 secs for this to happen. This should be +# enough for even the slowest systems. +# +while [ ! -f $dtraceout ]; do + sleep 1 + timeout=$(($timeout-1)) + if [ $timeout -eq 0 ]; then + echo "dtrace failed to start. Exiting." + exit 1 + fi +done + +cputrack -c PAPI_tot_ins sleep 10 +status=$? + +rm $dtraceout + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cputrackterminates.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cputrackterminates.ksh new file mode 100755 index 00000000..58d1e798 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.cputrackterminates.ksh @@ -0,0 +1,70 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. + +# +# This script ensures that cputrack(1) will terminate when the cpc provider +# kicks into life. +# +# The script will fail if: +# 1) The system under test does not define the 'PAPI_tot_ins' event. +# + +script() +{ + $dtrace -s /dev/stdin < 10/ + { + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +cputrack -c PAPI_tot_ins sleep 20 & +cputrack_pid=$! +sleep 5 +script 2>/dev/null & + +wait $cputrack_pid +status=$? + +rm $dtraceout + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.toomanyenablings.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.toomanyenablings.d new file mode 100644 index 00000000..a50bd71a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/err.toomanyenablings.d @@ -0,0 +1,55 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Test to check that attempting to enable too many probes will fail. + * + * This test will fail if: + * 1) We ever execute on a platform which is capable of programming 10 + * 'PAPI_tot_ins' events simultaneously (which no current platforms are + * capable of doing). + * 2) The system under test does not define the 'PAPI_tot_ins' event. + */ + +#pragma D option quiet + +BEGIN +{ + exit(0); +} + +cpc:::PAPI_tot_ins-all-10000, +cpc:::PAPI_tot_ins-all-10001, +cpc:::PAPI_tot_ins-all-10002, +cpc:::PAPI_tot_ins-all-10003, +cpc:::PAPI_tot_ins-all-10004, +cpc:::PAPI_tot_ins-all-10005, +cpc:::PAPI_tot_ins-all-10006, +cpc:::PAPI_tot_ins-all-10007, +cpc:::PAPI_tot_ins-all-10008, +cpc:::PAPI_tot_ins-all-10009 +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.allcpus.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.allcpus.ksh new file mode 100755 index 00000000..7f026c9e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.allcpus.ksh @@ -0,0 +1,107 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# This script verifies that we can fire a probe on each CPU that is in +# an online state. +# +# The script will fail if: +# 1) The system under test does not define the 'PAPI_tot_ins' event. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +numproc=`psrinfo | tail -1 | cut -f1` +cpu=0 +dtraceout=/var/tmp/dtrace.out.$$ +scriptout=/var/tmp/script.out.$$ + +spin() +{ + while [ 1 ]; do + : + done +} + +script() +{ + $dtrace -o $dtraceout -s /dev/stdin < 10/ + { + printa(@a); + exit(0); + } +EOF +} + +echo "" > $scriptout +while [ $cpu -le $numproc ] +do + if [ "`psrinfo -s $cpu 2> /dev/null`" -eq 1 ]; then + printf "%9d %16d\n" $cpu 1 >> $scriptout + spin & + allpids[$cpu]=$! + pbind -b $cpu $! + fi + cpu=$(($cpu+1)) +done +echo "" >> $scriptout + +script + +diff $dtraceout $scriptout >/dev/null 2>&1 +status=$? + +# kill off the spinner processes +cpu=0 +while [ $cpu -le $numproc ] +do + if [ "`psrinfo -s $cpu 2> /dev/null`" -eq 1 ]; then + kill ${allpids[$cpu]} + fi + cpu=$(($cpu+1)) +done + +rm $dtraceout +rm $scriptout + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.genericevent.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.genericevent.d new file mode 100644 index 00000000..7ebf844e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.genericevent.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * Test that we can successfully enable a probe using a generic event. + * Currently, all platforms implement 'PAPI_tot_ins' so we'll use that. + * Note that this test will fail if the system under test does not + * implement that event. + * + * This test will fail if: + * 1) The system under test does not define the 'PAPI_tot_ins' event. + */ + +#pragma D option quiet +#pragma D option bufsize=128k + +cpc:::PAPI_tot_ins-all-10000 +{ + @[probename] = count(); +} + +tick-1s +/n++ > 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.platformevent.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.platformevent.ksh new file mode 100755 index 00000000..96d1ab8c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/tst.platformevent.ksh @@ -0,0 +1,81 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# This script ensures that we can enable a probe which specifies a platform +# specific event. +# + +if [ $# != 1 ]; then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 + +get_event() +{ + perl /dev/stdin /dev/stdout << EOF + open CPUSTAT, '/usr/sbin/cpustat -h |' + or die "Couldn't run cpustat: \$!\n"; + while () { + if (/(\s+)event\[*[0-9]-*[0-9]*\]*:/ && !/PAPI/) { + @a = split(/ /, \$_); + \$event = \$a[\$#a-1]; + } + } + + close CPUSTAT; + print "\$event\n"; +EOF +} + +script() +{ + $dtrace -s /dev/stdin << EOD + #pragma D option quiet + #pragma D option bufsize=128k + + cpc:::$1-all-10000 + { + @[probename] = count(); + } + + tick-1s + /n++ > 5/ + { + exit(0); + } +EOD +} + +event=$(get_event) +script $event + +status=$? + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_LOCASSC.NonLocalAssoc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_LOCASSC.NonLocalAssoc.d new file mode 100644 index 00000000..4c8ee508 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_LONGINT.LongStruct.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_LONGINT.LongStruct.d new file mode 100644 index 00000000..2c92bfdb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PARMCLASS.BadStorageClass.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PARMCLASS.BadStorageClass.d new file mode 100644 index 00000000..8278747e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_NAME.VoidName.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_NAME.VoidName.d new file mode 100644 index 00000000..3676c21c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_TYPE.Dyn.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_TYPE.Dyn.d new file mode 100644 index 00000000..aecf5499 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VARARGS.VarLenArgs.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VARARGS.VarLenArgs.d new file mode 100644 index 00000000..22dbbe9b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VOID.NonSoleVoid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_PROTO_VOID.NonSoleVoid.d new file mode 100644 index 00000000..620f0d7c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_SIGNINT.UnsignedStruct.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_SIGNINT.UnsignedStruct.d new file mode 100644 index 00000000..db2e4510 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_VOIDATTR.ShortVoidDecl.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/err.D_DECL_VOIDATTR.ShortVoidDecl.d new file mode 100644 index 00000000..81f90814 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.arrays.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.arrays.d new file mode 100644 index 00000000..34ddd5fc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.basics.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.basics.d new file mode 100644 index 00000000..4c1483e2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.funcs.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.funcs.d new file mode 100644 index 00000000..3b691eb2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.pointers.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.pointers.d new file mode 100644 index 00000000..d0ab6087 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.varargsfuncs.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/tst.varargsfuncs.d new file mode 100644 index 00000000..c12363fb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/badptr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/badptr.d new file mode 100644 index 00000000..c48c7294 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/countdown.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/countdown.d new file mode 100644 index 00000000..56b98815 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/counter.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/counter.d new file mode 100644 index 00000000..8b7b1b3b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/errorpath.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/errorpath.d new file mode 100644 index 00000000..76fd07c2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/hello.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/hello.d new file mode 100644 index 00000000..8e1ef8f7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/kstat.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/kstat.d new file mode 100644 index 00000000..49871497 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/ksyms.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/ksyms.d new file mode 100644 index 00000000..932262b0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/renormalize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/renormalize.d new file mode 100644 index 00000000..7d2c6af7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rtime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rtime.d new file mode 100644 index 00000000..087e8193 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rw.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rw.d new file mode 100644 index 00000000..6358a7dc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rwinfo.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rwinfo.d new file mode 100644 index 00000000..60f2b12a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rwtime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/rwtime.d new file mode 100644 index 00000000..2edffb90 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/specopen.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/specopen.d new file mode 100755 index 00000000..dff3e622 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/truss.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/truss.d new file mode 100644 index 00000000..b7925205 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/trussrw.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/trussrw.d new file mode 100644 index 00000000..9eb9bced --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/userfunc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/userfunc.d new file mode 100755 index 00000000..0d83465d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_AGGREGATION.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_AGGREGATION.d new file mode 100644 index 00000000..02b32438 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DBLERROR.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DBLERROR.d new file mode 100644 index 00000000..face4c8c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DYNAMIC.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_DYNAMIC.d new file mode 100644 index 00000000..f8a90f06 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.d new file mode 100644 index 00000000..8389ce02 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.end.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_PRINCIPAL.end.d new file mode 100644 index 00000000..a723019f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPEC.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPEC.d new file mode 100644 index 00000000..8f6df3c0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPECUNAVAIL.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_SPECUNAVAIL.d new file mode 100644 index 00000000..1fd39748 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d new file mode 100644 index 00000000..f5d6416b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/err.D_PDESC_ZERO.InvalidDescription1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/err.D_PDESC_ZERO.InvalidDescription1.d new file mode 100644 index 00000000..a0d17676 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.APIVersion.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.APIVersion.d new file mode 100644 index 00000000..21564897 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.AddSearchPath.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.AddSearchPath.d new file mode 100644 index 00000000..53fe67af --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d new file mode 100755 index 00000000..3cd9d02a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ELFGeneration.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ELFGeneration.d new file mode 100644 index 00000000..a30a140e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.IncludedFilePath.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.IncludedFilePath.d new file mode 100644 index 00000000..f4e4e4e1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithFunctions b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithFunctions new file mode 100644 index 00000000..e3db1270 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithIDs b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithIDs new file mode 100644 index 00000000..2b46ce34 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithModules b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithModules new file mode 100644 index 00000000..167c72a0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithNames b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithNames new file mode 100644 index 00000000..aabf1b2d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithProviders b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ListProbesWithProviders new file mode 100644 index 00000000..961d4096 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ShowCompilerCode.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.ShowCompilerCode.d new file mode 100644 index 00000000..556811d2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceFunctions b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceFunctions new file mode 100644 index 00000000..4c9c1c56 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceIDs b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceIDs new file mode 100644 index 00000000..d9615b5a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceModule b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceModule new file mode 100644 index 00000000..9c4401ea --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceNames b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceNames new file mode 100644 index 00000000..c3e75554 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceProvider b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.TraceProvider new file mode 100644 index 00000000..f52f395c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.VerboseStabilityReport.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/man.VerboseStabilityReport.d new file mode 100644 index 00000000..23742284 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh new file mode 100755 index 00000000..2f49f733 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeGiga.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeGiga.d.ksh new file mode 100644 index 00000000..2f0c5673 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeKilo.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeKilo.d.ksh new file mode 100644 index 00000000..d969b481 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeMega.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeMega.d.ksh new file mode 100644 index 00000000..a08327a3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeTera.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.BufsizeTera.d.ksh new file mode 100644 index 00000000..00f2c662 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel32.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel32.d.ksh new file mode 100755 index 00000000..e4ef38db --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel64.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DataModel64.d.ksh new file mode 100755 index 00000000..8a9de0c8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh new file mode 100755 index 00000000..9be2b291 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh.out new file mode 100644 index 00000000..5f91ad16 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DefineNameWithCPP.d.ksh.out @@ -0,0 +1,2 @@ +Value of VALUE: 40 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh new file mode 100755 index 00000000..0259db36 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh.out new file mode 100644 index 00000000..8975980f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh.out @@ -0,0 +1 @@ +Done chilling diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh new file mode 100755 index 00000000..6d3913f8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh.out new file mode 100644 index 00000000..8975980f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithID.d.ksh.out @@ -0,0 +1 @@ +Done chilling diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh new file mode 100755 index 00000000..923be51c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh.out new file mode 100644 index 00000000..8975980f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh.out @@ -0,0 +1 @@ +Done chilling diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh new file mode 100755 index 00000000..b21903fb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh.out new file mode 100644 index 00000000..8975980f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithName.d.ksh.out @@ -0,0 +1 @@ +Done chilling diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh new file mode 100755 index 00000000..09dafecb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh.out new file mode 100644 index 00000000..8975980f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithProvider.d.ksh.out @@ -0,0 +1 @@ +Done chilling diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithoutW.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithoutW.d.ksh new file mode 100755 index 00000000..9f051b4c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh new file mode 100755 index 00000000..b68fc138 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh new file mode 100755 index 00000000..ec38b502 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus1.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus1.d.ksh new file mode 100755 index 00000000..70a9f498 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus2.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExitStatus2.d.ksh new file mode 100755 index 00000000..a058d3a3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExtraneousProbeIds.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ExtraneousProbeIds.d.ksh new file mode 100755 index 00000000..090fc4a0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName1.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName1.d.ksh new file mode 100755 index 00000000..c28c7823 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName2.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidFuncName2.d.ksh new file mode 100755 index 00000000..d431579d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId1.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId1.d.ksh new file mode 100755 index 00000000..814b88dd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId2.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId2.d.ksh new file mode 100755 index 00000000..f9f44078 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId3.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidId3.d.ksh new file mode 100755 index 00000000..efb03ae2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule1.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule1.d.ksh new file mode 100755 index 00000000..a896ff3d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule2.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule2.d.ksh new file mode 100755 index 00000000..820cc64d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule3.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule3.d.ksh new file mode 100755 index 00000000..b56e6c37 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule4.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidModule4.d.ksh new file mode 100755 index 00000000..0ef9d956 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProbeIdentifier.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProbeIdentifier.d.ksh new file mode 100755 index 00000000..66e0e1a5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider1.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider1.d.ksh new file mode 100755 index 00000000..327e2d01 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider2.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider2.d.ksh new file mode 100755 index 00000000..22624495 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider3.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider3.d.ksh new file mode 100755 index 00000000..775b327c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider4.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidProvider4.d.ksh new file mode 100755 index 00000000..04343f3e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc1.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc1.d.ksh new file mode 100755 index 00000000..1395f3be --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc2.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc2.d.ksh new file mode 100755 index 00000000..4231e5c7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc3.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc3.d.ksh new file mode 100755 index 00000000..3c5b1783 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc4.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc4.d.ksh new file mode 100755 index 00000000..bb8460d0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc5.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc5.d.ksh new file mode 100755 index 00000000..54466761 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc6.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc6.d.ksh new file mode 100755 index 00000000..645e6d9f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh new file mode 100755 index 00000000..a93d5c4b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc8.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc8.d.ksh new file mode 100755 index 00000000..22ab3b16 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc9.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceFunc9.d.ksh new file mode 100755 index 00000000..2af27a32 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID1.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID1.d.ksh new file mode 100755 index 00000000..46096d21 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID2.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID2.d.ksh new file mode 100755 index 00000000..f406ce00 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID3.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID3.d.ksh new file mode 100755 index 00000000..fc2a24d5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID4.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID4.d.ksh new file mode 100755 index 00000000..5fd6fd6c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID5.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID5.d.ksh new file mode 100755 index 00000000..0ac46dbb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID6.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID6.d.ksh new file mode 100755 index 00000000..778d485a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID7.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceID7.d.ksh new file mode 100755 index 00000000..8a0f2d4e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule1.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule1.d.ksh new file mode 100755 index 00000000..56dee0dd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule2.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule2.d.ksh new file mode 100755 index 00000000..a508fe10 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule3.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule3.d.ksh new file mode 100755 index 00000000..599ce93e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule4.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule4.d.ksh new file mode 100755 index 00000000..e0e87861 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule5.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule5.d.ksh new file mode 100755 index 00000000..85830602 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule6.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule6.d.ksh new file mode 100755 index 00000000..6125fb0f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule7.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule7.d.ksh new file mode 100755 index 00000000..e689627b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule8.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceModule8.d.ksh new file mode 100755 index 00000000..692821b5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName1.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName1.d.ksh new file mode 100755 index 00000000..43c61af3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName2.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName2.d.ksh new file mode 100755 index 00000000..70a52188 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName3.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName3.d.ksh new file mode 100755 index 00000000..efb5ad08 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName4.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName4.d.ksh new file mode 100755 index 00000000..04845b99 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName5.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName5.d.ksh new file mode 100755 index 00000000..df17231f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName6.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName6.d.ksh new file mode 100755 index 00000000..10f13cb3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName7.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName7.d.ksh new file mode 100755 index 00000000..b22561fa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName8.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName8.d.ksh new file mode 100755 index 00000000..f66055e2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName9.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceName9.d.ksh new file mode 100755 index 00000000..a4239ff9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider1.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider1.d.ksh new file mode 100755 index 00000000..0a792c59 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider2.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider2.d.ksh new file mode 100755 index 00000000..1763142b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider3.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider3.d.ksh new file mode 100755 index 00000000..a8549329 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider4.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider4.d.ksh new file mode 100755 index 00000000..f8a1359c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider5.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.InvalidTraceProvider5.d.ksh new file mode 100755 index 00000000..cec4297c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.MultipleInvalidProbeId.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.MultipleInvalidProbeId.d.ksh new file mode 100755 index 00000000..8f2ceefd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh new file mode 100755 index 00000000..182466f4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh new file mode 100755 index 00000000..4bfbf767 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh.out new file mode 100644 index 00000000..20e31b50 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.QuietMode.d.ksh.out @@ -0,0 +1 @@ +I am the only one. diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh new file mode 100755 index 00000000..16cd05f9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh.out new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.UnDefineNameWithCPP.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.UnDefineNameWithCPP.d.ksh new file mode 100755 index 00000000..4c1eb507 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh new file mode 100755 index 00000000..5e61f053 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh.out new file mode 100644 index 00000000..0f2e1aac --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh.out @@ -0,0 +1 @@ +I am done diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh new file mode 100755 index 00000000..9d48f99b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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 unix'{printf("I am done"); exit(0);}' + +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed +fi + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh.out new file mode 100644 index 00000000..0f2e1aac --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh.out @@ -0,0 +1 @@ +I am done diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh new file mode 100755 index 00000000..90175a50 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh.out new file mode 100644 index 00000000..0f2e1aac --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroNameProbes.d.ksh.out @@ -0,0 +1 @@ +I am done diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbeIdentfier.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbeIdentfier.d.ksh new file mode 100755 index 00000000..9af4d2b8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbesWithoutZ.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProbesWithoutZ.d.ksh new file mode 100755 index 00000000..afc7d76d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh new file mode 100755 index 00000000..f2646bd5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh.out new file mode 100644 index 00000000..0f2e1aac --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroProviderProbes.d.ksh.out @@ -0,0 +1 @@ +I am done diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/err.D_IDENT_UNDEF.timespent.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/err.D_IDENT_UNDEF.timespent.d new file mode 100644 index 00000000..04ccb726 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.end.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.end.d new file mode 100644 index 00000000..56c1a4c4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.endwithoutbegin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.endwithoutbegin.d new file mode 100644 index 00000000..62919607 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.multibeginend.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.multibeginend.d new file mode 100644 index 00000000..4f6ec921 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.multiend.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/tst.multiend.d new file mode 100644 index 00000000..e6629fb5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_DECL_IDRED.EnumSameName.d new file mode 100644 index 00000000..7e5427a5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/err.D_UNKNOWN.RepeatIdentifiers.d new file mode 100644 index 00000000..2b4266d5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumEquality.d new file mode 100644 index 00000000..cbf9369a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumSameValue.d new file mode 100644 index 00000000..26a4d504 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/tst.EnumValAssign.d new file mode 100644 index 00000000..f721c50a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_BADADDR.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_BADADDR.d new file mode 100644 index 00000000..5eb3e94c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_DIVZERO.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_DIVZERO.d new file mode 100644 index 00000000..5b93168a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_UNKNOWN.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.DTRACEFLT_UNKNOWN.d new file mode 100644 index 00000000..6de75bbc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.error.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.error.d new file mode 100644 index 00000000..3b1d6539 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.errorend.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/tst.errorend.d new file mode 100644 index 00000000..0bb4a6ef --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/err.D_PROTO_LEN.noarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/err.D_PROTO_LEN.noarg.d new file mode 100644 index 00000000..9a9a8f93 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/err.exitarg1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/err.exitarg1.d new file mode 100644 index 00000000..d3067d12 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/tst.basic1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/tst.basic1.d new file mode 100644 index 00000000..24f841c3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/err.D_PDESC_ZERO.notreturn.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/err.D_PDESC_ZERO.notreturn.d new file mode 100644 index 00000000..5e3d5fa7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.basic.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.basic.d new file mode 100644 index 00000000..ff6da26f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d new file mode 100644 index 00000000..78e107ee --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d new file mode 100644 index 00000000..6d1b8a8f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d new file mode 100644 index 00000000..c2c7bf04 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d new file mode 100644 index 00000000..be2c0d6a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d new file mode 100644 index 00000000..240744bf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.return.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.return.d new file mode 100644 index 00000000..b269710e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d new file mode 100644 index 00000000..cadbaa00 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d new file mode 100644 index 00000000..67ef106f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_FUNC_UNDEF.progenyofbad1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_FUNC_UNDEF.progenyofbad1.d new file mode 100644 index 00000000..bfd1eedf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_OP_VFPTR.badop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_OP_VFPTR.badop.d new file mode 100644 index 00000000..d219bb1f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.chillbadarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.chillbadarg.d new file mode 100644 index 00000000..08bd9819 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.copyoutbadarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.copyoutbadarg.d new file mode 100644 index 00000000..5c02378f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.mobadarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.mobadarg.d new file mode 100644 index 00000000..4df8d186 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.raisebadarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.raisebadarg.d new file mode 100644 index 00000000..a3336efe --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.allocanoarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.allocanoarg.d new file mode 100644 index 00000000..a2af00f9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.badbreakpoint.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.badbreakpoint.d new file mode 100644 index 00000000..0cb567a5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoofew.d new file mode 100644 index 00000000..a0018fa8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.chilltoomany.d new file mode 100644 index 00000000..f24e9ef1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrbadarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrbadarg.d new file mode 100644 index 00000000..1f07814b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrtoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyoutstrtoofew.d new file mode 100644 index 00000000..e01868c0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoofew.d new file mode 100644 index 00000000..f3706f62 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.copyouttoomany.d new file mode 100644 index 00000000..6fab90d8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d new file mode 100644 index 00000000..e878713a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d new file mode 100644 index 00000000..d3b9ed48 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d new file mode 100644 index 00000000..6ad1e47b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d new file mode 100644 index 00000000..98bc5c93 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d new file mode 100644 index 00000000..e4f259a7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.panicbadarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.panicbadarg.d new file mode 100644 index 00000000..87589b48 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.progenyofbad2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.progenyofbad2.d new file mode 100644 index 00000000..51c8674d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.stopbadarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.stopbadarg.d new file mode 100644 index 00000000..8b605071 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_STRINGOF_TYPE.badstringof.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_STRINGOF_TYPE.badstringof.d new file mode 100644 index 00000000..fec5649b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_VAR_UNDEF.badvar.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.D_VAR_UNDEF.badvar.d new file mode 100644 index 00000000..bb4fd2d1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badalloca.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badalloca.d new file mode 100644 index 00000000..572daa39 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badalloca2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badalloca2.d new file mode 100644 index 00000000..fbbf8e2e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy.d new file mode 100644 index 00000000..d7184b0f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy1.d new file mode 100644 index 00000000..c29eb2bb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy2.d new file mode 100644 index 00000000..6d49e6ec --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy3.d new file mode 100644 index 00000000..c362caad --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy4.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy4.d new file mode 100644 index 00000000..4148ae7b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy5.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy5.d new file mode 100644 index 00000000..a0cbd5d4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy6.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badbcopy6.d new file mode 100644 index 00000000..32770145 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badchill.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.badchill.d new file mode 100644 index 00000000..b394a88b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.chillbadarg.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.chillbadarg.ksh new file mode 100644 index 00000000..98f04dd2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.copyout.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.copyout.d new file mode 100644 index 00000000..6b9db3b8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.copyoutbadaddr.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.copyoutbadaddr.ksh new file mode 100644 index 00000000..de5c47d5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.copyoutstrbadaddr.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.copyoutstrbadaddr.ksh new file mode 100644 index 00000000..181702b8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntoa6badaddr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntoa6badaddr.d new file mode 100644 index 00000000..81ce643f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntoabadaddr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntoabadaddr.d new file mode 100644 index 00000000..3f0d8e45 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadaddr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadaddr.d new file mode 100644 index 00000000..74ce760d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/err.inet_ntopbadarg.d new file mode 100644 index 00000000..2731385d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.badfreopen.ksh new file mode 100644 index 00000000..72f6b87f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.basename.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.basename.d new file mode 100644 index 00000000..6fb996c9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out new file mode 100755 index 00000000..e16541ad --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.bcopy.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.bcopy.d new file mode 100644 index 00000000..8501ff44 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.chill.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.chill.ksh new file mode 100644 index 00000000..aae1c688 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d new file mode 100644 index 00000000..2f054185 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d.out new file mode 100644 index 00000000..b8bdc099 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.copyin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.copyin.d new file mode 100644 index 00000000..186b9741 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.copyinto.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.copyinto.d new file mode 100644 index 00000000..c282e61d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.ddi_pathname.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.ddi_pathname.d new file mode 100644 index 00000000..3716d0ce --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.default.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.default.d new file mode 100644 index 00000000..c4a4e4f3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.freopen.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.freopen.ksh new file mode 100644 index 00000000..f87d6e18 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh new file mode 100644 index 00000000..b02af07b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.ftruncate.ksh.out new file mode 100644 index 00000000..3360fd26 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.hton.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.hton.d new file mode 100644 index 00000000..f0118838 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.hton.d @@ -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 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. + */ + +#include + +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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.index.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.index.d new file mode 100644 index 00000000..547730a1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.index.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.index.d.out new file mode 100755 index 00000000..276576c2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d new file mode 100644 index 00000000..cf7459d3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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 + +ipaddr_t *ip4a; +ipaddr_t *ip4b; +ipaddr_t *ip4c; +ipaddr_t *ip4d; + +BEGIN +{ + this->buf4a = alloca(sizeof (ipaddr_t)); + this->buf4b = alloca(sizeof (ipaddr_t)); + this->buf4c = alloca(sizeof (ipaddr_t)); + this->buf4d = alloca(sizeof (ipaddr_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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d.out new file mode 100644 index 00000000..ab535e78 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d new file mode 100644 index 00000000..9a00eb78 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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->_S6_un._S6_u8[0] = 0xfe; + ip6a->_S6_un._S6_u8[1] = 0x80; + ip6a->_S6_un._S6_u8[8] = 0x02; + ip6a->_S6_un._S6_u8[9] = 0x14; + ip6a->_S6_un._S6_u8[10] = 0x4f; + ip6a->_S6_un._S6_u8[11] = 0xff; + ip6a->_S6_un._S6_u8[12] = 0xfe; + ip6a->_S6_un._S6_u8[13] = 0x0b; + ip6a->_S6_un._S6_u8[14] = 0x76; + ip6a->_S6_un._S6_u8[15] = 0xc8; + ip6b->_S6_un._S6_u8[0] = 0x10; + ip6b->_S6_un._S6_u8[1] = 0x80; + ip6b->_S6_un._S6_u8[10] = 0x08; + ip6b->_S6_un._S6_u8[11] = 0x08; + ip6b->_S6_un._S6_u8[13] = 0x20; + ip6b->_S6_un._S6_u8[13] = 0x0c; + ip6b->_S6_un._S6_u8[14] = 0x41; + ip6b->_S6_un._S6_u8[15] = 0x7a; + ip6c->_S6_un._S6_u8[15] = 0x01; + ip6e->_S6_un._S6_u8[12] = 0x7f; + ip6e->_S6_un._S6_u8[15] = 0x01; + ip6f->_S6_un._S6_u8[10] = 0xff; + ip6f->_S6_un._S6_u8[11] = 0xff; + ip6f->_S6_un._S6_u8[12] = 0x7f; + ip6f->_S6_un._S6_u8[15] = 0x01; + ip6g->_S6_un._S6_u8[10] = 0xff; + ip6g->_S6_un._S6_u8[11] = 0xfe; + ip6g->_S6_un._S6_u8[12] = 0x7f; + ip6g->_S6_un._S6_u8[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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d.out new file mode 100644 index 00000000..d87c1f61 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d new file mode 100644 index 00000000..c1e4b1bb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d @@ -0,0 +1,135 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +ipaddr_t *ip4a; +ipaddr_t *ip4b; +ipaddr_t *ip4c; +ipaddr_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 (ipaddr_t)); + this->buf4b = alloca(sizeof (ipaddr_t)); + this->buf4c = alloca(sizeof (ipaddr_t)); + this->buf4d = alloca(sizeof (ipaddr_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->_S6_un._S6_u8[0] = 0xfe; + ip6a->_S6_un._S6_u8[1] = 0x80; + ip6a->_S6_un._S6_u8[8] = 0x02; + ip6a->_S6_un._S6_u8[9] = 0x14; + ip6a->_S6_un._S6_u8[10] = 0x4f; + ip6a->_S6_un._S6_u8[11] = 0xff; + ip6a->_S6_un._S6_u8[12] = 0xfe; + ip6a->_S6_un._S6_u8[13] = 0x0b; + ip6a->_S6_un._S6_u8[14] = 0x76; + ip6a->_S6_un._S6_u8[15] = 0xc8; + ip6b->_S6_un._S6_u8[0] = 0x10; + ip6b->_S6_un._S6_u8[1] = 0x80; + ip6b->_S6_un._S6_u8[10] = 0x08; + ip6b->_S6_un._S6_u8[11] = 0x08; + ip6b->_S6_un._S6_u8[13] = 0x20; + ip6b->_S6_un._S6_u8[13] = 0x0c; + ip6b->_S6_un._S6_u8[14] = 0x41; + ip6b->_S6_un._S6_u8[15] = 0x7a; + ip6c->_S6_un._S6_u8[15] = 0x01; + ip6e->_S6_un._S6_u8[12] = 0x7f; + ip6e->_S6_un._S6_u8[15] = 0x01; + ip6f->_S6_un._S6_u8[10] = 0xff; + ip6f->_S6_un._S6_u8[11] = 0xff; + ip6f->_S6_un._S6_u8[12] = 0x7f; + ip6f->_S6_un._S6_u8[15] = 0x01; + ip6g->_S6_un._S6_u8[10] = 0xff; + ip6g->_S6_un._S6_u8[11] = 0xfe; + ip6g->_S6_un._S6_u8[12] = 0x7f; + ip6g->_S6_un._S6_u8[15] = 0x01; + ip6h->_S6_un._S6_u8[0] = 0xff; + ip6h->_S6_un._S6_u8[1] = 0xff; + ip6h->_S6_un._S6_u8[2] = 0xff; + ip6h->_S6_un._S6_u8[3] = 0xff; + ip6h->_S6_un._S6_u8[4] = 0xff; + ip6h->_S6_un._S6_u8[5] = 0xff; + ip6h->_S6_un._S6_u8[6] = 0xff; + ip6h->_S6_un._S6_u8[7] = 0xff; + ip6h->_S6_un._S6_u8[8] = 0xff; + ip6h->_S6_un._S6_u8[9] = 0xff; + ip6h->_S6_un._S6_u8[10] = 0xff; + ip6h->_S6_un._S6_u8[11] = 0xff; + ip6h->_S6_un._S6_u8[12] = 0xff; + ip6h->_S6_un._S6_u8[13] = 0xff; + ip6h->_S6_un._S6_u8[14] = 0xff; + ip6h->_S6_un._S6_u8[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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d.out new file mode 100644 index 00000000..7c8311c2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d new file mode 100644 index 00000000..03e295a7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d.out new file mode 100644 index 00000000..e007c648 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.lltostr.d.out @@ -0,0 +1,8 @@ +0 +1 +-1 +123456789 +-123456789 +4611686018427387904 +-4611686018427387904 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.mutex_owned.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.mutex_owned.d new file mode 100644 index 00000000..b4aa84f9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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((kmutex_t *)arg0); + this->owner = mutex_owner((kmutex_t *)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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d new file mode 100644 index 00000000..a021d502 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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 + +kthread_t *ptr; + +BEGIN +{ + i = 0; +} + +lockstat:genunix:mutex_enter:adaptive-acquire +{ + + ptr = mutex_owner((kmutex_t *)arg0); + i++; +} + +tick-1 +/i > 5/ +{ + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d new file mode 100644 index 00000000..c13abab2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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; +} + +mutex_enter:adaptive-acquire +{ + ret = mutex_type_adaptive((kmutex_t *)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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.progenyof.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.progenyof.d new file mode 100644 index 00000000..02911580 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.rand.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.rand.d new file mode 100644 index 00000000..51f44911 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strchr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strchr.d new file mode 100644 index 00000000..8dc8f89b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strchr.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strchr.d.out new file mode 100644 index 00000000..328b5318 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d new file mode 100644 index 00000000..392c18a6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d.out new file mode 100644 index 00000000..65728694 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d.out @@ -0,0 +1,5 @@ +foobaz +foo +baz + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strstr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strstr.d new file mode 100644 index 00000000..0c81b7a8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strstr.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strstr.d.out new file mode 100644 index 00000000..f9121dbc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strtok.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strtok.d new file mode 100644 index 00000000..47092ba4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strtok.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strtok.d.out new file mode 100644 index 00000000..4bc37274 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strtok.d.out @@ -0,0 +1,5 @@ +Carrots +Barley +Oatmeal +Beans + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strtok_null.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.strtok_null.d new file mode 100644 index 00000000..6de4f97d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substr.d new file mode 100644 index 00000000..edee6442 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out new file mode 100755 index 00000000..5b498ef3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d new file mode 100644 index 00000000..2c025410 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d.out new file mode 100644 index 00000000..26c19aa2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d.out @@ -0,0 +1,3 @@ +Bryan is +he's not a dummy + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.system.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.system.d new file mode 100644 index 00000000..b7ffbfa4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.system.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.system.d.out new file mode 100644 index 00000000..cd0d735f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/err.D_ADDROF_LVAL.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/err.D_ADDROF_LVAL.d new file mode 100644 index 00000000..8f5d694a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/err.D_EMPTY.empty.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/err.D_EMPTY.empty.d new file mode 100644 index 00000000..929ccc69 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/tst.clauses.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/tst.clauses.d new file mode 100644 index 00000000..a9930292 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/tst.stmts.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/tst.stmts.d new file mode 100644 index 00000000..03a015ad --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef1.d new file mode 100644 index 00000000..39f2996a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_DECL_IDRED.redef2.d new file mode 100644 index 00000000..1df59080 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_IDENT_UNDEF.recur.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_IDENT_UNDEF.recur.d new file mode 100644 index 00000000..95522d0e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef1.d new file mode 100644 index 00000000..a42afb74 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef2.d new file mode 100644 index 00000000..9a246b4b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d new file mode 100644 index 00000000..963b6048 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineDataAssign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineDataAssign.d new file mode 100644 index 00000000..c7ab62fd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineExpression.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineExpression.d new file mode 100644 index 00000000..d67d3f27 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d new file mode 100644 index 00000000..7f188fb0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineKinds.d.out new file mode 100644 index 00000000..c9a603b2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineTypedef.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineTypedef.d new file mode 100644 index 00000000..a6247659 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineWritableAssign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/tst.InlineWritableAssign.d new file mode 100644 index 00000000..a7842a33 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/tst.fds.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/tst.fds.c new file mode 100644 index 00000000..2785b51f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/tst.fds.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/tst.fds.d new file mode 100644 index 00000000..52a3312d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/tst.fds.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/tst.fds.d.out new file mode 100644 index 00000000..9d268268 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl new file mode 100755 index 00000000..fb412554 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl @@ -0,0 +1,104 @@ +#!/usr/bin/perl -w +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#pragma ident "%Z%%M% %I% %E% SMI" + +# +# get.ipv4remote.pl [tcpport] +# +# Find an IPv4 reachable remote host using both ifconfig(1M) and ping(1M). +# If a tcpport is specified, return a host that is also listening on this +# TCP port. Print the local address and the remote address, or an +# error message if no suitable remote host was found. Exit status is 0 if +# a host was found. +# + +use strict; +use IO::Socket; + +my $MAXHOSTS = 32; # max hosts to port scan +my $TIMEOUT = 3; # connection timeout +my $tcpport = @ARGV == 1 ? $ARGV[0] : 0; + +# +# Determine local IP address +# +my $local = ""; +my $remote = ""; +my %Broadcast; +my $up; +open IFCONFIG, '/usr/sbin/ifconfig -a |' or die "Couldn't run ifconfig: $!\n"; +while () { + next if /^lo/; + + # "UP" is always printed first (see print_flags() in ifconfig.c): + $up = 1 if /^[a-z].*) { + if (/bytes from (.*): / and not defined $Broadcast{$1}) { + my $addr = $1; + + if ($tcpport != 0) { + # + # Test TCP + # + my $socket = IO::Socket::INET->new( + Proto => "tcp", + PeerAddr => $addr, + PeerPort => $tcpport, + Timeout => $TIMEOUT, + ); + next unless $socket; + close $socket; + } + + $remote = $addr; + last; + } +} +close PING; +die "Can't find a remote host for testing: No suitable response from " . + "$Broadcast{$local}\n" if $remote eq ""; + +print "$local $remote\n"; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl new file mode 100755 index 00000000..051ab8c3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl @@ -0,0 +1,88 @@ +#!/usr/bin/perl -w +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#pragma ident "%Z%%M% %I% %E% SMI" + +# +# get.ipv6remote.pl +# +# Find an IPv6 reachable remote host using both ifconfig(1M) and ping(1M). +# Print the local address and the remote address, or print nothing if either +# no IPv6 interfaces or remote hosts were found. (Remote IPv6 testing is +# considered optional, and so not finding another IPv6 host is not an error +# state we need to log.) Exit status is 0 if a host was found. +# + +use strict; +use IO::Socket; + +my $MAXHOSTS = 32; # max hosts to scan +my $TIMEOUT = 3; # connection timeout +my $MULTICAST = "FF02::1"; # IPv6 multicast address + +# +# Determine local IP address +# +my $local = ""; +my $remote = ""; +my %Local; +my $up; +open IFCONFIG, '/usr/sbin/ifconfig -a inet6 |' + or die "Couldn't run ifconfig: $!\n"; +while () { + next if /^lo/; + + # "UP" is always printed first (see print_flags() in ifconfig.c): + $up = 1 if /^[a-z].*) { + if (/bytes from (.*): / and not defined $Local{$1}) { + $remote = $1; + last; + } +} +close PING; +exit 2 if $remote eq ""; + +print "$local $remote\n"; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh new file mode 100755 index 00000000..0965040e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh @@ -0,0 +1,70 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#pragma ident "%Z%%M% %I% %E% SMI" + +# +# Test ip:::{send,receive} of IPv4 ICMP to a local address. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. The lo0 interface missing or not up. +# 3. Unrelated ICMP on lo0 traced by accident. +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +local=127.0.0.1 + +$dtrace -c "/usr/sbin/ping $local 3" -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_ICMP/ +{ + printf("1 ip:::send ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[4]: %d %d %d %d %d)\n", + args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags, + args[4]->ipv4_offset, args[4]->ipv4_ttl); +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_ICMP/ +{ + printf("2 ip:::receive ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[4]: %d %d %d %d %d)\n", + args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags, + args[4]->ipv4_offset, args[4]->ipv4_ttl); +} +EOF diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh.out new file mode 100644 index 00000000..41d6e0c8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh.out @@ -0,0 +1,6 @@ + +1 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 255) +1 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 255) +2 ip:::receive (args[2]: 4 64, args[4]: 4 84 0 0 255) +2 ip:::receive (args[2]: 4 64, args[4]: 4 84 0 0 255) +127.0.0.1 is alive diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh new file mode 100644 index 00000000..6fa8c35b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh @@ -0,0 +1,125 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# + +# +# Test {ip,tcp}:::{send,receive} of IPv4 TCP to local host. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. The lo0 interface missing or not up. +# 3. The local ssh service is not online. +# 4. An unlikely race causes the unlocked global send/receive +# variables to be corrupted. +# +# This test performs a TCP connection and checks that at least the +# following packet counts were traced: +# +# 3 x ip:::send (2 during the TCP handshake, then a FIN) +# 3 x tcp:::send (2 during the TCP handshake, then a FIN) +# 2 x ip:::receive (1 during the TCP handshake, then the FIN ACK) +# 2 x tcp:::receive (1 during the TCP handshake, then the FIN ACK) + +# The actual count tested is 5 each way, since we are tracing both +# source and destination events. +# +# For this test to work, we are assuming that the TCP handshake and +# TCP close will enter the IP code path and not use tcp fusion. +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +local=127.0.0.1 +tcpport=22 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.pl <<-EOPERL + use IO::Socket; + my \$s = IO::Socket::INET->new( + Proto => "tcp", + PeerAddr => "$local", + PeerPort => $tcpport, + Timeout => 3); + die "Could not connect to host $local port $tcpport" unless \$s; + close \$s; +EOPERL + +$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipsend++; +} + +tcp:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/ +{ + tcpsend++; +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipreceive++; +} + +tcp:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/ +{ + tcpreceive++; +} + +END +{ + printf("Minimum TCP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 5 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 5 ? "yes" : "no"); + printf("tcp:::send - %s\n", tcpsend >= 5 ? "yes" : "no"); + printf("tcp:::receive - %s\n", tcpreceive >= 5 ? "yes" : "no"); +} +EODTRACE + +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh.out new file mode 100644 index 00000000..2a85b98b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh.out @@ -0,0 +1,7 @@ +Minimum TCP events seen + +ip:::send - yes +ip:::receive - yes +tcp:::send - yes +tcp:::receive - yes + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh new file mode 100644 index 00000000..fa8f7acf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh @@ -0,0 +1,93 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# + +# +# Test ip:::{send,receive} of IPv4 UDP to a local address. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. No physical network interface is plumbed and up. +# 3. No other hosts on this subnet are reachable and listening on rpcbind. +# 4. An unlikely race causes the unlocked global send/receive +# variables to be corrupted. +# +# This test sends a UDP message using ping and checks that at least the +# following counts were traced: +# +# 1 x ip:::send (UDP sent to ping's base UDP port) +# 1 x udp:::send (UDP sent to ping's base UDP port) +# 1 x ip:::receive (UDP received) +# +# No udp:::receive event is expected as the response ping -U elicits is +# an ICMP PORT_UNREACHABLE response rather than a UDP packet, and locally +# the echo request UDP packet only reaches IP, so the udp:::receive probe +# is not triggered by it. +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +local=127.0.0.1 + +$dtrace -c "/usr/sbin/ping -U $local" -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_UDP/ +{ + ipsend++; +} + +udp:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/ +{ + udpsend++; +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_UDP/ +{ + ipreceive++; +} + +END +{ + printf("Minimum UDP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 1 ? "yes" : "no"); + printf("udp:::send - %s\n", udpsend >= 1 ? "yes" : "no"); +} +EOF diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out new file mode 100644 index 00000000..bca55327 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out @@ -0,0 +1,6 @@ +Minimum UDP events seen + +ip:::send - yes +ip:::receive - yes +udp:::send - yes + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh new file mode 100755 index 00000000..efe0d30f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh @@ -0,0 +1,81 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#pragma ident "%Z%%M% %I% %E% SMI" + +# +# Test ip:::{send,receive} of IPv4 ICMP to a remote host. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. No physical network interface is plumbed and up. +# 3. No other hosts on this subnet are reachable. +# 4. An unrelated ICMP between these hosts was traced by accident. +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +getaddr=./get.ipv4remote.pl + +if [[ ! -x $getaddr ]]; then + print -u2 "could not find or execute sub program: $getaddr" + exit 3 +fi +$getaddr | read source dest +if (( $? != 0 )); then + exit 4 +fi + +$dtrace -c "/usr/sbin/ping $dest 3" -qs /dev/stdin <ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->ipv4_protocol == IPPROTO_ICMP/ +{ + printf("1 ip:::send ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[4]: %d %d %d %d %d)\n", + args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags, + args[4]->ipv4_offset, args[4]->ipv4_ttl); +} + +ip:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[4]->ipv4_protocol == IPPROTO_ICMP/ +{ + printf("2 ip:::receive ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[4]: %d %d %d %d %d)\n", + args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags, + args[4]->ipv4_offset, args[4]->ipv4_ttl); +} +EOF diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh.out new file mode 100644 index 00000000..b5915f8d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh.out @@ -0,0 +1,3 @@ + +1 ip:::send (args[2]: 4 64, args[4]: 4 84 0 0 255) +2 ip:::receive (args[2]: 4 64, args[4]: 4 84 4 0 255) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh new file mode 100644 index 00000000..89a0cdb9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh @@ -0,0 +1,128 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# + +# +# Test {tcp,ip}:::{send,receive} of IPv4 TCP to a remote host. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. No physical network interface is plumbed and up. +# 3. No other hosts on this subnet are reachable and listening on ssh. +# 4. An unlikely race causes the unlocked global send/receive +# variables to be corrupted. +# +# This test performs a TCP connection and checks that at least the +# following packet counts were traced: +# +# 3 x ip:::send (2 during the TCP handshake, then a FIN) +# 3 x tcp:::send (2 during the TCP handshake, then a FIN) +# 2 x ip:::receive (1 during the TCP handshake, then the FIN ACK) +# 2 x tcp:::receive (1 during the TCP handshake, then the FIN ACK) +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +getaddr=./get.ipv4remote.pl +tcpport=22 +DIR=/var/tmp/dtest.$$ + +if [[ ! -x $getaddr ]]; then + print -u2 "could not find or execute sub program: $getaddr" + exit 3 +fi +$getaddr $tcpport | read source dest +if (( $? != 0 )); then + exit 4 +fi + +mkdir $DIR +cd $DIR + +cat > test.pl <<-EOPERL + use IO::Socket; + my \$s = IO::Socket::INET->new( + Proto => "tcp", + PeerAddr => "$dest", + PeerPort => $tcpport, + Timeout => 3); + die "Could not connect to host $dest port $tcpport" unless \$s; + close \$s; +EOPERL + +$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipsend++; +} + +tcp:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest"/ +{ + tcpsend++; +} + +ip:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipreceive++; +} + +tcp:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source"/ +{ + tcpreceive++; +} + +END +{ + printf("Minimum TCP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 3 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 2 ? "yes" : "no"); + printf("tcp:::send - %s\n", tcpsend >= 3 ? "yes" : "no"); + printf("tcp:::receive - %s\n", tcpreceive >= 2 ? "yes" : "no"); +} +EODTRACE + +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $? diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh.out new file mode 100644 index 00000000..2a85b98b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh.out @@ -0,0 +1,7 @@ +Minimum TCP events seen + +ip:::send - yes +ip:::receive - yes +tcp:::send - yes +tcp:::receive - yes + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh new file mode 100644 index 00000000..b0893c81 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh @@ -0,0 +1,88 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# + +# +# Test {udp,ip}:::{send,receive} of IPv4 UDP to a remote host. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. No physical network interface is plumbed and up. +# 3. No other hosts on this subnet are reachable and listening on rpcbind. +# 4. An unlikely race causes the unlocked global send/receive +# variables to be corrupted. +# +# This test sends a UDP message using ping and checks that at least the +# following counts were traced: +# +# 1 x ip:::send (UDP sent to ping's base UDP port) +# 1 x udp:::send (UDP sent to ping's base UDP port) +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +getaddr=./get.ipv4remote.pl + +if [[ ! -x $getaddr ]]; then + print -u2 "could not find or execute sub program: $getaddr" + exit 3 +fi +$getaddr | read source dest +if (( $? != 0 )); then + exit 4 +fi + +$dtrace -c "/usr/sbin/ping -U $dest" -qs /dev/stdin <ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->ipv4_protocol == IPPROTO_UDP/ +{ + ipsend++; +} + +udp:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest"/ +{ + udpsend++; +} + +END +{ + printf("Minimum UDP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no"); + printf("udp:::send - %s\n", udpsend >= 1 ? "yes" : "no"); +} +EOF diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh.out new file mode 100644 index 00000000..bdbbe1fd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh.out @@ -0,0 +1,5 @@ +Minimum UDP events seen + +ip:::send - yes +udp:::send - yes + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh new file mode 100755 index 00000000..5912ee7c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh @@ -0,0 +1,82 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#pragma ident "%Z%%M% %I% %E% SMI" + +# +# Test ip:::{send,receive} of IPv6 ICMP to a local address. This creates a +# temporary lo0/inet6 interface if one doesn't already exist. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. Unrelated ICMPv6 on lo0 traced by accident. +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +local=::1 + +if ! ifconfig lo0 inet6 > /dev/null 2>&1; then + if ! ifconfig lo0 inet6 plumb up; then + print -u2 "could not plumb lo0 inet6 for testing" + exit 3 + fi + removeinet6=1 +else + removeinet6=0 +fi + +$dtrace -c "/usr/sbin/ping -A inet6 $local 3" -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/ +{ + printf("1 ip:::send ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[5]: %d %d %d)\n", + args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen); +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/ +{ + printf("2 ip:::receive ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[5]: %d %d %d)\n", + args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen); +} +EOF + +if (( removeinet6 )); then + ifconfig lo0 inet6 unplumb +fi diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out new file mode 100644 index 00000000..529d251f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out @@ -0,0 +1,6 @@ + +::1 is alive +1 ip:::send (args[2]: 6 64, args[5]: 6 0 64) +1 ip:::send (args[2]: 6 64, args[5]: 6 0 64) +2 ip:::receive (args[2]: 6 64, args[5]: 6 0 64) +2 ip:::receive (args[2]: 6 64, args[5]: 6 0 64) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh new file mode 100755 index 00000000..b94b7843 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh @@ -0,0 +1,88 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#pragma ident "%Z%%M% %I% %E% SMI" + +# +# Test ip:::{send,receive} of IPv6 ICMP to a remote host. This test is +# skipped if there are no physical interfaces configured with IPv6, or no +# other IPv6 hosts are reachable. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. An unrelated ICMPv6 between these hosts was traced by accident. +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +getaddr=./get.ipv6remote.pl + +if [[ ! -x $getaddr ]]; then + print -u2 "could not find or execute sub program: $getaddr" + exit 3 +fi +$getaddr | read source dest +if (( $? != 0 )); then + print -nu2 "Could not find a local IPv6 interface and a remote IPv6 " + print -u2 "host. Aborting test.\n" + print -nu2 "For this test to continue, a \"ping -ns -A inet6 FF02::1\" " + print -u2 "must respond with a\nremote IPv6 host." + exit 3 +fi + +# +# Shake loose any ICMPv6 Neighbor advertisement messages before tracing. +# +/usr/sbin/ping $dest 3 > /dev/null 2>&1 + +$dtrace -c "/usr/sbin/ping $dest 3" -qs /dev/stdin <ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/ +{ + printf("1 ip:::send ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[5]: %d %d %d)\n", + args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen); +} + +ip:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/ +{ + printf("2 ip:::receive ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[5]: %d %d %d)\n", + args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen); +} +EOF diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh.out new file mode 100644 index 00000000..1ddcd07b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh.out @@ -0,0 +1,3 @@ + +1 ip:::send (args[2]: 6 64, args[5]: 6 0 64) +2 ip:::receive (args[2]: 6 64, args[5]: 6 0 64) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh new file mode 100644 index 00000000..8a65ce6f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh @@ -0,0 +1,182 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# + +# +# Test tcp:::state-change and tcp:::{send,receive} by connecting to +# the local ssh service and sending a test message. This should result +# in a "Protocol mismatch" response and a close of the connection. +# A number of state transition events along with tcp fusion send and +# receive events for the message should result. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. The lo0 interface missing or not up. +# 3. The local ssh service is not online. +# 4. An unlikely race causes the unlocked global send/receive +# variables to be corrupted. +# +# This test performs a TCP connection to the ssh service (port 22) and +# checks that at least the following packet counts were traced: +# +# 3 x ip:::send (2 during the TCP handshake, then a FIN) +# 4 x tcp:::send (2 during the TCP handshake, 1 message then a FIN) +# 2 x ip:::receive (1 during the TCP handshake, then the FIN ACK) +# 3 x tcp:::receive (1 during the TCP handshake, 1 message then the FIN ACK) +# +# The actual ip count tested is 5 each way, since we are tracing both +# source and destination events. The actual tcp count tested is 7 +# each way, since the TCP fusion send/receive events will not reach IP. +# +# For this test to work, we are assuming that the TCP handshake and +# TCP close will enter the IP code path and not use tcp fusion. +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +local=127.0.0.1 +tcpport=22 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.pl <<-EOPERL + use IO::Socket; + my \$s = IO::Socket::INET->new( + Proto => "tcp", + PeerAddr => "$local", + PeerPort => $tcpport, + Timeout => 3); + die "Could not connect to host $local port $tcpport" unless \$s; + print \$s "testing state machine transitions"; + close \$s; +EOPERL + +$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipsend++; +} + +tcp:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + (args[4]->tcp_sport == $tcpport || args[4]->tcp_dport == $tcpport)/ +{ + tcpsend++; +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipreceive++; +} + +tcp:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + (args[4]->tcp_sport == $tcpport || args[4]->tcp_dport == $tcpport)/ +{ + tcpreceive++; +} + +tcp:::state-change +{ + state_event[args[3]->tcps_state]++; +} + +tcp:::connect-request +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->tcp_dport == $tcpport/ +{ + connreq++; +} + +tcp:::connect-established +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->tcp_sport == $tcpport/ +{ + connest++; +} + +tcp:::accept-established +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->tcp_dport == $tcpport/ +{ + connaccept++; +} + +END +{ + printf("Minimum TCP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 5 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 5 ? "yes" : "no"); + printf("tcp:::send - %s\n", tcpsend >= 7 ? "yes" : "no"); + printf("tcp:::receive - %s\n", tcpreceive >= 7 ? "yes" : "no"); + printf("tcp:::state-change to syn-sent - %s\n", + state_event[TCP_STATE_SYN_SENT] >=1 ? "yes" : "no"); + printf("tcp:::state-change to syn-received - %s\n", + state_event[TCP_STATE_SYN_RECEIVED] >=1 ? "yes" : "no"); + printf("tcp:::state-change to established - %s\n", + state_event[TCP_STATE_ESTABLISHED] >= 2 ? "yes" : "no"); + printf("tcp:::state-change to fin-wait-1 - %s\n", + state_event[TCP_STATE_FIN_WAIT_1] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to close-wait - %s\n", + state_event[TCP_STATE_CLOSE_WAIT] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to fin-wait-2 - %s\n", + state_event[TCP_STATE_FIN_WAIT_2] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to last-ack - %s\n", + state_event[TCP_STATE_LAST_ACK] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to time-wait - %s\n", + state_event[TCP_STATE_TIME_WAIT] >= 1 ? "yes" : "no"); + printf("tcp:::connect-request - %s\n", + connreq >=1 ? "yes" : "no"); + printf("tcp:::connect-established - %s\n", + connest >=1 ? "yes" : "no"); + printf("tcp:::accept-established - %s\n", + connaccept >=1 ? "yes" : "no"); +} +EODTRACE + +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh.out new file mode 100644 index 00000000..ea1c27e5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh.out @@ -0,0 +1,18 @@ +Minimum TCP events seen + +ip:::send - yes +ip:::receive - yes +tcp:::send - yes +tcp:::receive - yes +tcp:::state-change to syn-sent - yes +tcp:::state-change to syn-received - yes +tcp:::state-change to established - yes +tcp:::state-change to fin-wait-1 - yes +tcp:::state-change to close-wait - yes +tcp:::state-change to fin-wait-2 - yes +tcp:::state-change to last-ack - yes +tcp:::state-change to time-wait - yes +tcp:::connect-request - yes +tcp:::connect-established - yes +tcp:::accept-established - yes + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh new file mode 100644 index 00000000..b6b9545d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh @@ -0,0 +1,172 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# + +# +# Test tcp:::state-change and tcp:::{send,receive} by connecting to +# the remote ssh service and sending a test message. This should result +# in a "Protocol mismatch" response and a close of the connection. +# A number of state transition events along with tcp send and receive +# events for the message should result. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. The lo0 interface missing or not up. +# 3. The remote ssh service is not online. +# 4. An unlikely race causes the unlocked global send/receive +# variables to be corrupted. +# +# This test performs a TCP connection to the ssh service (port 22) and +# checks that at least the following packet counts were traced: +# +# 4 x ip:::send (2 during the TCP handshake, the message, then a FIN) +# 4 x tcp:::send (2 during the TCP handshake, the messages, then a FIN) +# 3 x ip:::receive (1 during the TCP handshake, the response, then the FIN ACK) +# 3 x tcp:::receive (1 during the TCP handshake, the response, then the FIN ACK) +# +# For this test to work, we are assuming that the TCP handshake and +# TCP close will enter the IP code path and not use tcp fusion. +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +getaddr=./get.ipv4remote.pl +tcpport=22 +DIR=/var/tmp/dtest.$$ + +if [[ ! -x $getaddr ]]; then + print -u2 "could not find or execute sub program: $getaddr" + exit 3 +fi +$getaddr $tcpport | read source dest +if (( $? != 0 )); then + exit 4 +fi + +mkdir $DIR +cd $DIR + +cat > test.pl <<-EOPERL + use IO::Socket; + my \$s = IO::Socket::INET->new( + Proto => "tcp", + PeerAddr => "$dest", + PeerPort => $tcpport, + Timeout => 3); + die "Could not connect to host $dest port $tcpport" unless \$s; + print \$s "testing state machine transitions"; + close \$s; +EOPERL + +$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipsend++; +} + +tcp:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->tcp_dport == $tcpport/ +{ + tcpsend++; +} + +ip:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipreceive++; +} + +tcp:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[4]->tcp_sport == $tcpport/ +{ + tcpreceive++; +} + +tcp:::state-change +{ + state_event[args[3]->tcps_state]++; +} + +tcp:::connect-request +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->tcp_dport == $tcpport/ +{ + connreq++; +} + +tcp:::connect-established +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[4]->tcp_sport == $tcpport/ +{ + connest++; +} + +END +{ + printf("Minimum TCP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 4 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 3 ? "yes" : "no"); + printf("tcp:::send - %s\n", tcpsend >= 4 ? "yes" : "no"); + printf("tcp:::receive - %s\n", tcpreceive >= 3 ? "yes" : "no"); + printf("tcp:::state-change to syn-sent - %s\n", + state_event[TCP_STATE_SYN_SENT] >=1 ? "yes" : "no"); + printf("tcp:::state-change to established - %s\n", + state_event[TCP_STATE_ESTABLISHED] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to fin-wait-1 - %s\n", + state_event[TCP_STATE_FIN_WAIT_1] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to fin-wait-2 - %s\n", + state_event[TCP_STATE_FIN_WAIT_2] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to time-wait - %s\n", + state_event[TCP_STATE_TIME_WAIT] >= 1 ? "yes" : "no"); + printf("tcp:::connect-request - %s\n", + connreq >=1 ? "yes" : "no"); + printf("tcp:::connect-established - %s\n", + connest >=1 ? "yes" : "no"); +} +EODTRACE + +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh.out new file mode 100644 index 00000000..27388fba --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh.out @@ -0,0 +1,15 @@ +Minimum TCP events seen + +ip:::send - yes +ip:::receive - yes +tcp:::send - yes +tcp:::receive - yes +tcp:::state-change to syn-sent - yes +tcp:::state-change to established - yes +tcp:::state-change to fin-wait-1 - yes +tcp:::state-change to close-wait - yes +tcp:::state-change to fin-wait-2 - yes +tcp:::state-change to time-wait - yes +tcp:::connect-request - yes +tcp:::connect-established - yes + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/Makefile b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/Makefile new file mode 100644 index 00000000..fe213dd2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/Makefile @@ -0,0 +1,79 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +include $(SRC)/Makefile.master + +ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt +JAR_DSTDIR = $(ROOTOPTPKG)/tst/common/java_api +JAR_SRCDIR = $(SRC)/cmd/dtrace/test/tst/common/java_api + +# Use the proto dtrace.jar if it exists, otherwise use whatever is +# installed on the system. It should be possible to build +# usr/src/cmd/dtrace/test independently, even if only on systems that +# have a compatible dtrace.jar installed. +DTRACE_JAR=usr/share/lib/java/dtrace.jar +PROTO_DTRACE_JAR=$(ROOT)/$(DTRACE_JAR) +INSTALLED_DTRACE_JAR=/$(DTRACE_JAR) +CLASSPATH=$(PROTO_DTRACE_JAR):$(INSTALLED_DTRACE_JAR) +SRCDIR=src +CLASSDIR=classes +MANIFESTDIR=manifest +MANIFEST=$(MANIFESTDIR)/test.jar-manifest +TEST_JAR=$(JAR_SRCDIR)/test.jar +PROTO_TEST_JAR=$(JAR_DSTDIR)/test.jar + +default: $(TEST_JAR) + +clean: + $(RM) $(CLASSDIR)/*.class + +clobber: clean + $(RM) $(TEST_JAR) + +all: default + +lint: + +install: all $(PROTO_TEST_JAR) + +JFLAGS= -g -cp $(CLASSPATH) -d $(CLASSDIR) -deprecation +JFLAGS += -target 1.5 +JFLAGS += -Xlint +COMPILE.java=$(JAVAC) $(JFLAGS) + +$(TEST_JAR): $(SRCDIR)/*.java + @mkdir -p $(CLASSDIR) + $(COMPILE.java) $(SRCDIR)/*.java + $(JAR) -cmf $(MANIFEST) $(TEST_JAR) -C $(CLASSDIR) . + +$(PROTO_TEST_JAR): $(JAR_DSTDIR) + +$(JAR_DSTDIR): + $(INS.dir) + +$(JAR_DSTDIR)/%: $(JAR_SRCDIR)/% + $(INS.file) diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/manifest/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/manifest/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/manifest/test.jar-manifest b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/manifest/test.jar-manifest new file mode 100644 index 00000000..7e454ad8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestAbort.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestAbort.java new file mode 100644 index 00000000..310dd184 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestBean.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestBean.java new file mode 100644 index 00000000..dd4a969d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestClose.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestClose.java new file mode 100644 index 00000000..c7a9e89d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestDrop.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestDrop.java new file mode 100644 index 00000000..b5ace25b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestEnable.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestEnable.java new file mode 100644 index 00000000..0e5a6086 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java new file mode 100644 index 00000000..2bc43ea6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java @@ -0,0 +1,114 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +import org.opensolaris.os.dtrace.*; + +/** + * Regression for bug 6413280 lookupKernelFunction() and + * lookupUserFunction() truncate last character. + */ +public class TestFunctionLookup { + static final String kernelLookupProgram = "sdt:::callout-start { " + + "@[((callout_t *)arg0)->c_func] = count(); }"; + static final String userLookupProgram = "pid$target::f2:entry { " + + "@[arg0] = count(); }"; + + public static void + main(String[] args) + { + if (args.length != 1) { + System.err.println("usage: java TestFunctionLookup "); + System.exit(1); + } + String cmd = args[0]; + + Consumer consumer = new LocalConsumer(); + try { + consumer.open(); + consumer.compile(kernelLookupProgram); + consumer.enable(); + consumer.go(); + Aggregate a; + Number address; + String f; + boolean done = false; + for (int i = 0; (i < 20) && !done; ++i) { + Thread.currentThread().sleep(100); + a = consumer.getAggregate(); + for (Aggregation agg : a.getAggregations()) { + for (Tuple tuple : agg.asMap().keySet()) { + address = (Number)tuple.get(0).getValue(); + if (address instanceof Integer) { + int addr = (Integer)address; + f = consumer.lookupKernelFunction(addr); + } else { + long addr = (Long)address; + f = consumer.lookupKernelFunction(addr); + } + if (f.equals("genunix`cv_wakeup")) { + System.out.println(f); + done = true; + } + } + } + } + consumer.close(); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + + consumer = new LocalConsumer(); + try { + consumer.open(); + int pid = consumer.createProcess(cmd); + consumer.compile(userLookupProgram); + consumer.enable(); + consumer.go(); + Thread.currentThread().sleep(500); + Aggregate a = consumer.getAggregate(); + Number address; + String f; + for (Aggregation agg : a.getAggregations()) { + for (Tuple tuple : agg.asMap().keySet()) { + address = (Number)tuple.get(0).getValue(); + if (address instanceof Integer) { + int addr = (Integer)address; + f = consumer.lookupUserFunction(pid, addr); + } else { + long addr = (Long)address; + f = consumer.lookupUserFunction(pid, addr); + } + System.out.println(f); + } + } + consumer.close(); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java new file mode 100644 index 00000000..e02df858 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java @@ -0,0 +1,252 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +import org.opensolaris.os.dtrace.*; +import java.util.*; + +/** + * Assert getAggregate() can explicitly specify the anonymous aggregation. + */ +public class TestGetAggregate { + static final String programString = + "profile:::tick-50ms" + + "{" + + " @ = count();" + + " @a = count();" + + "}"; + + static final String ANONYMOUS_AGGREGATION = ""; + static final int TICK = 50; + static final int EXPECTED_TICKS = 3; + static final int INTERVALS = 4; + + static void + testIncluded(Consumer consumer, String ... aggregationNames) + throws DTraceException, InterruptedException + { + Aggregate aggregate; + Set included = new HashSet (); + int n = 1; + + for (String name : aggregationNames) { + included.add(name); + } + + // Wait up to a full second to obtain aggregate data. Without a + // time limit, we'll loop forever if no aggregation was + // successfully included. + do { + Thread.sleep(TICK); + aggregate = consumer.getAggregate(included, null); + } while (aggregate.asMap().isEmpty() && n++ < (1000 / TICK)); + + for (String name : included) { + if (aggregate.getAggregation(name) == null) { + throw new IllegalStateException("@" + name + + " was explicitly included but did not appear " + + "in the aggregate"); + } + } + for (Aggregation a : aggregate.getAggregations()) { + if (!included.contains(a.getName())) { + throw new IllegalStateException("@" + a.getName() + + " was not explicitly included but appeared " + + "in the aggregate anyway"); + } + } + + if (!consumer.isRunning()) { + throw new IllegalStateException("consumer exited"); + } + } + + static void + testCleared(Consumer consumer, String ... aggregationNames) + throws DTraceException, InterruptedException + { + Aggregate aggregate; + AggregationRecord rec; + long value; + Long firstValue; + int n = 1; + Map firstValues = new HashMap (); + Set cleared = new HashSet (); + + for (String name : aggregationNames) { + cleared.add(name); + } + + do { + Thread.sleep(TICK); + aggregate = consumer.getAggregate(null, cleared); + } while (aggregate.asMap().isEmpty() && n++ < (1000 / TICK)); + n = 1; + + do { + Thread.sleep(TICK * EXPECTED_TICKS); + aggregate = consumer.getAggregate(null, cleared); + + for (Aggregation a : aggregate.getAggregations()) { + if (!firstValues.containsKey(a.getName())) { + rec = a.getRecord(Tuple.EMPTY); + value = rec.getValue().getValue().longValue(); + firstValues.put(a.getName(), value); + } + } + } while (consumer.isRunning() && n++ < INTERVALS); + + for (Aggregation a : aggregate.getAggregations()) { + rec = a.getRecord(Tuple.EMPTY); + value = rec.getValue().getValue().longValue(); + firstValue = firstValues.get(a.getName()); + + if (cleared.contains(a.getName())) { + // last value should be about the same as first value + if (value > (firstValue * 2)) { + throw new IllegalStateException( + "@" + a.getName() + " should have " + + "been cleared but instead grew from " + + firstValue + " to " + value); + } + } else { + // last value should be about (INTERVALS * firstValue) + if (value < (firstValue * 2)) { + throw new IllegalStateException( + "@" + a.getName() + " should have " + + "accumulated a running total but " + + "instead went from " + + firstValue + " to " + value); + } + } + } + + if (!consumer.isRunning()) { + throw new IllegalStateException("consumer exited"); + } + } + + static Integer includedStatus; + static Integer clearedStatus; + + static void + startIncludedTest() + { + final Consumer consumer = new LocalConsumer(); + consumer.addConsumerListener(new ConsumerAdapter() { + public void consumerStarted(ConsumerEvent e) { + new Thread(new Runnable() { + public void run() { + try { + testIncluded(consumer, ANONYMOUS_AGGREGATION); + includedStatus = 0; + } catch (Exception e) { + includedStatus = 1; + e.printStackTrace(); + } finally { + consumer.abort(); + } + } + }).start(); + } + }); + + try { + consumer.open(); + consumer.setOption(Option.aggrate, Option.millis(TICK)); + consumer.compile(programString); + consumer.enable(); + consumer.go(); + } catch (Exception e) { + includedStatus = 1; + e.printStackTrace(); + } + } + + static void + startClearedTest() + { + final Consumer consumer = new LocalConsumer(); + consumer.addConsumerListener(new ConsumerAdapter() { + public void consumerStarted(ConsumerEvent e) { + new Thread(new Runnable() { + public void run() { + try { + testCleared(consumer, ANONYMOUS_AGGREGATION); + clearedStatus = 0; + } catch (Exception e) { + clearedStatus = 1; + e.printStackTrace(); + } finally { + consumer.abort(); + } + } + }).start(); + } + }); + + try { + consumer.open(); + consumer.setOption(Option.aggrate, Option.millis(TICK)); + consumer.compile(programString); + consumer.enable(); + consumer.go(); + } catch (Exception e) { + clearedStatus = 1; + e.printStackTrace(); + } + } + + public static void + main(String[] args) + { + startIncludedTest(); + + do { + try { + Thread.sleep(TICK); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } while (includedStatus == null); + + startClearedTest(); + + do { + try { + Thread.sleep(TICK); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } while (clearedStatus == null); + + if (includedStatus != 0 || clearedStatus != 0) { + System.out.println("Failure"); + System.exit(1); + } + + System.out.println("Success"); + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestMaxConsumers.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestMaxConsumers.java new file mode 100644 index 00000000..50eeac23 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestMultiAggPrinta.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestMultiAggPrinta.java new file mode 100644 index 00000000..facdf7fa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/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