diff options
Diffstat (limited to 'src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common')
1510 files changed, 81988 insertions, 0 deletions
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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/aggs/Makefile.kup 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 <sys/dtrace.h> + +#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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arithmetic/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/arrays/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/assocs/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/begin/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/bitfields/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/buffering/Makefile.kup 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 <<EOF + + #pragma D option quiet + #pragma D option statusrate=1hz + + uint64_t total; + int thresh; + + BEGIN + { + start = timestamp; + thresh = 10; + } + + sched:::on-cpu + /pid == \$pid/ + { + self->on = vtimestamp; + } + + sched:::off-cpu + /self->on/ + { + total += vtimestamp - self->on; + } + + tick-1sec + /i++ == 10/ + { + exit(0); + } + + END + /((total * 100) / (timestamp - start)) > thresh/ + { + printf("'%s' buffering policy took %d%% of CPU; ", + \$\$1, ((total * 100) / (timestamp - start))); + printf("expected no more than %d%%!\n", thresh); + exit(1); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +for policy in "fill ring switch"; do + script $policy + + status=$? + + if [ "$status" -ne 0 ]; then + exit $status + fi +done + +exit 0 diff --git a/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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/builtinvar/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/clauses/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/cpc/Makefile.kup 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 <<EOF + #pragma D option bufsize=128k + + cpc:::PAPI_tot_ins-all-10000 + { + @[probename] = count(); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +dtraceout=/tmp/dtrace.out.$$ +script 2>/dev/null & +timeout=15 + +# +# Sleep while the above script fires into life. To guard against dtrace dying +# and us sleeping forever we allow 15 secs for this to happen. This should be +# enough for even the slowest systems. +# +while [ ! -f $dtraceout ]; do + sleep 1 + timeout=$(($timeout-1)) + if [ $timeout -eq 0 ]; then + echo "dtrace failed to start. Exiting." + exit 1 + fi +done + +cpustat -c PAPI_tot_ins 1 5 +status=$? + +rm $dtraceout + +exit $status diff --git a/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 <<EOF + #pragma D option bufsize=128k + + BEGIN + { + exit(0); + } + + cpc:::PAPI_tot_ins-all-10000 + { + @[probename] = count(); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +dtraceout=/tmp/dtrace.out.$$ + +cpustat -c PAPI_tot_ins 1 20 & +pid=$! +sleep 5 +script 2>/dev/null + +status=$? + +kill $pid +exit $status diff --git a/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 <<EOF + #pragma D option bufsize=128k + + cpc:::PAPI_tot_ins-all-10000 + { + @[probename] = count(); + } +EOF +} + + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +dtraceout=/tmp/dtrace.out.$$ +script 2>/dev/null & +timeout=15 + +# +# Sleep while the above script fires into life. To guard against dtrace dying +# and us sleeping forever we allow 15 secs for this to happen. This should be +# enough for even the slowest systems. +# +while [ ! -f $dtraceout ]; do + sleep 1 + timeout=$(($timeout-1)) + if [ $timeout -eq 0 ]; then + echo "dtrace failed to start. Exiting." + exit 1 + fi +done + +cputrack -c PAPI_tot_ins sleep 10 +status=$? + +rm $dtraceout + +exit $status diff --git a/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 <<EOF + #pragma D option bufsize=128k + + cpc:::PAPI_tot_ins-all-10000 + { + @[probename] = count(); + } + + tick-1s + /n++ > 10/ + { + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +cputrack -c PAPI_tot_ins sleep 20 & +cputrack_pid=$! +sleep 5 +script 2>/dev/null & + +wait $cputrack_pid +status=$? + +rm $dtraceout + +exit $status diff --git a/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 <<EOF + #pragma D option bufsize=128k + #pragma D option quiet + + cpc:::PAPI_tot_ins-user-10000 + /cpus[cpu] != 1/ + { + cpus[cpu] = 1; + @a[cpu] = count(); + } + + tick-1s + /n++ > 10/ + { + printa(@a); + exit(0); + } +EOF +} + +echo "" > $scriptout +while [ $cpu -le $numproc ] +do + if [ "`psrinfo -s $cpu 2> /dev/null`" -eq 1 ]; then + printf "%9d %16d\n" $cpu 1 >> $scriptout + spin & + allpids[$cpu]=$! + pbind -b $cpu $! + fi + cpu=$(($cpu+1)) +done +echo "" >> $scriptout + +script + +diff $dtraceout $scriptout >/dev/null 2>&1 +status=$? + +# kill off the spinner processes +cpu=0 +while [ $cpu -le $numproc ] +do + if [ "`psrinfo -s $cpu 2> /dev/null`" -eq 1 ]; then + kill ${allpids[$cpu]} + fi + cpu=$(($cpu+1)) +done + +rm $dtraceout +rm $scriptout + +exit $status diff --git a/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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 + +get_event() +{ + perl /dev/stdin /dev/stdout << EOF + open CPUSTAT, '/usr/sbin/cpustat -h |' + or die "Couldn't run cpustat: \$!\n"; + while (<CPUSTAT>) { + if (/(\s+)event\[*[0-9]-*[0-9]*\]*:/ && !/PAPI/) { + @a = split(/ /, \$_); + \$event = \$a[\$#a-1]; + } + } + + close CPUSTAT; + print "\$event\n"; +EOF +} + +script() +{ + $dtrace -s /dev/stdin << EOD + #pragma D option quiet + #pragma D option bufsize=128k + + cpc:::$1-all-10000 + { + @[probename] = count(); + } + + tick-1s + /n++ > 5/ + { + exit(0); + } +EOD +} + +event=$(get_event) +script $event + +status=$? + +exit $status diff --git a/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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/decls/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/docsExamples/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/drops/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/Makefile.kup 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 <filename> and define the variable VALUE in it. Move it a + * directory <dirname> different from the current directory. Change the value + * of <filename> appropriately in the code below. + * Invoke: dtrace -C -I <dirname> -s man.AddSearchPath.d + * Verify VALUE. + */ + + +#pragma D option quiet + +#include "filename" + +BEGIN +{ + printf("Value of VALUE: %d\n", VALUE); + exit(0); +} diff --git a/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 <<EOF + #pragma D option quiet +#include "test.h" + + BEGIN + /1520 != VALUE/ + { + printf("VALUE: %d, Test should fail\n", VALUE); + exit(1); + } + + BEGIN + /1520 == VALUE/ + { + printf("VALUE: %d, Test should pass\n", VALUE); + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +tempfile=/tmp/test.h +echo "#define VALUE 1520" > $tempfile + +dtrace=$1 +script +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed + exit $status +fi + +/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 <<EOF + BEGIN + /4 != sizeof(long)/ + { + printf("Not targeted for 32 bit machine\n"); + exit(1); + } + + BEGIN + /4 == sizeof(long)/ + { + printf("Targeted for 32 bit machine\n"); + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed +fi + +exit $status diff --git a/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 <<EOF + BEGIN + /8 != sizeof(long)/ + { + printf("Not targeted for 64 bit machine\n"); + exit(1); + } + + BEGIN + /8 == sizeof(long)/ + { + printf("Targeted for 64 bit machine\n"); + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed +fi + +exit $status diff --git a/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 <<EOF + #pragma D option quiet + + BEGIN + { + printf("Value of VALUE: %d\n", VALUE); + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed +fi + +exit $status diff --git a/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 <<EOF + BEGIN + { + printf("This test should compile.\n"); + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +script +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed + exit $status +fi + +if [ ! -a "d.out" ]; then + echo $tst: file not generated + exit 1 +fi + +/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 <<EOF + BEGIN + { + printf("This test should compile.\n"); + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed + exit $status +fi + +if [ ! -a "outputFile" ]; then + echo $tst: file not generated + exit 1 +fi + +/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 <<EOF + +#include <stdio.h> + + 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 <<EOF + + BEGIN + { + printf("I am the only one."); + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +script +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed +fi + +exit $status diff --git a/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 <<EOF + #pragma D option quiet + BEGIN + { + i = 100; + printf("Value of i: %d\n", i); + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed +fi + +exit $status diff --git a/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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/dtraceUtil/tst.TestCompile.d.ksh.out 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 <<EOF + #pragma D option quiet + + BEGIN + { + printf("Value of VALUE: %d\n", VALUE); + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script +status=$? + +if [ "$status" -ne 0 ]; then + exit 0 +fi + +echo $tst: dtrace failed +exit $status diff --git a/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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/end/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/enum/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/error/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/exit/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/fbtprovider/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/Makefile.kup 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 <<EOF + + /* + * ASSERTION: + * Verify that chill() refuses args greater than + * 500 milliseconds. + * + * SECTION: Actions and Subroutines/chill() + * + */ + + BEGIN + { + chill(500000001); + exit(1); + } + + ERROR + { + exit(1) + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +dtrace_script & +child=$! + +wait $child +status=$? + +exit $status diff --git a/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 <<EOF + + /* + * ASSERTION: + * Verify that copyout() handles bad addresses. + * + * SECTION: Actions and Subroutines/copyout() + * + */ + + BEGIN + { + ptr = alloca(sizeof (char *)); + copyinto(curpsinfo->pr_envp, sizeof (char *), ptr); + copyout(ptr, 0, sizeof (char *)); + } + + ERROR + { + exit(1) + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +dtrace_script & +child=$! + +wait $child +status=$? + +exit $status diff --git a/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 <<EOF + + /* + * ASSERTION: + * Verify that copyout() handles bad addresses. + * + * SECTION: Actions and Subroutines/copyout() + * + */ + + BEGIN + { + ptr = alloca(sizeof (char *)); + copyinto(curpsinfo->pr_envp, sizeof (char *), ptr); + copyout(ptr, 0, sizeof (char *)); + } + + ERROR + { + exit(1) + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +dtrace_script & +child=$! + +wait $child +status=$? + +exit $status diff --git a/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 <<EOF + BEGIN + { + /* + * All of these should fail... + */ + freopen(".."); + freopen("%s", "."); + freopen("%c%c", '.', '.'); + freopen("%c", '.'); + + /* + * ...so stdout should still be open here. + */ + printf("%d", ++i); + + freopen("%s%s", ".", "."); + freopen("%s%s", ".", "."); + + printf("%d", ++i); + } + + BEGIN + /i == 2/ + { + /* + * ...and here. + */ + printf("%d\n", ++i); + exit(0); + } + + BEGIN + { + exit(1); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +tmpfile=/tmp/tst.badfreopen.$$ +errfile=/tmp/tst.badfreopen.$$.stderr + +script +status=$? + +if [ "$status" -eq 0 ]; then + i=`cat $tmpfile` + + if [[ $i != "123" ]]; then + echo "$0: unexpected contents in $tmpfile: " \ + "expected 123, found $i" + status=100 + fi + + i=`wc -l $errfile | nawk '{ print $1 }'` + + if [ "$i" -lt 6 ]; then + echo "$0: expected at least 6 lines of stderr, found $i lines" + status=101 + fi +else + cat $errfile > /dev/fd/2 +fi + +rm $tmpfile $errfile + +exit $status diff --git a/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 <<EOF + + /* + * ASSERTION: + * Positive test of chill() + * + * SECTION: Actions and Subroutines/chill() + * + * NOTES: This test does no verification - it's not possible. So, + * we just run this and make sure it runs. + */ + + BEGIN + { + i = 0; + } + + syscall:::entry + /i <= 5/ + { + chill(100000000); + i++; + } + + syscall:::entry + /i > 5/ + { + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +dtrace_script & +child=$! + +wait $child +status=$? + +exit $status diff --git a/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 <<EOF + BEGIN + { + i = 0; + } + + tick-10ms + { + freopen("%s.%d", \$\$1, i); + printf("%d\n", i) + } + + tick-10ms + /++i == $iter/ + { + freopen(""); + printf("%d\n", i); + exit(0); + } +EOF +} + +cleanup() +{ + let i=0 + + if [ -f $tmpfile ]; then + rm $tmpfile + fi + + while [ "$i" -lt "$iter" ]; do + if [ -f $tmpfile.$i ]; then + rm $tmpfile.$i + fi + let i=i+1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +tmpfile=/tmp/tst.freopen.$$ +iter=20 + +script +status=$? + +let i=0 + +if [ -f $tmpfile.$iter ]; then + echo "$0: did not expect to find file: $tmpfile.$iter" + cleanup + exit 100 +fi + +mv $tmpfile $tmpfile.$iter +let iter=iter+1 + +while [ "$i" -lt "$iter" ]; do + if [ ! -f $tmpfile.$i ]; then + echo "$0: did not find expected file: $tmpfile.$i" + cleanup + exit 101 + fi + + j=`cat $tmpfile.$i` + + if [ "$i" -ne "$j" ]; then + echo "$0: unexpected contents in $tmpfile.$i: " \ + "expected $i, found $j" + cleanup + exit 102 + fi + + rm $tmpfile.$i + let i=i+1 +done + +exit $status diff --git a/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 <<EOF + tick-10ms + { + printf("%d\n", i++); + } + + tick-10ms + /i == 10/ + { + ftruncate(); + } + + tick-10ms + /i == 20/ + { + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +tmpfile=/tmp/tst.ftruncate.$$ + +script +status=$? + +cat $tmpfile +rm $tmpfile + +exit $status diff --git a/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 <sys/isa_defs.h> + +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 : "<null>", + command[i].result != NULL ? command[i].result : "<null>"); + 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/grammar/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/inline/Makefile.kup 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<psinfo_t>(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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/io/Makefile.kup 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 <assert.h> +#include <setjmp.h> +#include <signal.h> +#include <unistd.h> +#include <stdlib.h> +#include <stdio.h> +#include <fcntl.h> + +static sigjmp_buf env; + +static void +interrupt(int sig) +{ + siglongjmp(env, sig); +} + +int +main(int argc, char *argv[]) +{ + const char *file = "/dev/null"; + int i, n, fds[10]; + struct sigaction act; + + if (argc > 1) { + (void) fprintf(stderr, "Usage: %s\n", argv[0]); + return (EXIT_FAILURE); + } + + act.sa_handler = interrupt; + act.sa_flags = 0; + + (void) sigemptyset(&act.sa_mask); + (void) sigaction(SIGUSR1, &act, NULL); + + closefrom(0); + n = 0; + + /* + * With all of our file descriptors closed, wait here spinning in bogus + * ioctl() calls until DTrace hits us with a SIGUSR1 to start the test. + */ + if (sigsetjmp(env, 1) == 0) { + for (;;) + (void) ioctl(-1, -1, NULL); + } + + /* + * To test the fds[] array, we open /dev/null (a file with reliable + * pathname and properties) using various flags and seek offsets. + */ + fds[n++] = open(file, O_RDONLY); + fds[n++] = open(file, O_WRONLY); + fds[n++] = open(file, O_RDWR); + + fds[n++] = open(file, O_RDWR | O_APPEND | O_CREAT | O_DSYNC | + O_LARGEFILE | O_NOCTTY | O_NONBLOCK | O_NDELAY | O_RSYNC | + O_SYNC | O_TRUNC | O_XATTR); + + 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ip/Makefile.kup 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 (<IFCONFIG>) { + next if /^lo/; + + # "UP" is always printed first (see print_flags() in ifconfig.c): + $up = 1 if /^[a-z].*<UP,/; + $up = 0 if /^[a-z].*<,/; + + # assume output is "inet X ... broadcast Z": + if (/inet (\S+) .* broadcast (\S+)/) { + my ($addr, $bcast) = ($1, $2); + $Broadcast{$addr} = $bcast; + $local = $addr if $up and $local eq ""; + $up = 0; + } +} +close IFCONFIG; +die "Could not determine local IP address" if $local eq ""; + +# +# Find the first remote host that responds to an icmp echo, +# which isn't a local address. +# +open PING, "/usr/sbin/ping -ns $Broadcast{$local} 56 $MAXHOSTS |" or + die "Couldn't run ping: $!\n"; +while (<PING>) { + if (/bytes from (.*): / and not defined $Broadcast{$1}) { + my $addr = $1; + + if ($tcpport != 0) { + # + # Test TCP + # + my $socket = IO::Socket::INET->new( + Proto => "tcp", + PeerAddr => $addr, + PeerPort => $tcpport, + Timeout => $TIMEOUT, + ); + next unless $socket; + close $socket; + } + + $remote = $addr; + last; + } +} +close PING; +die "Can't find a remote host for testing: No suitable response from " . + "$Broadcast{$local}\n" if $remote eq ""; + +print "$local $remote\n"; diff --git a/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 (<IFCONFIG>) { + next if /^lo/; + + # "UP" is always printed first (see print_flags() in ifconfig.c): + $up = 1 if /^[a-z].*<UP,/; + $up = 0 if /^[a-z].*<,/; + + # assume output is "inet6 ...": + if (m:inet6 (\S+)/:) { + my $addr = $1; + $Local{$addr} = 1; + $local = $addr if $up and $local eq ""; + $up = 0; + } +} +close IFCONFIG; +exit 1 if $local eq ""; + +# +# Find the first remote host that responds to an icmp echo, +# which isn't a local address. +# +open PING, "/usr/sbin/ping -ns -A inet6 $MULTICAST 56 $MAXHOSTS |" or + die "Couldn't run ping: $!\n"; +while (<PING>) { + 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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 +local=127.0.0.1 + +$dtrace -c "/usr/sbin/ping $local 3" -qs /dev/stdin <<EOF | sort -n +ip:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_ICMP/ +{ + printf("1 ip:::send ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[4]: %d %d %d %d %d)\n", + args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags, + args[4]->ipv4_offset, args[4]->ipv4_ttl); +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_ICMP/ +{ + printf("2 ip:::receive ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[4]: %d %d %d %d %d)\n", + args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags, + args[4]->ipv4_offset, args[4]->ipv4_ttl); +} +EOF diff --git a/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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 +local=127.0.0.1 +tcpport=22 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.pl <<-EOPERL + use IO::Socket; + my \$s = IO::Socket::INET->new( + Proto => "tcp", + PeerAddr => "$local", + PeerPort => $tcpport, + Timeout => 3); + die "Could not connect to host $local port $tcpport" unless \$s; + close \$s; +EOPERL + +$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE +BEGIN +{ + ipsend = tcpsend = ipreceive = tcpreceive = 0; +} + +ip:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipsend++; +} + +tcp:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/ +{ + tcpsend++; +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipreceive++; +} + +tcp:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/ +{ + tcpreceive++; +} + +END +{ + printf("Minimum TCP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 5 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 5 ? "yes" : "no"); + printf("tcp:::send - %s\n", tcpsend >= 5 ? "yes" : "no"); + printf("tcp:::receive - %s\n", tcpreceive >= 5 ? "yes" : "no"); +} +EODTRACE + +status=$? + +cd / +/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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 +local=127.0.0.1 + +$dtrace -c "/usr/sbin/ping -U $local" -qs /dev/stdin <<EOF | grep -v 'is alive' +BEGIN +{ + ipsend = udpsend = ipreceive = 0; +} + +ip:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_UDP/ +{ + ipsend++; +} + +udp:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/ +{ + udpsend++; +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_UDP/ +{ + ipreceive++; +} + +END +{ + printf("Minimum UDP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 1 ? "yes" : "no"); + printf("udp:::send - %s\n", udpsend >= 1 ? "yes" : "no"); +} +EOF diff --git a/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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 +getaddr=./get.ipv4remote.pl + +if [[ ! -x $getaddr ]]; then + print -u2 "could not find or execute sub program: $getaddr" + exit 3 +fi +$getaddr | read source dest +if (( $? != 0 )); then + exit 4 +fi + +$dtrace -c "/usr/sbin/ping $dest 3" -qs /dev/stdin <<EOF | \ + grep -v 'is alive' | sort -n +ip:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->ipv4_protocol == IPPROTO_ICMP/ +{ + printf("1 ip:::send ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[4]: %d %d %d %d %d)\n", + args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags, + args[4]->ipv4_offset, args[4]->ipv4_ttl); +} + +ip:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[4]->ipv4_protocol == IPPROTO_ICMP/ +{ + printf("2 ip:::receive ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[4]: %d %d %d %d %d)\n", + args[4]->ipv4_ver, args[4]->ipv4_length, args[4]->ipv4_flags, + args[4]->ipv4_offset, args[4]->ipv4_ttl); +} +EOF diff --git a/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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 +getaddr=./get.ipv4remote.pl +tcpport=22 +DIR=/var/tmp/dtest.$$ + +if [[ ! -x $getaddr ]]; then + print -u2 "could not find or execute sub program: $getaddr" + exit 3 +fi +$getaddr $tcpport | read source dest +if (( $? != 0 )); then + exit 4 +fi + +mkdir $DIR +cd $DIR + +cat > test.pl <<-EOPERL + use IO::Socket; + my \$s = IO::Socket::INET->new( + Proto => "tcp", + PeerAddr => "$dest", + PeerPort => $tcpport, + Timeout => 3); + die "Could not connect to host $dest port $tcpport" unless \$s; + close \$s; +EOPERL + +$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE +BEGIN +{ + ipsend = tcpsend = ipreceive = tcpreceive = 0; +} + +ip:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipsend++; +} + +tcp:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest"/ +{ + tcpsend++; +} + +ip:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipreceive++; +} + +tcp:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source"/ +{ + tcpreceive++; +} + +END +{ + printf("Minimum TCP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 3 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 2 ? "yes" : "no"); + printf("tcp:::send - %s\n", tcpsend >= 3 ? "yes" : "no"); + printf("tcp:::receive - %s\n", tcpreceive >= 2 ? "yes" : "no"); +} +EODTRACE + +status=$? + +cd / +/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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 +getaddr=./get.ipv4remote.pl + +if [[ ! -x $getaddr ]]; then + print -u2 "could not find or execute sub program: $getaddr" + exit 3 +fi +$getaddr | read source dest +if (( $? != 0 )); then + exit 4 +fi + +$dtrace -c "/usr/sbin/ping -U $dest" -qs /dev/stdin <<EOF | grep -v 'is alive' +BEGIN +{ + ipsend = udpsend = 0; +} + +ip:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->ipv4_protocol == IPPROTO_UDP/ +{ + ipsend++; +} + +udp:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest"/ +{ + udpsend++; +} + +END +{ + printf("Minimum UDP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no"); + printf("udp:::send - %s\n", udpsend >= 1 ? "yes" : "no"); +} +EOF diff --git a/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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 +local=::1 + +if ! ifconfig lo0 inet6 > /dev/null 2>&1; then + if ! ifconfig lo0 inet6 plumb up; then + print -u2 "could not plumb lo0 inet6 for testing" + exit 3 + fi + removeinet6=1 +else + removeinet6=0 +fi + +$dtrace -c "/usr/sbin/ping -A inet6 $local 3" -qs /dev/stdin <<EOF | sort -n +ip:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/ +{ + printf("1 ip:::send ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[5]: %d %d %d)\n", + args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen); +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/ +{ + printf("2 ip:::receive ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[5]: %d %d %d)\n", + args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen); +} +EOF + +if (( removeinet6 )); then + ifconfig lo0 inet6 unplumb +fi diff --git a/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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 +getaddr=./get.ipv6remote.pl + +if [[ ! -x $getaddr ]]; then + print -u2 "could not find or execute sub program: $getaddr" + exit 3 +fi +$getaddr | read source dest +if (( $? != 0 )); then + print -nu2 "Could not find a local IPv6 interface and a remote IPv6 " + print -u2 "host. Aborting test.\n" + print -nu2 "For this test to continue, a \"ping -ns -A inet6 FF02::1\" " + print -u2 "must respond with a\nremote IPv6 host." + exit 3 +fi + +# +# Shake loose any ICMPv6 Neighbor advertisement messages before tracing. +# +/usr/sbin/ping $dest 3 > /dev/null 2>&1 + +$dtrace -c "/usr/sbin/ping $dest 3" -qs /dev/stdin <<EOF | \ + grep -v 'is alive' | sort -n +ip:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/ +{ + printf("1 ip:::send ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[5]: %d %d %d)\n", + args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen); +} + +ip:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/ +{ + printf("2 ip:::receive ("); + printf("args[2]: %d %d, ", args[2]->ip_ver, args[2]->ip_plength); + printf("args[5]: %d %d %d)\n", + args[5]->ipv6_ver, args[5]->ipv6_tclass, args[5]->ipv6_plen); +} +EOF diff --git a/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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 +local=127.0.0.1 +tcpport=22 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.pl <<-EOPERL + use IO::Socket; + my \$s = IO::Socket::INET->new( + Proto => "tcp", + PeerAddr => "$local", + PeerPort => $tcpport, + Timeout => 3); + die "Could not connect to host $local port $tcpport" unless \$s; + print \$s "testing state machine transitions"; + close \$s; +EOPERL + +$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE +BEGIN +{ + ipsend = tcpsend = ipreceive = tcpreceive = 0; + connreq = connest = connaccept = 0; +} + +ip:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipsend++; +} + +tcp:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + (args[4]->tcp_sport == $tcpport || args[4]->tcp_dport == $tcpport)/ +{ + tcpsend++; +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipreceive++; +} + +tcp:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + (args[4]->tcp_sport == $tcpport || args[4]->tcp_dport == $tcpport)/ +{ + tcpreceive++; +} + +tcp:::state-change +{ + state_event[args[3]->tcps_state]++; +} + +tcp:::connect-request +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->tcp_dport == $tcpport/ +{ + connreq++; +} + +tcp:::connect-established +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->tcp_sport == $tcpport/ +{ + connest++; +} + +tcp:::accept-established +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->tcp_dport == $tcpport/ +{ + connaccept++; +} + +END +{ + printf("Minimum TCP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 5 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 5 ? "yes" : "no"); + printf("tcp:::send - %s\n", tcpsend >= 7 ? "yes" : "no"); + printf("tcp:::receive - %s\n", tcpreceive >= 7 ? "yes" : "no"); + printf("tcp:::state-change to syn-sent - %s\n", + state_event[TCP_STATE_SYN_SENT] >=1 ? "yes" : "no"); + printf("tcp:::state-change to syn-received - %s\n", + state_event[TCP_STATE_SYN_RECEIVED] >=1 ? "yes" : "no"); + printf("tcp:::state-change to established - %s\n", + state_event[TCP_STATE_ESTABLISHED] >= 2 ? "yes" : "no"); + printf("tcp:::state-change to fin-wait-1 - %s\n", + state_event[TCP_STATE_FIN_WAIT_1] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to close-wait - %s\n", + state_event[TCP_STATE_CLOSE_WAIT] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to fin-wait-2 - %s\n", + state_event[TCP_STATE_FIN_WAIT_2] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to last-ack - %s\n", + state_event[TCP_STATE_LAST_ACK] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to time-wait - %s\n", + state_event[TCP_STATE_TIME_WAIT] >= 1 ? "yes" : "no"); + printf("tcp:::connect-request - %s\n", + connreq >=1 ? "yes" : "no"); + printf("tcp:::connect-established - %s\n", + connest >=1 ? "yes" : "no"); + printf("tcp:::accept-established - %s\n", + connaccept >=1 ? "yes" : "no"); +} +EODTRACE + +status=$? + +cd / +/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: <dtrace-path>" + exit 2 +fi + +dtrace=$1 +getaddr=./get.ipv4remote.pl +tcpport=22 +DIR=/var/tmp/dtest.$$ + +if [[ ! -x $getaddr ]]; then + print -u2 "could not find or execute sub program: $getaddr" + exit 3 +fi +$getaddr $tcpport | read source dest +if (( $? != 0 )); then + exit 4 +fi + +mkdir $DIR +cd $DIR + +cat > test.pl <<-EOPERL + use IO::Socket; + my \$s = IO::Socket::INET->new( + Proto => "tcp", + PeerAddr => "$dest", + PeerPort => $tcpport, + Timeout => 3); + die "Could not connect to host $dest port $tcpport" unless \$s; + print \$s "testing state machine transitions"; + close \$s; +EOPERL + +$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE +BEGIN +{ + ipsend = tcpsend = ipreceive = tcpreceive = 0; + connreq = connest = 0; +} + +ip:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipsend++; +} + +tcp:::send +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->tcp_dport == $tcpport/ +{ + tcpsend++; +} + +ip:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[4]->ipv4_protocol == IPPROTO_TCP/ +{ + ipreceive++; +} + +tcp:::receive +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[4]->tcp_sport == $tcpport/ +{ + tcpreceive++; +} + +tcp:::state-change +{ + state_event[args[3]->tcps_state]++; +} + +tcp:::connect-request +/args[2]->ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && + args[4]->tcp_dport == $tcpport/ +{ + connreq++; +} + +tcp:::connect-established +/args[2]->ip_saddr == "$dest" && args[2]->ip_daddr == "$source" && + args[4]->tcp_sport == $tcpport/ +{ + connest++; +} + +END +{ + printf("Minimum TCP events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 4 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 3 ? "yes" : "no"); + printf("tcp:::send - %s\n", tcpsend >= 4 ? "yes" : "no"); + printf("tcp:::receive - %s\n", tcpreceive >= 3 ? "yes" : "no"); + printf("tcp:::state-change to syn-sent - %s\n", + state_event[TCP_STATE_SYN_SENT] >=1 ? "yes" : "no"); + printf("tcp:::state-change to established - %s\n", + state_event[TCP_STATE_ESTABLISHED] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to fin-wait-1 - %s\n", + state_event[TCP_STATE_FIN_WAIT_1] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to fin-wait-2 - %s\n", + state_event[TCP_STATE_FIN_WAIT_2] >= 1 ? "yes" : "no"); + printf("tcp:::state-change to time-wait - %s\n", + state_event[TCP_STATE_TIME_WAIT] >= 1 ? "yes" : "no"); + printf("tcp:::connect-request - %s\n", + connreq >=1 ? "yes" : "no"); + printf("tcp:::connect-established - %s\n", + connest >=1 ? "yes" : "no"); +} +EODTRACE + +status=$? + +cd / +/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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/manifest/Makefile.kup 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 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/Makefile.kup 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. <String> emptySet()); + } + } + + private static void + startAggregateThread(final Consumer consumer) + { + Runnable aggregateSampler = new Runnable() { + public void run() { + Thread t = Thread.currentThread(); + getAggregateThreadID.set(t.getId()); + Throwable x = null; + try { + sampleAggregate(consumer); + } catch (Throwable e) { + x = e; + } + + if (Thread.holdsLock(LocalConsumer.class)) { + if (x != null) { + x.printStackTrace(); + } + System.out.println("Lock held"); + System.exit(1); + } else { + System.out.println("Lock released"); + consumer.close(); // blocks if lock held + } + } + }; + + Thread t = new Thread(aggregateSampler, "Aggregate Sampler"); + t.start(); + } + + static void + usage() + { + System.err.println("usage: java TestDrop [ seconds ]"); + System.exit(2); + } + + public static void + main(String[] args) + { + if (args.length == 1) { + try { + seconds = Integer.parseInt(args[0]); + } catch (NumberFormatException e) { + usage(); + } + } else if (args.length > 1) { + usage(); + } + + final Consumer consumer = new LocalConsumer() { + protected Thread createThread() { + Runnable worker = new Runnable() { + public void run() { + Thread t = Thread.currentThread(); + consumerThreadID.set(t.getId()); + work(); + } + }; + Thread t = new Thread(worker); + return t; + } + }; + + consumer.addConsumerListener(new ConsumerAdapter() { + public void consumerStarted(ConsumerEvent e) { + startAggregateThread(consumer); + startTimer(); + } + public void dataDropped(DropEvent e) throws ConsumerException { + Thread t = Thread.currentThread(); + if (t.getId() == getAggregateThreadID.get()) { + Drop drop = e.getDrop(); + throw new ConsumerException(drop.getDefaultMessage(), + drop); + } + } + }); + + try { + consumer.open(); + consumer.setOption(Option.aggsize, Option.kb(1)); + consumer.setOption(Option.aggrate, Option.millis(101)); + consumer.compile(PROGRAM); + consumer.enable(); + consumer.go(new ExceptionHandler() { + public void handleException(Throwable e) { + e.printStackTrace(); + } + }); + } catch (DTraceException e) { + e.printStackTrace(); + } + } +} diff --git a/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 <command>"); + System.exit(1); + } + String cmd = args[0]; + + Consumer consumer = new LocalConsumer(); + try { + consumer.open(); + consumer.compile(kernelLookupProgram); + consumer.enable(); + consumer.go(); + Aggregate a; + Number address; + String f; + boolean done = false; + for (int i = 0; (i < 20) && !done; ++i) { + Thread.currentThread().sleep(100); + a = consumer.getAggregate(); + for (Aggregation agg : a.getAggregations()) { + for (Tuple tuple : agg.asMap().keySet()) { + address = (Number)tuple.get(0).getValue(); + if (address instanceof Integer) { + int addr = (Integer)address; + f = consumer.lookupKernelFunction(addr); + } else { + long addr = (Long)address; + f = consumer.lookupKernelFunction(addr); + } + if (f.equals("genunix`cv_wakeup")) { + System.out.println(f); + done = true; + } + } + } + } + consumer.close(); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + + consumer = new LocalConsumer(); + try { + consumer.open(); + int pid = consumer.createProcess(cmd); + consumer.compile(userLookupProgram); + consumer.enable(); + consumer.go(); + Thread.currentThread().sleep(500); + Aggregate a = consumer.getAggregate(); + Number address; + String f; + for (Aggregation agg : a.getAggregations()) { + for (Tuple tuple : agg.asMap().keySet()) { + address = (Number)tuple.get(0).getValue(); + if (address instanceof Integer) { + int addr = (Integer)address; + f = consumer.lookupUserFunction(pid, addr); + } else { + long addr = (Long)address; + f = consumer.lookupUserFunction(pid, addr); + } + System.out.println(f); + } + } + consumer.close(); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + } +} diff --git a/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 <String> included = new HashSet <String> (); + int n = 1; + + for (String name : aggregationNames) { + included.add(name); + } + + // Wait up to a full second to obtain aggregate data. Without a + // time limit, we'll loop forever if no aggregation was + // successfully included. + do { + Thread.sleep(TICK); + aggregate = consumer.getAggregate(included, null); + } while (aggregate.asMap().isEmpty() && n++ < (1000 / TICK)); + + for (String name : included) { + if (aggregate.getAggregation(name) == null) { + throw new IllegalStateException("@" + name + + " was explicitly included but did not appear " + + "in the aggregate"); + } + } + for (Aggregation a : aggregate.getAggregations()) { + if (!included.contains(a.getName())) { + throw new IllegalStateException("@" + a.getName() + + " was not explicitly included but appeared " + + "in the aggregate anyway"); + } + } + + if (!consumer.isRunning()) { + throw new IllegalStateException("consumer exited"); + } + } + + static void + testCleared(Consumer consumer, String ... aggregationNames) + throws DTraceException, InterruptedException + { + Aggregate aggregate; + AggregationRecord rec; + long value; + Long firstValue; + int n = 1; + Map <String, Long> firstValues = new HashMap <String, Long> (); + Set <String> cleared = new HashSet <String> (); + + for (String name : aggregationNames) { + cleared.add(name); + } + + do { + Thread.sleep(TICK); + aggregate = consumer.getAggregate(null, cleared); + } while (aggregate.asMap().isEmpty() && n++ < (1000 / TICK)); + n = 1; + + do { + Thread.sleep(TICK * EXPECTED_TICKS); + aggregate = consumer.getAggregate(null, cleared); + + for (Aggregation a : aggregate.getAggregations()) { + if (!firstValues.containsKey(a.getName())) { + rec = a.getRecord(Tuple.EMPTY); + value = rec.getValue().getValue().longValue(); + firstValues.put(a.getName(), value); + } + } + } while (consumer.isRunning() && n++ < INTERVALS); + + for (Aggregation a : aggregate.getAggregations()) { + rec = a.getRecord(Tuple.EMPTY); + value = rec.getValue().getValue().longValue(); + firstValue = firstValues.get(a.getName()); + + if (cleared.contains(a.getName())) { + // last value should be about the same as first value + if (value > (firstValue * 2)) { + throw new IllegalStateException( + "@" + a.getName() + " should have " + + "been cleared but instead grew from " + + firstValue + " to " + value); + } + } else { + // last value should be about (INTERVALS * firstValue) + if (value < (firstValue * 2)) { + throw new IllegalStateException( + "@" + a.getName() + " should have " + + "accumulated a running total but " + + "instead went from " + + firstValue + " to " + value); + } + } + } + + if (!consumer.isRunning()) { + throw new IllegalStateException("consumer exited"); + } + } + + static Integer includedStatus; + static Integer clearedStatus; + + static void + startIncludedTest() + { + final Consumer consumer = new LocalConsumer(); + consumer.addConsumerListener(new ConsumerAdapter() { + public void consumerStarted(ConsumerEvent e) { + new Thread(new Runnable() { + public void run() { + try { + testIncluded(consumer, ANONYMOUS_AGGREGATION); + includedStatus = 0; + } catch (Exception e) { + includedStatus = 1; + e.printStackTrace(); + } finally { + consumer.abort(); + } + } + }).start(); + } + }); + + try { + consumer.open(); + consumer.setOption(Option.aggrate, Option.millis(TICK)); + consumer.compile(programString); + consumer.enable(); + consumer.go(); + } catch (Exception e) { + includedStatus = 1; + e.printStackTrace(); + } + } + + static void + startClearedTest() + { + final Consumer consumer = new LocalConsumer(); + consumer.addConsumerListener(new ConsumerAdapter() { + public void consumerStarted(ConsumerEvent e) { + new Thread(new Runnable() { + public void run() { + try { + testCleared(consumer, ANONYMOUS_AGGREGATION); + clearedStatus = 0; + } catch (Exception e) { + clearedStatus = 1; + e.printStackTrace(); + } finally { + consumer.abort(); + } + } + }).start(); + } + }); + + try { + consumer.open(); + consumer.setOption(Option.aggrate, Option.millis(TICK)); + consumer.compile(programString); + consumer.enable(); + consumer.go(); + } catch (Exception e) { + clearedStatus = 1; + e.printStackTrace(); + } + } + + public static void + main(String[] args) + { + startIncludedTest(); + + do { + try { + Thread.sleep(TICK); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } while (includedStatus == null); + + startClearedTest(); + + do { + try { + Thread.sleep(TICK); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } while (clearedStatus == null); + + if (includedStatus != 0 || clearedStatus != 0) { + System.out.println("Failure"); + System.exit(1); + } + + System.out.println("Success"); + } +} diff --git a/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 <Record> records = data.getRecords(); + Record record; + Object value; + buf.append('['); + for (int i = 0; i < records.size(); ++i) { + if (i > 0) { + buf.append(", "); + } + record = records.get(i); + if (record instanceof ValueRecord) { + value = ((ValueRecord)record).getValue(); + if (value instanceof String) { + buf.append("\""); + buf.append((String)value); + buf.append("\""); + } else { + buf.append(record); + } + } else if (record instanceof PrintaRecord) { + PrintaRecord printa = (PrintaRecord)record; + buf.append(printaRecordString(printa)); + } else { + buf.append(record); + } + } + buf.append(']'); + return buf.toString(); + } + + public static void + main(String[] args) + { + if (args.length != 1) { + System.err.println("usage: java TestMultiAggPrinta <script>"); + System.exit(2); + } + + final Consumer consumer = new LocalConsumer(); + consumer.addConsumerListener(new ConsumerAdapter() { + public void dataReceived(DataEvent e) { + ProbeData data = e.getProbeData(); + List <Record> records = data.getRecords(); + for (Record r : records) { + if (r instanceof ExitRecord) { + ExitRecord exitRecord = (ExitRecord)r; + exitStatus = exitRecord.getStatus(); + } + } + System.out.println(probeDataString(e.getProbeData())); + } + public void consumerStopped(ConsumerEvent e) { + consumer.close(); + System.exit(exitStatus); + } + }); + + File file = new File(args[0]); + try { + consumer.open(); + consumer.compile(file); + consumer.enable(); + consumer.go(); + } catch (DTraceException e) { + e.printStackTrace(); + System.exit(1); + } catch (IOException e) { + e.printStackTrace(); + System.exit(1); + } + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestProbeData.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestProbeData.java new file mode 100644 index 00000000..78a65f9e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestProbeData.java @@ -0,0 +1,110 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + * + * ident "%Z%%M% %I% %E% SMI" + */ + +import java.util.*; +import org.opensolaris.os.dtrace.*; + +/** + * Regression test verifies that ProbeData instances sort as expected + * with multiple enabled probe IDs and multiple records including byte + * array (sorted as unsigned bytes), stand-alone ufunc() action, and + * signed integer. + */ +public class TestProbeData { + public static final String PROGRAM = + "pid$target::fN:entry\n" + + "{\n" + + " tracemem(copyin(arg1, 6), 6);\n" + + " ufunc(arg0);\n" + + " trace((int)arg2);\n" + + "}" + + "" + + "pid$target::fN2:entry\n" + + "{\n" + + " tracemem(copyin(arg1, 6), 6);\n" + + " ufunc(arg0);\n" + + " trace((int)arg2);\n" + + "}"; + + static String + getString(ProbeData p) + { + StringBuilder buf = new StringBuilder(); + buf.append("[probe "); + buf.append(p.getEnabledProbeID()); + buf.append(' '); + ProbeDescription d = p.getEnabledProbeDescription(); + buf.append("pid$target"); + buf.append(':'); + buf.append(d.getModule()); + buf.append(':'); + buf.append(d.getFunction()); + buf.append(':'); + buf.append(d.getName()); + buf.append(' '); + buf.append(p.getRecords()); + buf.append("]"); + return buf.toString(); + } + + public static void + main(String[] args) + { + if (args.length != 1) { + System.err.println("usage: java TestProbedata <command>"); + System.exit(2); + } + + String command = args[0]; + final Consumer consumer = new LocalConsumer(); + final List <ProbeData> list = new ArrayList <ProbeData> (); + consumer.addConsumerListener(new ConsumerAdapter() { + public void dataReceived(DataEvent e) { + list.add(e.getProbeData()); + } + public void consumerStopped(ConsumerEvent e) { + Collections.sort(list); + for (ProbeData p : list) { + System.out.println(getString(p)); + System.out.println(); + } + consumer.close(); + } + }); + + try { + consumer.open(); + consumer.createProcess(command); + consumer.compile(PROGRAM); + consumer.enable(); + consumer.go(); + } catch (DTraceException e) { + e.printStackTrace(); + } + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestProbeDescription.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestProbeDescription.java new file mode 100644 index 00000000..b9e95700 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestProbeDescription.java @@ -0,0 +1,55 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + * + * ident "%Z%%M% %I% %E% SMI" + */ + +import org.opensolaris.os.dtrace.*; +import java.util.logging.*; + +/** + * Regression for 6399915 ProbeDescription single arg constructor should + * parse probe descriptions. + */ +public class TestProbeDescription { + public static void + main(String[] args) + { + ProbeDescription p = null; + int len = args.length; + if (len == 0) { + p = new ProbeDescription("syscall:::entry"); + } else if (len == 1) { + p = new ProbeDescription(args[0]); + } else if (len == 2) { + p = new ProbeDescription(args[0], args[1]); + } else if (len == 3) { + p = new ProbeDescription(args[0], args[1], args[2]); + } else if (len == 4) { + p = new ProbeDescription(args[0], args[1], args[2], args[3]); + } + System.out.println(p); + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestStateMachine.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestStateMachine.java new file mode 100644 index 00000000..8875d066 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestStateMachine.java @@ -0,0 +1,627 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + * + * ident "%Z%%M% %I% %E% SMI" + */ + +import org.opensolaris.os.dtrace.*; + +/** + * Regression test for the LocalConsumer state machine. Calls Consumer + * methods before and after open(), compile(), enable(), go(), stop(), + * and close() to verify that the calls succeed as expected or fail with + * the expected Java exception. + */ +public class TestStateMachine { + static Program program; + + static void + exit(int status) + { + exit(status, null); + } + + static void + exit(int status, String msg) + { + if (msg != null) { + System.out.println(msg); + } + System.out.flush(); + System.err.flush(); + System.exit(status); + } + + static void + printState(Consumer consumer) + { + System.out.println("open: " + consumer.isOpen()); + System.out.println("enabled: " + consumer.isEnabled()); + System.out.println("closed: " + consumer.isClosed()); + } + + static void + beforeOpen(Consumer consumer) + { + System.out.println("before open"); + printState(consumer); + + // compile + try { + consumer.compile("syscall:::entry"); + exit(1, "compile before open"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "compile before open"); + } + + // enable + try { + consumer.enable(); + exit(1, "enable before open"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "enable before open"); + } + + // getOption, setOption, unsetOption + try { + consumer.getOption(Option.bufsize); + exit(1, "getOption before open"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getOption before open"); + } + try { + consumer.setOption(Option.bufsize, Option.mb(1)); + exit(1, "setOption before open"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "setOption before open"); + } + try { + consumer.unsetOption(Option.quiet); + exit(1, "unsetOption before open"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "unsetOption before open"); + } + + // createProcess, grabProcess + try { + consumer.createProcess("date"); + exit(1, "createProcess before open"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "createProcess before open"); + } + try { + consumer.grabProcess(1); + exit(1, "grabProcess before open"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "grabProcess before open"); + } + + // listProbes + try { + consumer.listProbes(ProbeDescription.EMPTY); + exit(1, "listProbes before open"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "listProbes before open"); + } + + // getAggregate + try { + consumer.getAggregate(); + exit(1, "getAggregate before open"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getAggregate before open"); + } + + // getVersion + try { + consumer.getVersion(); // allowed + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getVersion before open"); + } + } + + static void + beforeCompile(Consumer consumer) + { + System.out.println("before compile"); + printState(consumer); + + // open + try { + consumer.open(); + exit(1, "open after open"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "open after open"); + } + + // enable + try { + consumer.enable(); + exit(1, "enable before compile"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "enable before compile"); + } + } + + static void + beforeEnable(Consumer consumer) + { + System.out.println("before enable"); + printState(consumer); + + // go + try { + consumer.go(); + exit(1, "go before enable"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "go before enable"); + } + } + + static void + beforeGo(Consumer consumer) + { + System.out.println("before go"); + printState(consumer); + + // getAggregate + try { + consumer.getAggregate(); + exit(1, "getAggregate before go"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getAggregate before go"); + } + + // lookupKernelFunction, lookupUserFunction + try { + consumer.lookupKernelFunction(1); + exit(1, "lookupKernelFunction before go"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "lookupKernelFunction before go"); + } + try { + consumer.lookupUserFunction(1, 1); + exit(1, "lookupUserFunction before go"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "lookupUserFunction before go"); + } + + // stop + try { + consumer.stop(); + exit(1, "stop before go"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "stop before go"); + } + } + + static void + afterGo(Consumer consumer, Program program) + { + System.out.println("after go"); + printState(consumer); + + // go + try { + consumer.go(); + exit(1, "go after go"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "go after go"); + } + + // createProcess, grabProcess + try { + consumer.createProcess("date"); + exit(1, "createProcess after go"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "createProcess after go"); + } + try { + consumer.grabProcess(1); + exit(1, "grabProcess after go"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "grabProcess after go"); + } + + // listProbes + try { + consumer.listProbes(ProbeDescription.EMPTY); + exit(1, "listProbes after go"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "listProbes after go"); + } + + // compile + try { + consumer.compile("syscall:::entry"); + exit(1, "compile after go"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "compile after go"); + } + + // enable + try { + consumer.enable(); + exit(1, "enable after go"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "enable after go"); + } + + // getAggregate + try { + consumer.getAggregate(); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getAggregate after go"); + } + + // getProgramInfo + try { + consumer.getProgramInfo(program); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getProgramInfo after go"); + } + + // getOption, setOption, unsetOption + try { + consumer.getOption(Option.quiet); + consumer.setOption(Option.quiet); + consumer.unsetOption(Option.quiet); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "get, set, unset option after go"); + } + } + + static void + afterStop(Consumer consumer, Program program) + { + System.out.println("after stop"); + printState(consumer); + + // stop + try { + consumer.stop(); + exit(1, "stop after stop"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "stop after stop"); + } + + // getAggregate + try { + consumer.getAggregate(); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getAggregate after stop"); + } + + // getProgramInfo + try { + consumer.getProgramInfo(program); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getProgramInfo after stop"); + } + + // getOption, setOption, unsetOption + try { + consumer.getOption(Option.quiet); + consumer.setOption(Option.quiet); + consumer.unsetOption(Option.quiet); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "get, set, unset option after stop"); + } + } + + static void + afterClose(Consumer consumer, Program program) + { + System.out.println("after close"); + printState(consumer); + + // open + try { + consumer.open(); + exit(1, "open after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "open after close"); + } + + // compile + try { + consumer.compile("syscall:::entry"); + exit(1, "compile after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "compile after close"); + } + + // enable + try { + consumer.enable(); + exit(1, "enable after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "enable after close"); + } + + // getOption, setOption, unsetOption + try { + consumer.getOption(Option.bufsize); + exit(1, "getOption after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getOption after close"); + } + try { + consumer.setOption(Option.bufsize, Option.mb(1)); + exit(1, "setOption after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "setOption after close"); + } + try { + consumer.unsetOption(Option.quiet); + exit(1, "unsetOption after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "unsetOption after close"); + } + + // createProcess, grabProcess + try { + consumer.createProcess("date"); + exit(1, "createProcess after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "createProcess after close"); + } + try { + consumer.grabProcess(1); + exit(1, "grabProcess after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "grabProcess after close"); + } + + // listProbes + try { + consumer.listProbes(ProbeDescription.EMPTY); + exit(1, "listProbes after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "listProbes after close"); + } + + // getAggregate + try { + consumer.getAggregate(); + exit(1, "getAggregate after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getAggregate after close"); + } + + // getVersion + try { + consumer.getVersion(); // allowed + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getVersion after close"); + } + + // go + try { + consumer.go(); + exit(1, "go after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "go after close"); + } + + // lookupKernelFunction, lookupUserFunction + try { + consumer.lookupKernelFunction(1); + exit(1, "lookupKernelFunction after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "lookupKernelFunction after close"); + } + try { + consumer.lookupUserFunction(1, 1); + exit(1, "lookupUserFunction after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "lookupUserFunction after close"); + } + + // stop + try { + consumer.stop(); + exit(1, "stop after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "stop after close"); + } + + // getProgramInfo + try { + consumer.getProgramInfo(program); + exit(1, "getProgramInfo after close"); + } catch (IllegalStateException e) { + System.out.println(e); + } catch (Exception e) { + e.printStackTrace(); + exit(1, "getProgramInfo after close"); + } + } + + public static void + main(String[] args) + { + final Consumer consumer = new LocalConsumer(); + consumer.addConsumerListener(new ConsumerAdapter() { + public void consumerStarted(ConsumerEvent e) { + System.out.println("consumerStarted, running: " + + consumer.isRunning()); + afterGo(consumer, program); + } + public void consumerStopped(ConsumerEvent e) { + System.out.println("consumerStopped, running: " + + consumer.isRunning()); + } + }); + + try { + beforeOpen(consumer); + consumer.open(); + beforeCompile(consumer); + program = consumer.compile( + "syscall:::entry { @[execname] = count(); } " + + "tick-101ms { printa(@); }"); + beforeEnable(consumer); + consumer.enable(); + beforeGo(consumer); + System.out.println("before go, running: " + consumer.isRunning()); + consumer.go(); + // Avoid race, call afterGo() in ConsumerListener + try { + Thread.currentThread().sleep(300); + } catch (InterruptedException e) { + e.printStackTrace(); + exit(1); + } + consumer.stop(); + System.out.println("after stop, running: " + consumer.isRunning()); + afterStop(consumer, program); + consumer.close(); + afterClose(consumer, program); + } catch (DTraceException e) { + e.printStackTrace(); + exit(1); + } + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestStopLock.java b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestStopLock.java new file mode 100644 index 00000000..f37c9cf1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/src/TestStopLock.java @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + * + * ident "%Z%%M% %I% %E% SMI" + */ + +import org.opensolaris.os.dtrace.*; + +/** + * Test for bug 6399888 stop() hangs if ConsumerListener calls + * synchronized Consumer method + */ +public class TestStopLock { + public static void + main(String[] args) + { + final Consumer consumer = new LocalConsumer(); + consumer.addConsumerListener(new ConsumerAdapter() { + @Override + public void intervalBegan(ConsumerEvent e) { + consumer.isRunning(); + } + }); + + try { + consumer.open(); + consumer.compile("syscall:::entry { @[execname] = count(); } " + + "tick-101ms { printa(@); }"); + consumer.enable(); + consumer.go(); + try { + Thread.currentThread().sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + System.exit(1); + } + consumer.stop(); + consumer.close(); + } catch (DTraceException e) { + e.printStackTrace(); + System.exit(1); + } + System.out.println("Successful"); + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh new file mode 100755 index 00000000..85c2c706 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh @@ -0,0 +1,39 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Fixed bug 6426129 abort() after close() throws +# NoSuchElementException. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestAbort diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh.out new file mode 100644 index 00000000..628d7870 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Abort.ksh.out @@ -0,0 +1 @@ +Successful diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh new file mode 100755 index 00000000..99b232eb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh @@ -0,0 +1,41 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# All Serializable classes can be serializaed and deserialized, +# also encoded in XML and decoded, and still remain equal and have +# equal string values. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestBean TestBean.out +rm -f TestBean.out diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out new file mode 100644 index 00000000..cf24c672 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Bean.ksh.out @@ -0,0 +1,722 @@ +ExitRecord: + serialized: 1 + deserialized: 1 +ExitRecord: + encoded: 1 + decoded: 1 +AggregationRecord: + serialized: org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7] + deserialized: org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7] +AggregationRecord: + encoded: org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7] + decoded: org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7] +Aggregation: + serialized: org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]] + deserialized: org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]] +Aggregation: + encoded: org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]] + decoded: org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]] +Tuple: + serialized: [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +] + deserialized: [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +] +Tuple: + encoded: [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +] + decoded: [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +] +ScalarRecord: + serialized: [1, 2, 3] + deserialized: [1, 2, 3] +ScalarRecord: + encoded: [1, 2, 3] + decoded: [1, 2, 3] +KernelStackRecord: + serialized: + Frame 1 + Frame 2 + Frame 3 + + deserialized: + Frame 1 + Frame 2 + Frame 3 + +KernelStackRecord: + encoded: + Frame 1 + Frame 2 + Frame 3 + + decoded: + Frame 1 + Frame 2 + Frame 3 + +LogDistribution: + serialized: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -4611686018427387904, max = -2305843009213693953, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2305843009213693952, max = -1152921504606846977, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1152921504606846976, max = -576460752303423489, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = -576460752303423488, max = -288230376151711745, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = -288230376151711744, max = -144115188075855873, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = -144115188075855872, max = -72057594037927937, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = -72057594037927936, max = -36028797018963969, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = -36028797018963968, max = -18014398509481985, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = -18014398509481984, max = -9007199254740993, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = -9007199254740992, max = -4503599627370497, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4503599627370496, max = -2251799813685249, frequency = 10], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2251799813685248, max = -1125899906842625, frequency = 11], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1125899906842624, max = -562949953421313, frequency = 12], org.opensolaris.os.dtrace.Distribution$Bucket[min = -562949953421312, max = -281474976710657, frequency = 13], org.opensolaris.os.dtrace.Distribution$Bucket[min = -281474976710656, max = -140737488355329, frequency = 14], org.opensolaris.os.dtrace.Distribution$Bucket[min = -140737488355328, max = -70368744177665, frequency = 15], org.opensolaris.os.dtrace.Distribution$Bucket[min = -70368744177664, max = -35184372088833, frequency = 16], org.opensolaris.os.dtrace.Distribution$Bucket[min = -35184372088832, max = -17592186044417, frequency = 17], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17592186044416, max = -8796093022209, frequency = 18], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8796093022208, max = -4398046511105, frequency = 19], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4398046511104, max = -2199023255553, frequency = 20], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2199023255552, max = -1099511627777, frequency = 21], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1099511627776, max = -549755813889, frequency = 22], org.opensolaris.os.dtrace.Distribution$Bucket[min = -549755813888, max = -274877906945, frequency = 23], org.opensolaris.os.dtrace.Distribution$Bucket[min = -274877906944, max = -137438953473, frequency = 24], org.opensolaris.os.dtrace.Distribution$Bucket[min = -137438953472, max = -68719476737, frequency = 25], org.opensolaris.os.dtrace.Distribution$Bucket[min = -68719476736, max = -34359738369, frequency = 26], org.opensolaris.os.dtrace.Distribution$Bucket[min = -34359738368, max = -17179869185, frequency = 27], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17179869184, max = -8589934593, frequency = 28], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8589934592, max = -4294967297, frequency = 29], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4294967296, max = -2147483649, frequency = 30], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2147483648, max = -1073741825, frequency = 31], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1073741824, max = -536870913, frequency = 32], org.opensolaris.os.dtrace.Distribution$Bucket[min = -536870912, max = -268435457, frequency = 33], org.opensolaris.os.dtrace.Distribution$Bucket[min = -268435456, max = -134217729, frequency = 34], org.opensolaris.os.dtrace.Distribution$Bucket[min = -134217728, max = -67108865, frequency = 35], org.opensolaris.os.dtrace.Distribution$Bucket[min = -67108864, max = -33554433, frequency = 36], org.opensolaris.os.dtrace.Distribution$Bucket[min = -33554432, max = -16777217, frequency = 37], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16777216, max = -8388609, frequency = 38], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8388608, max = -4194305, frequency = 39], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4194304, max = -2097153, frequency = 40], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2097152, max = -1048577, frequency = 41], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1048576, max = -524289, frequency = 42], org.opensolaris.os.dtrace.Distribution$Bucket[min = -524288, max = -262145, frequency = 43], org.opensolaris.os.dtrace.Distribution$Bucket[min = -262144, max = -131073, frequency = 44], org.opensolaris.os.dtrace.Distribution$Bucket[min = -131072, max = -65537, frequency = 45], org.opensolaris.os.dtrace.Distribution$Bucket[min = -65536, max = -32769, frequency = 46], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32768, max = -16385, frequency = 47], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16384, max = -8193, frequency = 48], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8192, max = -4097, frequency = 49], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4096, max = -2049, frequency = 50], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2048, max = -1025, frequency = 51], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1024, max = -513, frequency = 52], org.opensolaris.os.dtrace.Distribution$Bucket[min = -512, max = -257, frequency = 53], org.opensolaris.os.dtrace.Distribution$Bucket[min = -256, max = -129, frequency = 54], org.opensolaris.os.dtrace.Distribution$Bucket[min = -128, max = -65, frequency = 55], org.opensolaris.os.dtrace.Distribution$Bucket[min = -64, max = -33, frequency = 56], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32, max = -17, frequency = 57], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16, max = -9, frequency = 58], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8, max = -5, frequency = 59], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4, max = -3, frequency = 60], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2, max = -2, frequency = 61], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1, max = -1, frequency = 62], org.opensolaris.os.dtrace.Distribution$Bucket[min = 0, max = 0, frequency = 63], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 64], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 65], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 66], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 67], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 68], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 69], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 70], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 255, frequency = 71], org.opensolaris.os.dtrace.Distribution$Bucket[min = 256, max = 511, frequency = 72], org.opensolaris.os.dtrace.Distribution$Bucket[min = 512, max = 1023, frequency = 73], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1024, max = 2047, frequency = 74], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2048, max = 4095, frequency = 75], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4096, max = 8191, frequency = 76], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8192, max = 16383, frequency = 77], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16384, max = 32767, frequency = 78], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32768, max = 65535, frequency = 79], org.opensolaris.os.dtrace.Distribution$Bucket[min = 65536, max = 131071, frequency = 80], org.opensolaris.os.dtrace.Distribution$Bucket[min = 131072, max = 262143, frequency = 81], org.opensolaris.os.dtrace.Distribution$Bucket[min = 262144, max = 524287, frequency = 82], org.opensolaris.os.dtrace.Distribution$Bucket[min = 524288, max = 1048575, frequency = 83], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1048576, max = 2097151, frequency = 84], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2097152, max = 4194303, frequency = 85], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4194304, max = 8388607, frequency = 86], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8388608, max = 16777215, frequency = 87], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16777216, max = 33554431, frequency = 88], org.opensolaris.os.dtrace.Distribution$Bucket[min = 33554432, max = 67108863, frequency = 89], org.opensolaris.os.dtrace.Distribution$Bucket[min = 67108864, max = 134217727, frequency = 90], org.opensolaris.os.dtrace.Distribution$Bucket[min = 134217728, max = 268435455, frequency = 91], org.opensolaris.os.dtrace.Distribution$Bucket[min = 268435456, max = 536870911, frequency = 92], org.opensolaris.os.dtrace.Distribution$Bucket[min = 536870912, max = 1073741823, frequency = 93], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1073741824, max = 2147483647, frequency = 94], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2147483648, max = 4294967295, frequency = 95], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4294967296, max = 8589934591, frequency = 96], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8589934592, max = 17179869183, frequency = 97], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17179869184, max = 34359738367, frequency = 98], org.opensolaris.os.dtrace.Distribution$Bucket[min = 34359738368, max = 68719476735, frequency = 99], org.opensolaris.os.dtrace.Distribution$Bucket[min = 68719476736, max = 137438953471, frequency = 100], org.opensolaris.os.dtrace.Distribution$Bucket[min = 137438953472, max = 274877906943, frequency = 101], org.opensolaris.os.dtrace.Distribution$Bucket[min = 274877906944, max = 549755813887, frequency = 102], org.opensolaris.os.dtrace.Distribution$Bucket[min = 549755813888, max = 1099511627775, frequency = 103], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1099511627776, max = 2199023255551, frequency = 104], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2199023255552, max = 4398046511103, frequency = 105], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4398046511104, max = 8796093022207, frequency = 106], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8796093022208, max = 17592186044415, frequency = 107], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17592186044416, max = 35184372088831, frequency = 108], org.opensolaris.os.dtrace.Distribution$Bucket[min = 35184372088832, max = 70368744177663, frequency = 109], org.opensolaris.os.dtrace.Distribution$Bucket[min = 70368744177664, max = 140737488355327, frequency = 110], org.opensolaris.os.dtrace.Distribution$Bucket[min = 140737488355328, max = 281474976710655, frequency = 111], org.opensolaris.os.dtrace.Distribution$Bucket[min = 281474976710656, max = 562949953421311, frequency = 112], org.opensolaris.os.dtrace.Distribution$Bucket[min = 562949953421312, max = 1125899906842623, frequency = 113], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1125899906842624, max = 2251799813685247, frequency = 114], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2251799813685248, max = 4503599627370495, frequency = 115], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4503599627370496, max = 9007199254740991, frequency = 116], org.opensolaris.os.dtrace.Distribution$Bucket[min = 9007199254740992, max = 18014398509481983, frequency = 117], org.opensolaris.os.dtrace.Distribution$Bucket[min = 18014398509481984, max = 36028797018963967, frequency = 118], org.opensolaris.os.dtrace.Distribution$Bucket[min = 36028797018963968, max = 72057594037927935, frequency = 119], org.opensolaris.os.dtrace.Distribution$Bucket[min = 72057594037927936, max = 144115188075855871, frequency = 120], org.opensolaris.os.dtrace.Distribution$Bucket[min = 144115188075855872, max = 288230376151711743, frequency = 121], org.opensolaris.os.dtrace.Distribution$Bucket[min = 288230376151711744, max = 576460752303423487, frequency = 122], org.opensolaris.os.dtrace.Distribution$Bucket[min = 576460752303423488, max = 1152921504606846975, frequency = 123], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1152921504606846976, max = 2305843009213693951, frequency = 124], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2305843009213693952, max = 4611686018427387903, frequency = 125], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4611686018427387904, max = 9223372036854775807, frequency = 126]], total = 8001.0] + deserialized: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -4611686018427387904, max = -2305843009213693953, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2305843009213693952, max = -1152921504606846977, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1152921504606846976, max = -576460752303423489, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = -576460752303423488, max = -288230376151711745, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = -288230376151711744, max = -144115188075855873, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = -144115188075855872, max = -72057594037927937, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = -72057594037927936, max = -36028797018963969, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = -36028797018963968, max = -18014398509481985, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = -18014398509481984, max = -9007199254740993, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = -9007199254740992, max = -4503599627370497, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4503599627370496, max = -2251799813685249, frequency = 10], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2251799813685248, max = -1125899906842625, frequency = 11], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1125899906842624, max = -562949953421313, frequency = 12], org.opensolaris.os.dtrace.Distribution$Bucket[min = -562949953421312, max = -281474976710657, frequency = 13], org.opensolaris.os.dtrace.Distribution$Bucket[min = -281474976710656, max = -140737488355329, frequency = 14], org.opensolaris.os.dtrace.Distribution$Bucket[min = -140737488355328, max = -70368744177665, frequency = 15], org.opensolaris.os.dtrace.Distribution$Bucket[min = -70368744177664, max = -35184372088833, frequency = 16], org.opensolaris.os.dtrace.Distribution$Bucket[min = -35184372088832, max = -17592186044417, frequency = 17], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17592186044416, max = -8796093022209, frequency = 18], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8796093022208, max = -4398046511105, frequency = 19], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4398046511104, max = -2199023255553, frequency = 20], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2199023255552, max = -1099511627777, frequency = 21], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1099511627776, max = -549755813889, frequency = 22], org.opensolaris.os.dtrace.Distribution$Bucket[min = -549755813888, max = -274877906945, frequency = 23], org.opensolaris.os.dtrace.Distribution$Bucket[min = -274877906944, max = -137438953473, frequency = 24], org.opensolaris.os.dtrace.Distribution$Bucket[min = -137438953472, max = -68719476737, frequency = 25], org.opensolaris.os.dtrace.Distribution$Bucket[min = -68719476736, max = -34359738369, frequency = 26], org.opensolaris.os.dtrace.Distribution$Bucket[min = -34359738368, max = -17179869185, frequency = 27], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17179869184, max = -8589934593, frequency = 28], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8589934592, max = -4294967297, frequency = 29], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4294967296, max = -2147483649, frequency = 30], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2147483648, max = -1073741825, frequency = 31], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1073741824, max = -536870913, frequency = 32], org.opensolaris.os.dtrace.Distribution$Bucket[min = -536870912, max = -268435457, frequency = 33], org.opensolaris.os.dtrace.Distribution$Bucket[min = -268435456, max = -134217729, frequency = 34], org.opensolaris.os.dtrace.Distribution$Bucket[min = -134217728, max = -67108865, frequency = 35], org.opensolaris.os.dtrace.Distribution$Bucket[min = -67108864, max = -33554433, frequency = 36], org.opensolaris.os.dtrace.Distribution$Bucket[min = -33554432, max = -16777217, frequency = 37], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16777216, max = -8388609, frequency = 38], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8388608, max = -4194305, frequency = 39], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4194304, max = -2097153, frequency = 40], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2097152, max = -1048577, frequency = 41], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1048576, max = -524289, frequency = 42], org.opensolaris.os.dtrace.Distribution$Bucket[min = -524288, max = -262145, frequency = 43], org.opensolaris.os.dtrace.Distribution$Bucket[min = -262144, max = -131073, frequency = 44], org.opensolaris.os.dtrace.Distribution$Bucket[min = -131072, max = -65537, frequency = 45], org.opensolaris.os.dtrace.Distribution$Bucket[min = -65536, max = -32769, frequency = 46], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32768, max = -16385, frequency = 47], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16384, max = -8193, frequency = 48], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8192, max = -4097, frequency = 49], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4096, max = -2049, frequency = 50], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2048, max = -1025, frequency = 51], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1024, max = -513, frequency = 52], org.opensolaris.os.dtrace.Distribution$Bucket[min = -512, max = -257, frequency = 53], org.opensolaris.os.dtrace.Distribution$Bucket[min = -256, max = -129, frequency = 54], org.opensolaris.os.dtrace.Distribution$Bucket[min = -128, max = -65, frequency = 55], org.opensolaris.os.dtrace.Distribution$Bucket[min = -64, max = -33, frequency = 56], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32, max = -17, frequency = 57], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16, max = -9, frequency = 58], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8, max = -5, frequency = 59], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4, max = -3, frequency = 60], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2, max = -2, frequency = 61], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1, max = -1, frequency = 62], org.opensolaris.os.dtrace.Distribution$Bucket[min = 0, max = 0, frequency = 63], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 64], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 65], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 66], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 67], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 68], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 69], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 70], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 255, frequency = 71], org.opensolaris.os.dtrace.Distribution$Bucket[min = 256, max = 511, frequency = 72], org.opensolaris.os.dtrace.Distribution$Bucket[min = 512, max = 1023, frequency = 73], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1024, max = 2047, frequency = 74], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2048, max = 4095, frequency = 75], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4096, max = 8191, frequency = 76], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8192, max = 16383, frequency = 77], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16384, max = 32767, frequency = 78], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32768, max = 65535, frequency = 79], org.opensolaris.os.dtrace.Distribution$Bucket[min = 65536, max = 131071, frequency = 80], org.opensolaris.os.dtrace.Distribution$Bucket[min = 131072, max = 262143, frequency = 81], org.opensolaris.os.dtrace.Distribution$Bucket[min = 262144, max = 524287, frequency = 82], org.opensolaris.os.dtrace.Distribution$Bucket[min = 524288, max = 1048575, frequency = 83], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1048576, max = 2097151, frequency = 84], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2097152, max = 4194303, frequency = 85], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4194304, max = 8388607, frequency = 86], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8388608, max = 16777215, frequency = 87], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16777216, max = 33554431, frequency = 88], org.opensolaris.os.dtrace.Distribution$Bucket[min = 33554432, max = 67108863, frequency = 89], org.opensolaris.os.dtrace.Distribution$Bucket[min = 67108864, max = 134217727, frequency = 90], org.opensolaris.os.dtrace.Distribution$Bucket[min = 134217728, max = 268435455, frequency = 91], org.opensolaris.os.dtrace.Distribution$Bucket[min = 268435456, max = 536870911, frequency = 92], org.opensolaris.os.dtrace.Distribution$Bucket[min = 536870912, max = 1073741823, frequency = 93], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1073741824, max = 2147483647, frequency = 94], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2147483648, max = 4294967295, frequency = 95], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4294967296, max = 8589934591, frequency = 96], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8589934592, max = 17179869183, frequency = 97], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17179869184, max = 34359738367, frequency = 98], org.opensolaris.os.dtrace.Distribution$Bucket[min = 34359738368, max = 68719476735, frequency = 99], org.opensolaris.os.dtrace.Distribution$Bucket[min = 68719476736, max = 137438953471, frequency = 100], org.opensolaris.os.dtrace.Distribution$Bucket[min = 137438953472, max = 274877906943, frequency = 101], org.opensolaris.os.dtrace.Distribution$Bucket[min = 274877906944, max = 549755813887, frequency = 102], org.opensolaris.os.dtrace.Distribution$Bucket[min = 549755813888, max = 1099511627775, frequency = 103], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1099511627776, max = 2199023255551, frequency = 104], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2199023255552, max = 4398046511103, frequency = 105], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4398046511104, max = 8796093022207, frequency = 106], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8796093022208, max = 17592186044415, frequency = 107], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17592186044416, max = 35184372088831, frequency = 108], org.opensolaris.os.dtrace.Distribution$Bucket[min = 35184372088832, max = 70368744177663, frequency = 109], org.opensolaris.os.dtrace.Distribution$Bucket[min = 70368744177664, max = 140737488355327, frequency = 110], org.opensolaris.os.dtrace.Distribution$Bucket[min = 140737488355328, max = 281474976710655, frequency = 111], org.opensolaris.os.dtrace.Distribution$Bucket[min = 281474976710656, max = 562949953421311, frequency = 112], org.opensolaris.os.dtrace.Distribution$Bucket[min = 562949953421312, max = 1125899906842623, frequency = 113], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1125899906842624, max = 2251799813685247, frequency = 114], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2251799813685248, max = 4503599627370495, frequency = 115], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4503599627370496, max = 9007199254740991, frequency = 116], org.opensolaris.os.dtrace.Distribution$Bucket[min = 9007199254740992, max = 18014398509481983, frequency = 117], org.opensolaris.os.dtrace.Distribution$Bucket[min = 18014398509481984, max = 36028797018963967, frequency = 118], org.opensolaris.os.dtrace.Distribution$Bucket[min = 36028797018963968, max = 72057594037927935, frequency = 119], org.opensolaris.os.dtrace.Distribution$Bucket[min = 72057594037927936, max = 144115188075855871, frequency = 120], org.opensolaris.os.dtrace.Distribution$Bucket[min = 144115188075855872, max = 288230376151711743, frequency = 121], org.opensolaris.os.dtrace.Distribution$Bucket[min = 288230376151711744, max = 576460752303423487, frequency = 122], org.opensolaris.os.dtrace.Distribution$Bucket[min = 576460752303423488, max = 1152921504606846975, frequency = 123], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1152921504606846976, max = 2305843009213693951, frequency = 124], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2305843009213693952, max = 4611686018427387903, frequency = 125], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4611686018427387904, max = 9223372036854775807, frequency = 126]], total = 8001.0] +LogDistribution: + encoded: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -4611686018427387904, max = -2305843009213693953, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2305843009213693952, max = -1152921504606846977, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1152921504606846976, max = -576460752303423489, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = -576460752303423488, max = -288230376151711745, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = -288230376151711744, max = -144115188075855873, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = -144115188075855872, max = -72057594037927937, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = -72057594037927936, max = -36028797018963969, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = -36028797018963968, max = -18014398509481985, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = -18014398509481984, max = -9007199254740993, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = -9007199254740992, max = -4503599627370497, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4503599627370496, max = -2251799813685249, frequency = 10], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2251799813685248, max = -1125899906842625, frequency = 11], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1125899906842624, max = -562949953421313, frequency = 12], org.opensolaris.os.dtrace.Distribution$Bucket[min = -562949953421312, max = -281474976710657, frequency = 13], org.opensolaris.os.dtrace.Distribution$Bucket[min = -281474976710656, max = -140737488355329, frequency = 14], org.opensolaris.os.dtrace.Distribution$Bucket[min = -140737488355328, max = -70368744177665, frequency = 15], org.opensolaris.os.dtrace.Distribution$Bucket[min = -70368744177664, max = -35184372088833, frequency = 16], org.opensolaris.os.dtrace.Distribution$Bucket[min = -35184372088832, max = -17592186044417, frequency = 17], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17592186044416, max = -8796093022209, frequency = 18], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8796093022208, max = -4398046511105, frequency = 19], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4398046511104, max = -2199023255553, frequency = 20], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2199023255552, max = -1099511627777, frequency = 21], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1099511627776, max = -549755813889, frequency = 22], org.opensolaris.os.dtrace.Distribution$Bucket[min = -549755813888, max = -274877906945, frequency = 23], org.opensolaris.os.dtrace.Distribution$Bucket[min = -274877906944, max = -137438953473, frequency = 24], org.opensolaris.os.dtrace.Distribution$Bucket[min = -137438953472, max = -68719476737, frequency = 25], org.opensolaris.os.dtrace.Distribution$Bucket[min = -68719476736, max = -34359738369, frequency = 26], org.opensolaris.os.dtrace.Distribution$Bucket[min = -34359738368, max = -17179869185, frequency = 27], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17179869184, max = -8589934593, frequency = 28], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8589934592, max = -4294967297, frequency = 29], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4294967296, max = -2147483649, frequency = 30], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2147483648, max = -1073741825, frequency = 31], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1073741824, max = -536870913, frequency = 32], org.opensolaris.os.dtrace.Distribution$Bucket[min = -536870912, max = -268435457, frequency = 33], org.opensolaris.os.dtrace.Distribution$Bucket[min = -268435456, max = -134217729, frequency = 34], org.opensolaris.os.dtrace.Distribution$Bucket[min = -134217728, max = -67108865, frequency = 35], org.opensolaris.os.dtrace.Distribution$Bucket[min = -67108864, max = -33554433, frequency = 36], org.opensolaris.os.dtrace.Distribution$Bucket[min = -33554432, max = -16777217, frequency = 37], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16777216, max = -8388609, frequency = 38], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8388608, max = -4194305, frequency = 39], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4194304, max = -2097153, frequency = 40], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2097152, max = -1048577, frequency = 41], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1048576, max = -524289, frequency = 42], org.opensolaris.os.dtrace.Distribution$Bucket[min = -524288, max = -262145, frequency = 43], org.opensolaris.os.dtrace.Distribution$Bucket[min = -262144, max = -131073, frequency = 44], org.opensolaris.os.dtrace.Distribution$Bucket[min = -131072, max = -65537, frequency = 45], org.opensolaris.os.dtrace.Distribution$Bucket[min = -65536, max = -32769, frequency = 46], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32768, max = -16385, frequency = 47], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16384, max = -8193, frequency = 48], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8192, max = -4097, frequency = 49], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4096, max = -2049, frequency = 50], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2048, max = -1025, frequency = 51], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1024, max = -513, frequency = 52], org.opensolaris.os.dtrace.Distribution$Bucket[min = -512, max = -257, frequency = 53], org.opensolaris.os.dtrace.Distribution$Bucket[min = -256, max = -129, frequency = 54], org.opensolaris.os.dtrace.Distribution$Bucket[min = -128, max = -65, frequency = 55], org.opensolaris.os.dtrace.Distribution$Bucket[min = -64, max = -33, frequency = 56], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32, max = -17, frequency = 57], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16, max = -9, frequency = 58], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8, max = -5, frequency = 59], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4, max = -3, frequency = 60], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2, max = -2, frequency = 61], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1, max = -1, frequency = 62], org.opensolaris.os.dtrace.Distribution$Bucket[min = 0, max = 0, frequency = 63], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 64], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 65], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 66], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 67], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 68], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 69], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 70], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 255, frequency = 71], org.opensolaris.os.dtrace.Distribution$Bucket[min = 256, max = 511, frequency = 72], org.opensolaris.os.dtrace.Distribution$Bucket[min = 512, max = 1023, frequency = 73], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1024, max = 2047, frequency = 74], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2048, max = 4095, frequency = 75], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4096, max = 8191, frequency = 76], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8192, max = 16383, frequency = 77], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16384, max = 32767, frequency = 78], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32768, max = 65535, frequency = 79], org.opensolaris.os.dtrace.Distribution$Bucket[min = 65536, max = 131071, frequency = 80], org.opensolaris.os.dtrace.Distribution$Bucket[min = 131072, max = 262143, frequency = 81], org.opensolaris.os.dtrace.Distribution$Bucket[min = 262144, max = 524287, frequency = 82], org.opensolaris.os.dtrace.Distribution$Bucket[min = 524288, max = 1048575, frequency = 83], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1048576, max = 2097151, frequency = 84], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2097152, max = 4194303, frequency = 85], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4194304, max = 8388607, frequency = 86], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8388608, max = 16777215, frequency = 87], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16777216, max = 33554431, frequency = 88], org.opensolaris.os.dtrace.Distribution$Bucket[min = 33554432, max = 67108863, frequency = 89], org.opensolaris.os.dtrace.Distribution$Bucket[min = 67108864, max = 134217727, frequency = 90], org.opensolaris.os.dtrace.Distribution$Bucket[min = 134217728, max = 268435455, frequency = 91], org.opensolaris.os.dtrace.Distribution$Bucket[min = 268435456, max = 536870911, frequency = 92], org.opensolaris.os.dtrace.Distribution$Bucket[min = 536870912, max = 1073741823, frequency = 93], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1073741824, max = 2147483647, frequency = 94], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2147483648, max = 4294967295, frequency = 95], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4294967296, max = 8589934591, frequency = 96], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8589934592, max = 17179869183, frequency = 97], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17179869184, max = 34359738367, frequency = 98], org.opensolaris.os.dtrace.Distribution$Bucket[min = 34359738368, max = 68719476735, frequency = 99], org.opensolaris.os.dtrace.Distribution$Bucket[min = 68719476736, max = 137438953471, frequency = 100], org.opensolaris.os.dtrace.Distribution$Bucket[min = 137438953472, max = 274877906943, frequency = 101], org.opensolaris.os.dtrace.Distribution$Bucket[min = 274877906944, max = 549755813887, frequency = 102], org.opensolaris.os.dtrace.Distribution$Bucket[min = 549755813888, max = 1099511627775, frequency = 103], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1099511627776, max = 2199023255551, frequency = 104], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2199023255552, max = 4398046511103, frequency = 105], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4398046511104, max = 8796093022207, frequency = 106], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8796093022208, max = 17592186044415, frequency = 107], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17592186044416, max = 35184372088831, frequency = 108], org.opensolaris.os.dtrace.Distribution$Bucket[min = 35184372088832, max = 70368744177663, frequency = 109], org.opensolaris.os.dtrace.Distribution$Bucket[min = 70368744177664, max = 140737488355327, frequency = 110], org.opensolaris.os.dtrace.Distribution$Bucket[min = 140737488355328, max = 281474976710655, frequency = 111], org.opensolaris.os.dtrace.Distribution$Bucket[min = 281474976710656, max = 562949953421311, frequency = 112], org.opensolaris.os.dtrace.Distribution$Bucket[min = 562949953421312, max = 1125899906842623, frequency = 113], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1125899906842624, max = 2251799813685247, frequency = 114], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2251799813685248, max = 4503599627370495, frequency = 115], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4503599627370496, max = 9007199254740991, frequency = 116], org.opensolaris.os.dtrace.Distribution$Bucket[min = 9007199254740992, max = 18014398509481983, frequency = 117], org.opensolaris.os.dtrace.Distribution$Bucket[min = 18014398509481984, max = 36028797018963967, frequency = 118], org.opensolaris.os.dtrace.Distribution$Bucket[min = 36028797018963968, max = 72057594037927935, frequency = 119], org.opensolaris.os.dtrace.Distribution$Bucket[min = 72057594037927936, max = 144115188075855871, frequency = 120], org.opensolaris.os.dtrace.Distribution$Bucket[min = 144115188075855872, max = 288230376151711743, frequency = 121], org.opensolaris.os.dtrace.Distribution$Bucket[min = 288230376151711744, max = 576460752303423487, frequency = 122], org.opensolaris.os.dtrace.Distribution$Bucket[min = 576460752303423488, max = 1152921504606846975, frequency = 123], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1152921504606846976, max = 2305843009213693951, frequency = 124], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2305843009213693952, max = 4611686018427387903, frequency = 125], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4611686018427387904, max = 9223372036854775807, frequency = 126]], total = 8001.0] + decoded: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -4611686018427387904, max = -2305843009213693953, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2305843009213693952, max = -1152921504606846977, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1152921504606846976, max = -576460752303423489, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = -576460752303423488, max = -288230376151711745, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = -288230376151711744, max = -144115188075855873, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = -144115188075855872, max = -72057594037927937, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = -72057594037927936, max = -36028797018963969, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = -36028797018963968, max = -18014398509481985, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = -18014398509481984, max = -9007199254740993, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = -9007199254740992, max = -4503599627370497, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4503599627370496, max = -2251799813685249, frequency = 10], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2251799813685248, max = -1125899906842625, frequency = 11], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1125899906842624, max = -562949953421313, frequency = 12], org.opensolaris.os.dtrace.Distribution$Bucket[min = -562949953421312, max = -281474976710657, frequency = 13], org.opensolaris.os.dtrace.Distribution$Bucket[min = -281474976710656, max = -140737488355329, frequency = 14], org.opensolaris.os.dtrace.Distribution$Bucket[min = -140737488355328, max = -70368744177665, frequency = 15], org.opensolaris.os.dtrace.Distribution$Bucket[min = -70368744177664, max = -35184372088833, frequency = 16], org.opensolaris.os.dtrace.Distribution$Bucket[min = -35184372088832, max = -17592186044417, frequency = 17], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17592186044416, max = -8796093022209, frequency = 18], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8796093022208, max = -4398046511105, frequency = 19], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4398046511104, max = -2199023255553, frequency = 20], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2199023255552, max = -1099511627777, frequency = 21], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1099511627776, max = -549755813889, frequency = 22], org.opensolaris.os.dtrace.Distribution$Bucket[min = -549755813888, max = -274877906945, frequency = 23], org.opensolaris.os.dtrace.Distribution$Bucket[min = -274877906944, max = -137438953473, frequency = 24], org.opensolaris.os.dtrace.Distribution$Bucket[min = -137438953472, max = -68719476737, frequency = 25], org.opensolaris.os.dtrace.Distribution$Bucket[min = -68719476736, max = -34359738369, frequency = 26], org.opensolaris.os.dtrace.Distribution$Bucket[min = -34359738368, max = -17179869185, frequency = 27], org.opensolaris.os.dtrace.Distribution$Bucket[min = -17179869184, max = -8589934593, frequency = 28], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8589934592, max = -4294967297, frequency = 29], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4294967296, max = -2147483649, frequency = 30], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2147483648, max = -1073741825, frequency = 31], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1073741824, max = -536870913, frequency = 32], org.opensolaris.os.dtrace.Distribution$Bucket[min = -536870912, max = -268435457, frequency = 33], org.opensolaris.os.dtrace.Distribution$Bucket[min = -268435456, max = -134217729, frequency = 34], org.opensolaris.os.dtrace.Distribution$Bucket[min = -134217728, max = -67108865, frequency = 35], org.opensolaris.os.dtrace.Distribution$Bucket[min = -67108864, max = -33554433, frequency = 36], org.opensolaris.os.dtrace.Distribution$Bucket[min = -33554432, max = -16777217, frequency = 37], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16777216, max = -8388609, frequency = 38], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8388608, max = -4194305, frequency = 39], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4194304, max = -2097153, frequency = 40], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2097152, max = -1048577, frequency = 41], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1048576, max = -524289, frequency = 42], org.opensolaris.os.dtrace.Distribution$Bucket[min = -524288, max = -262145, frequency = 43], org.opensolaris.os.dtrace.Distribution$Bucket[min = -262144, max = -131073, frequency = 44], org.opensolaris.os.dtrace.Distribution$Bucket[min = -131072, max = -65537, frequency = 45], org.opensolaris.os.dtrace.Distribution$Bucket[min = -65536, max = -32769, frequency = 46], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32768, max = -16385, frequency = 47], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16384, max = -8193, frequency = 48], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8192, max = -4097, frequency = 49], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4096, max = -2049, frequency = 50], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2048, max = -1025, frequency = 51], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1024, max = -513, frequency = 52], org.opensolaris.os.dtrace.Distribution$Bucket[min = -512, max = -257, frequency = 53], org.opensolaris.os.dtrace.Distribution$Bucket[min = -256, max = -129, frequency = 54], org.opensolaris.os.dtrace.Distribution$Bucket[min = -128, max = -65, frequency = 55], org.opensolaris.os.dtrace.Distribution$Bucket[min = -64, max = -33, frequency = 56], org.opensolaris.os.dtrace.Distribution$Bucket[min = -32, max = -17, frequency = 57], org.opensolaris.os.dtrace.Distribution$Bucket[min = -16, max = -9, frequency = 58], org.opensolaris.os.dtrace.Distribution$Bucket[min = -8, max = -5, frequency = 59], org.opensolaris.os.dtrace.Distribution$Bucket[min = -4, max = -3, frequency = 60], org.opensolaris.os.dtrace.Distribution$Bucket[min = -2, max = -2, frequency = 61], org.opensolaris.os.dtrace.Distribution$Bucket[min = -1, max = -1, frequency = 62], org.opensolaris.os.dtrace.Distribution$Bucket[min = 0, max = 0, frequency = 63], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 64], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 65], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 66], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 67], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 68], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 69], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 70], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 255, frequency = 71], org.opensolaris.os.dtrace.Distribution$Bucket[min = 256, max = 511, frequency = 72], org.opensolaris.os.dtrace.Distribution$Bucket[min = 512, max = 1023, frequency = 73], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1024, max = 2047, frequency = 74], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2048, max = 4095, frequency = 75], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4096, max = 8191, frequency = 76], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8192, max = 16383, frequency = 77], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16384, max = 32767, frequency = 78], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32768, max = 65535, frequency = 79], org.opensolaris.os.dtrace.Distribution$Bucket[min = 65536, max = 131071, frequency = 80], org.opensolaris.os.dtrace.Distribution$Bucket[min = 131072, max = 262143, frequency = 81], org.opensolaris.os.dtrace.Distribution$Bucket[min = 262144, max = 524287, frequency = 82], org.opensolaris.os.dtrace.Distribution$Bucket[min = 524288, max = 1048575, frequency = 83], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1048576, max = 2097151, frequency = 84], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2097152, max = 4194303, frequency = 85], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4194304, max = 8388607, frequency = 86], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8388608, max = 16777215, frequency = 87], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16777216, max = 33554431, frequency = 88], org.opensolaris.os.dtrace.Distribution$Bucket[min = 33554432, max = 67108863, frequency = 89], org.opensolaris.os.dtrace.Distribution$Bucket[min = 67108864, max = 134217727, frequency = 90], org.opensolaris.os.dtrace.Distribution$Bucket[min = 134217728, max = 268435455, frequency = 91], org.opensolaris.os.dtrace.Distribution$Bucket[min = 268435456, max = 536870911, frequency = 92], org.opensolaris.os.dtrace.Distribution$Bucket[min = 536870912, max = 1073741823, frequency = 93], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1073741824, max = 2147483647, frequency = 94], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2147483648, max = 4294967295, frequency = 95], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4294967296, max = 8589934591, frequency = 96], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8589934592, max = 17179869183, frequency = 97], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17179869184, max = 34359738367, frequency = 98], org.opensolaris.os.dtrace.Distribution$Bucket[min = 34359738368, max = 68719476735, frequency = 99], org.opensolaris.os.dtrace.Distribution$Bucket[min = 68719476736, max = 137438953471, frequency = 100], org.opensolaris.os.dtrace.Distribution$Bucket[min = 137438953472, max = 274877906943, frequency = 101], org.opensolaris.os.dtrace.Distribution$Bucket[min = 274877906944, max = 549755813887, frequency = 102], org.opensolaris.os.dtrace.Distribution$Bucket[min = 549755813888, max = 1099511627775, frequency = 103], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1099511627776, max = 2199023255551, frequency = 104], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2199023255552, max = 4398046511103, frequency = 105], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4398046511104, max = 8796093022207, frequency = 106], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8796093022208, max = 17592186044415, frequency = 107], org.opensolaris.os.dtrace.Distribution$Bucket[min = 17592186044416, max = 35184372088831, frequency = 108], org.opensolaris.os.dtrace.Distribution$Bucket[min = 35184372088832, max = 70368744177663, frequency = 109], org.opensolaris.os.dtrace.Distribution$Bucket[min = 70368744177664, max = 140737488355327, frequency = 110], org.opensolaris.os.dtrace.Distribution$Bucket[min = 140737488355328, max = 281474976710655, frequency = 111], org.opensolaris.os.dtrace.Distribution$Bucket[min = 281474976710656, max = 562949953421311, frequency = 112], org.opensolaris.os.dtrace.Distribution$Bucket[min = 562949953421312, max = 1125899906842623, frequency = 113], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1125899906842624, max = 2251799813685247, frequency = 114], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2251799813685248, max = 4503599627370495, frequency = 115], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4503599627370496, max = 9007199254740991, frequency = 116], org.opensolaris.os.dtrace.Distribution$Bucket[min = 9007199254740992, max = 18014398509481983, frequency = 117], org.opensolaris.os.dtrace.Distribution$Bucket[min = 18014398509481984, max = 36028797018963967, frequency = 118], org.opensolaris.os.dtrace.Distribution$Bucket[min = 36028797018963968, max = 72057594037927935, frequency = 119], org.opensolaris.os.dtrace.Distribution$Bucket[min = 72057594037927936, max = 144115188075855871, frequency = 120], org.opensolaris.os.dtrace.Distribution$Bucket[min = 144115188075855872, max = 288230376151711743, frequency = 121], org.opensolaris.os.dtrace.Distribution$Bucket[min = 288230376151711744, max = 576460752303423487, frequency = 122], org.opensolaris.os.dtrace.Distribution$Bucket[min = 576460752303423488, max = 1152921504606846975, frequency = 123], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1152921504606846976, max = 2305843009213693951, frequency = 124], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2305843009213693952, max = 4611686018427387903, frequency = 125], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4611686018427387904, max = 9223372036854775807, frequency = 126]], total = 8001.0] +LinearDistribution: + serialized: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0] + deserialized: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0] +LinearDistribution: + encoded: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0] + decoded: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0] +Option: + serialized: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s] + deserialized: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s] +Option: + encoded: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s] + decoded: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s] +ProcessState: + serialized: org.opensolaris.os.dtrace.ProcessState[pid = 123456, state = UNDEAD, terminationSignal = 3, terminationSignalName = SIGSTOP, exitStatus = -2, message = Process stopped on dime] + deserialized: org.opensolaris.os.dtrace.ProcessState[pid = 123456, state = UNDEAD, terminationSignal = 3, terminationSignalName = SIGSTOP, exitStatus = -2, message = Process stopped on dime] +ProcessState: + encoded: org.opensolaris.os.dtrace.ProcessState[pid = 123456, state = UNDEAD, terminationSignal = 3, terminationSignalName = SIGSTOP, exitStatus = -2, message = Process stopped on dime] + decoded: org.opensolaris.os.dtrace.ProcessState[pid = 123456, state = UNDEAD, terminationSignal = 3, terminationSignalName = SIGSTOP, exitStatus = -2, message = Process stopped on dime] +ProbeDescription: + serialized: syscall::malloc:entry + deserialized: syscall::malloc:entry +ProbeDescription: + encoded: syscall::malloc:entry + decoded: syscall::malloc:entry +PrintaRecord: + serialized: org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]]], formattedStrings = {[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!]=cat, [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]=cat}, tuples = [[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]], output = Yes, this is the formatted printa() output] + deserialized: org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]]], formattedStrings = {[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!]=cat, [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]=cat}, tuples = [[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]], output = Yes, this is the formatted printa() output] +PrintaRecord: + encoded: org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]]], formattedStrings = {[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!]=cat, [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]=cat}, tuples = [[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]], output = Yes, this is the formatted printa() output] + decoded: org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]]], formattedStrings = {[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!]=cat, [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]=cat}, tuples = [[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]], output = Yes, this is the formatted printa() output] +PrintfRecord: + serialized: long formatted string + deserialized: long formatted string +PrintfRecord: + encoded: long formatted string + decoded: long formatted string +ProbeData: + serialized: org.opensolaris.os.dtrace.ProbeData[epid = 7, cpu = 1, enabledProbeDescription = syscall::malloc:entry, flow = org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3], records = [org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]]], formattedStrings = {[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!]=cat, [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]=cat}, tuples = [[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]], output = Yes, this is the formatted printa() output], long formatted string, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, mod`func+0x4, + process ID: 123456 + User Stack Frame 1 + User Stack Frame 2 + User Stack Frame 3 +, 1]] + deserialized: org.opensolaris.os.dtrace.ProbeData[epid = 7, cpu = 1, enabledProbeDescription = syscall::malloc:entry, flow = org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3], records = [org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]]], formattedStrings = {[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!]=cat, [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]=cat}, tuples = [[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]], output = Yes, this is the formatted printa() output], long formatted string, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, mod`func+0x4, + process ID: 123456 + User Stack Frame 1 + User Stack Frame 2 + User Stack Frame 3 +, 1]] +ProbeData: + encoded: org.opensolaris.os.dtrace.ProbeData[epid = 7, cpu = 1, enabledProbeDescription = syscall::malloc:entry, flow = org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3], records = [org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]]], formattedStrings = {[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!]=cat, [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]=cat}, tuples = [[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]], output = Yes, this is the formatted printa() output], long formatted string, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, mod`func+0x4, + process ID: 123456 + User Stack Frame 1 + User Stack Frame 2 + User Stack Frame 3 +, 1]] + decoded: org.opensolaris.os.dtrace.ProbeData[epid = 7, cpu = 1, enabledProbeDescription = syscall::malloc:entry, flow = org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3], records = [org.opensolaris.os.dtrace.PrintaRecord[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]]], formattedStrings = {[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!]=cat, [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]=cat}, tuples = [[ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +]], output = Yes, this is the formatted printa() output], long formatted string, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, mod`func+0x4, + process ID: 123456 + User Stack Frame 1 + User Stack Frame 2 + User Stack Frame 3 +, 1]] +Aggregate: + serialized: org.opensolaris.os.dtrace.Aggregate[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = times, id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, dog, mouse, mouse, 67, 7], value = 9]]]] + deserialized: org.opensolaris.os.dtrace.Aggregate[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = times, id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, dog, mouse, mouse, 67, 7], value = 9]]]] +Aggregate: + encoded: org.opensolaris.os.dtrace.Aggregate[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = times, id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, dog, mouse, mouse, 67, 7], value = 9]]]] + decoded: org.opensolaris.os.dtrace.Aggregate[snaptime = 1234567890, aggregations = [org.opensolaris.os.dtrace.Aggregation[name = counts, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +, shebang!], value = class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]], org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, 9, + has + nine + lives +, + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 1 2 3 ... +], value = 7]], org.opensolaris.os.dtrace.Aggregation[name = times, id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [cat, dog, mouse, mouse, 67, 7], value = 9]]]] +UserStackRecord: + serialized: + process ID: 123456 + User Stack Frame 1 + User Stack Frame 2 + User Stack Frame 3 + + deserialized: + process ID: 123456 + User Stack Frame 1 + User Stack Frame 2 + User Stack Frame 3 + +UserStackRecord: + encoded: + process ID: 123456 + User Stack Frame 1 + User Stack Frame 2 + User Stack Frame 3 + + decoded: + process ID: 123456 + User Stack Frame 1 + User Stack Frame 2 + User Stack Frame 3 + +AvgValue: + serialized: 5 + deserialized: 5 +AvgValue: + encoded: 5 + decoded: 5 +CountValue: + serialized: 9 + deserialized: 9 +CountValue: + encoded: 9 + decoded: 9 +SumValue: + serialized: 25 + deserialized: 25 +SumValue: + encoded: 25 + decoded: 25 +MinValue: + serialized: 101 + deserialized: 101 +MinValue: + encoded: 101 + decoded: 101 +MaxValue: + serialized: 101 + deserialized: 101 +MaxValue: + encoded: 101 + decoded: 101 +Error: + serialized: org.opensolaris.os.dtrace.Error[probeDescription = syscall::malloc:entry, epid = 8, cpu = 3, action = 1, offset = 20, fault = DTRACEFLT_BADALIGN, address = -1, defaultMessage = error on enabled probe ID 8 (ID 256: syscall::malloc:entry): Bad alignment (0x33ef) in action #1 at DIF offset 20] + deserialized: org.opensolaris.os.dtrace.Error[probeDescription = syscall::malloc:entry, epid = 8, cpu = 3, action = 1, offset = 20, fault = DTRACEFLT_BADALIGN, address = -1, defaultMessage = error on enabled probe ID 8 (ID 256: syscall::malloc:entry): Bad alignment (0x33ef) in action #1 at DIF offset 20] +Error: + encoded: org.opensolaris.os.dtrace.Error[probeDescription = syscall::malloc:entry, epid = 8, cpu = 3, action = 1, offset = 20, fault = DTRACEFLT_BADALIGN, address = -1, defaultMessage = error on enabled probe ID 8 (ID 256: syscall::malloc:entry): Bad alignment (0x33ef) in action #1 at DIF offset 20] + decoded: org.opensolaris.os.dtrace.Error[probeDescription = syscall::malloc:entry, epid = 8, cpu = 3, action = 1, offset = 20, fault = DTRACEFLT_BADALIGN, address = -1, defaultMessage = error on enabled probe ID 8 (ID 256: syscall::malloc:entry): Bad alignment (0x33ef) in action #1 at DIF offset 20] +Drop: + serialized: org.opensolaris.os.dtrace.Drop[cpu = 2, kind = Speculation (busy), count = 72, total = 1041, defaultMessage = Guess we dropped stuff all over the place.] + deserialized: org.opensolaris.os.dtrace.Drop[cpu = 2, kind = Speculation (busy), count = 72, total = 1041, defaultMessage = Guess we dropped stuff all over the place.] +Drop: + encoded: org.opensolaris.os.dtrace.Drop[cpu = 2, kind = Speculation (busy), count = 72, total = 1041, defaultMessage = Guess we dropped stuff all over the place.] + decoded: org.opensolaris.os.dtrace.Drop[cpu = 2, kind = Speculation (busy), count = 72, total = 1041, defaultMessage = Guess we dropped stuff all over the place.] +InterfaceAttributes: + serialized: Unstable / Evolving / ISA + deserialized: Unstable / Evolving / ISA +InterfaceAttributes: + encoded: Unstable / Evolving / ISA + decoded: Unstable / Evolving / ISA +ProgramInfo: + serialized: org.opensolaris.os.dtrace.ProgramInfo[minimumProbeAttributes = Unstable / Evolving / ISA, minimumStatementAttributes = Unstable / Evolving / ISA, matchingProbeCount = 256] + deserialized: org.opensolaris.os.dtrace.ProgramInfo[minimumProbeAttributes = Unstable / Evolving / ISA, minimumStatementAttributes = Unstable / Evolving / ISA, matchingProbeCount = 256] +ProgramInfo: + encoded: org.opensolaris.os.dtrace.ProgramInfo[minimumProbeAttributes = Unstable / Evolving / ISA, minimumStatementAttributes = Unstable / Evolving / ISA, matchingProbeCount = 256] + decoded: org.opensolaris.os.dtrace.ProgramInfo[minimumProbeAttributes = Unstable / Evolving / ISA, minimumStatementAttributes = Unstable / Evolving / ISA, matchingProbeCount = 256] +ProbeInfo: + serialized: org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA] + deserialized: org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA] +ProbeInfo: + encoded: org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA] + decoded: org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA] +Probe: + serialized: org.opensolaris.os.dtrace.Probe[description = syscall::malloc:entry, info = org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]] + deserialized: org.opensolaris.os.dtrace.Probe[description = syscall::malloc:entry, info = org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]] +Probe: + encoded: org.opensolaris.os.dtrace.Probe[description = syscall::malloc:entry, info = org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]] + decoded: org.opensolaris.os.dtrace.Probe[description = syscall::malloc:entry, info = org.opensolaris.os.dtrace.ProbeInfo[probeAttributes = Unstable / Evolving / ISA, argumentAttributes = Unstable / Evolving / ISA]] +Flow: + serialized: org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3] + deserialized: org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3] +Flow: + encoded: org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3] + decoded: org.opensolaris.os.dtrace.Flow[kind = RETURN, depth = 3] +KernelSymbolRecord: + serialized: mod`func+0x4 + deserialized: mod`func+0x4 +KernelSymbolRecord: + encoded: mod`func+0x4 + decoded: mod`func+0x4 +UserSymbolRecord: + serialized: mod`func+0x4 + deserialized: mod`func+0x4 +UserSymbolRecord: + encoded: mod`func+0x4 + decoded: mod`func+0x4 +UserSymbolRecord$Value: + serialized: org.opensolaris.os.dtrace.UserSymbolRecord$Value[processID = 7, address = -1] + deserialized: org.opensolaris.os.dtrace.UserSymbolRecord$Value[processID = 7, address = -1] +UserSymbolRecord$Value: + encoded: org.opensolaris.os.dtrace.UserSymbolRecord$Value[processID = 7, address = -1] + decoded: org.opensolaris.os.dtrace.UserSymbolRecord$Value[processID = 7, address = -1] +Program: + serialized: org.opensolaris.os.dtrace.Program[contents = syscall:::entry { @[execname] = count(); }, info = null] + deserialized: org.opensolaris.os.dtrace.Program[contents = syscall:::entry { @[execname] = count(); }, info = null] +Program$File: + serialized: org.opensolaris.os.dtrace.Program$File[super = org.opensolaris.os.dtrace.Program[contents = syscall:::entry { @[execname] = count(); }, info = null], file = TestBean.out] + deserialized: org.opensolaris.os.dtrace.Program$File[super = org.opensolaris.os.dtrace.Program[contents = syscall:::entry { @[execname] = count(); }, info = null], file = TestBean.out] +StddevValue: + serialized: 37 + deserialized: 37 +StddevValue: + encoded: 37 + decoded: 37 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh new file mode 100755 index 00000000..299755c6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh @@ -0,0 +1,38 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Fixed bug 6419880 close() hangs running consumer. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestClose diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh.out new file mode 100644 index 00000000..628d7870 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Close.ksh.out @@ -0,0 +1 @@ +Successful diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh new file mode 100755 index 00000000..a03de953 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh @@ -0,0 +1,38 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Fixed bug 6521523 aggregation drops can hang the Java DTrace API. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestDrop 3 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh.out new file mode 100644 index 00000000..266c4d46 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Drop.ksh.out @@ -0,0 +1 @@ +Lock released diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh new file mode 100755 index 00000000..df1c11f0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh @@ -0,0 +1,40 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Consumer enable() correctly handles multiple programs, +# recognizing programs that have already been enabled or that were +# compiled by another consumer. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestEnable diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh.out new file mode 100644 index 00000000..a13fb709 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.Enable.ksh.out @@ -0,0 +1,6 @@ +java.lang.IllegalStateException: Not all compiled probes are enabled. Compiled description dtrace:::END not enabled. +java.lang.IllegalStateException: program already enabled +java.lang.IllegalStateException: program already enabled +java.lang.IllegalStateException: Not all compiled probes are enabled. Compiled description syscall:::return not enabled. +java.lang.IllegalStateException: program already enabled +java.lang.IllegalArgumentException: program not compiled by this consumer diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c new file mode 100644 index 00000000..0e6291f6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <stdio.h> + +typedef void f(int x); + +static void +f1(int i) +{ + printf("%d\n", i); +} + +static void +f2(f func, int i) +{ + func(i); +} + +int +main() +{ + f2(f1, 3); + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh new file mode 100755 index 00000000..e1ffbdfa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh @@ -0,0 +1,39 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Fixed bug 6413280 lookupKernelFunction() and +# lookupUserFunction() truncate last character. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestFunctionLookup ./tst.FunctionLookup.exe diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh.out new file mode 100644 index 00000000..d42e9b59 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh.out @@ -0,0 +1,3 @@ +genunix`cv_wakeup +3 +tst.FunctionLookup.exe`f1 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.GetAggregate.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.GetAggregate.ksh new file mode 100755 index 00000000..2fdd5a9e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.GetAggregate.ksh @@ -0,0 +1,36 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +############################################################################ +# ASSERTION: +# getAggregate() can explicitly specify the anonymous aggregation +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestGetAggregate diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh new file mode 100755 index 00000000..992fcb5e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh @@ -0,0 +1,47 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Fixed bug 6506495 -DJAVA_DTRACE_MAX_CONSUMERS=N for any N < 8 is +# treated as if it were 8. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestMaxConsumers +java -DJAVA_DTRACE_MAX_CONSUMERS=-1 -cp test.jar TestMaxConsumers +java -DJAVA_DTRACE_MAX_CONSUMERS=0 -cp test.jar TestMaxConsumers +java -DJAVA_DTRACE_MAX_CONSUMERS=1 -cp test.jar TestMaxConsumers +java -DJAVA_DTRACE_MAX_CONSUMERS=2 -cp test.jar TestMaxConsumers +java -DJAVA_DTRACE_MAX_CONSUMERS=7 -cp test.jar TestMaxConsumers +java -DJAVA_DTRACE_MAX_CONSUMERS=8 -cp test.jar TestMaxConsumers +java -DJAVA_DTRACE_MAX_CONSUMERS=9 -cp test.jar TestMaxConsumers +java -DJAVA_DTRACE_MAX_CONSUMERS=19 -cp test.jar TestMaxConsumers diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh.out new file mode 100644 index 00000000..f68fc4ea --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MaxConsumers.ksh.out @@ -0,0 +1,17 @@ +Success +JAVA_DTRACE_MAX_CONSUMERS=-1 +Success +JAVA_DTRACE_MAX_CONSUMERS=0 +Success +JAVA_DTRACE_MAX_CONSUMERS=1 +Success +JAVA_DTRACE_MAX_CONSUMERS=2 +Success +JAVA_DTRACE_MAX_CONSUMERS=7 +Success +JAVA_DTRACE_MAX_CONSUMERS=8 +Success +JAVA_DTRACE_MAX_CONSUMERS=9 +Success +JAVA_DTRACE_MAX_CONSUMERS=19 +Success diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh new file mode 100755 index 00000000..6bb864a6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh @@ -0,0 +1,38 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Regression for multi-aggregation printa() corner cases. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestMultiAggPrinta tst.printa.d diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh.out new file mode 100644 index 00000000..8b8fd6ef --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.MultiAggPrinta.ksh.out @@ -0,0 +1,78 @@ +org.opensolaris.os.dtrace.ProbeData[epid = 1, enabledProbeDescription = dtrace:::BEGIN, flow = null, records = [org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = , id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 1]]], formattedStrings = {[]= + 1 +}, tuples = [[]], output = + 1 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = , id = 1, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 1]]], formattedStrings = {[]=count: 1 +}, tuples = [[]], output = count: 1 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {[]= }, tuples = [[]], output = ], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3]]], formattedStrings = {[1, 3]= + 1 3 3 +, [1, 2]= 1 2 1 +}, tuples = [[1, 3], [1, 2]], output = + 1 3 3 + 1 2 1 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]= + 2 3 0 4 +, [1, 3]= 1 3 3 0 +, [1, 2]= 1 2 1 2 +}, tuples = [[2, 3], [1, 2], [1, 3]], output = + 2 3 0 4 + 1 2 1 2 + 1 3 3 0 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = c, id = 4, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 3]], org.opensolaris.os.dtrace.Aggregation[name = d, id = 5, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 4]]], formattedStrings = {[]=3 4 +}, tuples = [[]], output = 3 4 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = c, id = 4, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 3]], org.opensolaris.os.dtrace.Aggregation[name = d, id = 5, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 4]]], formattedStrings = {[]=3 4 +}, tuples = [[]], output = 3 4 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = c, id = 4, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [], value = 3]]], formattedStrings = {[]=3 +}, tuples = [[]], output = 3 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=[2, 3] 0 4 +, [1, 3]=[1, 3] 3 0 +, [1, 2]=[1, 2] 1 2 +}, tuples = [[2, 3], [1, 2], [1, 3]], output = [2, 3] 0 4 +[1, 2] 1 2 +[1, 3] 3 0 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=[2, 3] 0 4 +, [1, 3]=[1, 3] 3 0 +, [1, 2]=[1, 2] 1 2 +}, tuples = [[2, 3], [1, 3], [1, 2]], output = [2, 3] 0 4 +[1, 3] 3 0 +[1, 2] 1 2 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=[2, 3] 0 4 +, [1, 3]=[1, 3] 3 0 +, [1, 2]=[1, 2] 1 2 +}, tuples = [[2, 3], [1, 3], [1, 2]], output = [2, 3] 0 4 +[1, 3] 3 0 +[1, 2] 1 2 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=0 4 [2, 3] +, [1, 3]=3 0 [1, 3] +, [1, 2]=1 2 [1, 2] +}, tuples = [[2, 3], [1, 3], [1, 2]], output = 0 4 [2, 3] +3 0 [1, 3] +1 2 [1, 2] +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {[2, 3]=[2, 3] +, [1, 3]=[1, 3] +, [1, 2]=[1, 2] +}, tuples = [[2, 3], [1, 3], [1, 2]], output = [2, 3] +[1, 3] +[1, 2] +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {}, tuples = [], output = [2] +[1] +[1] +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {}, tuples = [], output = [2] 0 4 +[1] 3 0 +[1] 1 2 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {}, tuples = [], output = 0 4 +3 0 +1 2 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {}, tuples = [], output = 0 4 4 +3 0 0 +1 2 2 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [], formattedStrings = {}, tuples = [], output = [2] 0 4 4 +[1] 3 0 0 +[1] 1 2 2 +], org.opensolaris.os.dtrace.PrintaRecord[aggregations = [org.opensolaris.os.dtrace.Aggregation[name = a, id = 2, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 1], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 3], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 0]], org.opensolaris.os.dtrace.Aggregation[name = b, id = 3, records = [org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 2], value = 2], org.opensolaris.os.dtrace.AggregationRecord[tuple = [1, 3], value = 0], org.opensolaris.os.dtrace.AggregationRecord[tuple = [2, 3], value = 4]]], formattedStrings = {[2, 3]=[2, 3] 0 4 4 +, [1, 3]=[1, 3] 3 0 0 +, [1, 2]=[1, 2] 1 2 2 +}, tuples = [[2, 3], [1, 3], [1, 2]], output = [2, 3] 0 4 4 +[1, 3] 3 0 0 +[1, 2] 1 2 2 +], 0] diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c new file mode 100644 index 00000000..0833912a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c @@ -0,0 +1,93 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +typedef void f(char *); + +static void +f_a(char *a) +{ +} + +static void +f_b(char *a) +{ +} + +static void +f_c(char *a) +{ +} + +static void +f_d(char *a) +{ +} + +static void +f_e(char *a) +{ +} + +static void +fN(f func, char *a, int i) +{ + func(a); +} + +static void +fN2(f func, char *a, int i) +{ + func(a); +} + +int +main() +{ + /* + * Avoid length of 1, 2, 4, or 8 bytes so DTrace will treat the data as + * a byte array. + */ + char a[] = {(char)-7, (char)201, (char)0, (char)0, (char)28, (char)1}; + char b[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)0}; + char c[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)1}; + char d[] = {(char)-7, (char)201, (char)0, (char)0, (char)29, (char)0}; + char e[] = {(char)84, (char)69, (char)0, (char)0, (char)28, (char)0}; + + fN(f_a, a, 1); + fN(f_b, b, 0); + fN(f_d, d, 102); + fN2(f_e, e, -2); + fN(f_c, c, 0); + fN(f_a, a, -1); + fN(f_d, d, 101); + fN(f_e, e, -2); + fN(f_e, e, 2); + fN2(f_e, e, 2); + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh new file mode 100755 index 00000000..97f49454 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh @@ -0,0 +1,38 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# ProbeData instances sort as expected with multiple enabled probe +# IDs and multiple records including byte array (sorted as +# unsigned bytes), stand-alone ufunc() action, and signed integer. +# +############################################################################ + +java -cp test.jar TestProbeData ./tst.ProbeData.exe diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh.out new file mode 100644 index 00000000..6789514f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.ksh.out @@ -0,0 +1,50 @@ +[probe 1 pid$target:tst.ProbeData.exe:fN:entry [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 54 45 0 0 1c 0 TE.... +, tst.ProbeData.exe`f_b , 0]] + +[probe 1 pid$target:tst.ProbeData.exe:fN:entry [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 54 45 0 0 1c 0 TE.... +, tst.ProbeData.exe`f_e , -2]] + +[probe 2 pid$target:tst.ProbeData.exe:fN2:entry [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 54 45 0 0 1c 0 TE.... +, tst.ProbeData.exe`f_e , -2]] + +[probe 1 pid$target:tst.ProbeData.exe:fN:entry [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 54 45 0 0 1c 0 TE.... +, tst.ProbeData.exe`f_e , 2]] + +[probe 2 pid$target:tst.ProbeData.exe:fN2:entry [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 54 45 0 0 1c 0 TE.... +, tst.ProbeData.exe`f_e , 2]] + +[probe 1 pid$target:tst.ProbeData.exe:fN:entry [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: 54 45 0 0 1c 1 TE.... +, tst.ProbeData.exe`f_c , 0]] + +[probe 1 pid$target:tst.ProbeData.exe:fN:entry [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: f9 c9 0 0 1c 1 ...... +, tst.ProbeData.exe`f_a , -1]] + +[probe 1 pid$target:tst.ProbeData.exe:fN:entry [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: f9 c9 0 0 1c 1 ...... +, tst.ProbeData.exe`f_a , 1]] + +[probe 1 pid$target:tst.ProbeData.exe:fN:entry [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: f9 c9 0 0 1d 0 ...... +, tst.ProbeData.exe`f_d , 101]] + +[probe 1 pid$target:tst.ProbeData.exe:fN:entry [ + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef + 0: f9 c9 0 0 1d 0 ...... +, tst.ProbeData.exe`f_d , 102]] + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh new file mode 100755 index 00000000..bee1cca6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh @@ -0,0 +1,45 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# ProbeDescription constructors function as expected. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestProbeDescription syscall:::entry +java -cp test.jar TestProbeDescription BEGIN +java -cp test.jar TestProbeDescription isdigit entry +java -cp test.jar TestProbeDescription genunix isdigit entry +java -cp test.jar TestProbeDescription fbt genunix isdigit entry +java -cp test.jar TestProbeDescription fbt:genunix:isdigit:entry +java -cp test.jar TestProbeDescription syscall::entry +java -cp test.jar TestProbeDescription syscall:entry diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh.out new file mode 100644 index 00000000..326018a5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.ProbeDescription.ksh.out @@ -0,0 +1,8 @@ +syscall:::entry +:::BEGIN +::isdigit:entry +:genunix:isdigit:entry +fbt:genunix:isdigit:entry +fbt:genunix:isdigit:entry +:syscall::entry +::syscall:entry diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh new file mode 100755 index 00000000..638ce7ac --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh @@ -0,0 +1,40 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Consumer state machine prevents illegal calls, allows legal +# ones; consumer behaves predictably when methods called out of +# order. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestStateMachine diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh.out new file mode 100644 index 00000000..5ddb528f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StateMachine.ksh.out @@ -0,0 +1,70 @@ +before open +open: false +enabled: false +closed: false +java.lang.IllegalStateException: consumer not open +java.lang.IllegalStateException: consumer not open +java.lang.IllegalStateException: consumer not open +java.lang.IllegalStateException: consumer not open +java.lang.IllegalStateException: consumer not open +java.lang.IllegalStateException: consumer not open +java.lang.IllegalStateException: consumer not open +java.lang.IllegalStateException: consumer not open +java.lang.IllegalStateException: consumer not open +before compile +open: true +enabled: false +closed: false +java.lang.IllegalStateException: consumer already open +java.lang.IllegalStateException: no compiled program +before enable +open: true +enabled: false +closed: false +java.lang.IllegalStateException: Not all compiled probes are enabled. Compiled description syscall:::entry { @[execname] = count(); } tick-101ms { printa(@); } not enabled. +before go +open: true +enabled: true +closed: false +java.lang.IllegalStateException: go() not called +java.lang.IllegalStateException: go() not called +java.lang.IllegalStateException: go() not called +java.lang.IllegalStateException: go() not called +before go, running: false +consumerStarted, running: true +after go +open: true +enabled: false +closed: false +java.lang.IllegalStateException: go() already called +java.lang.IllegalStateException: go() already called +java.lang.IllegalStateException: go() already called +java.lang.IllegalStateException: go() already called +java.lang.IllegalStateException: go() already called +java.lang.IllegalStateException: go() already called +consumerStopped, running: false +after stop, running: false +after stop +open: true +enabled: false +closed: false +java.lang.IllegalStateException: consumer already stopped +after close +open: false +enabled: false +closed: true +java.lang.IllegalStateException: cannot reopen a closed consumer +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed +java.lang.IllegalStateException: consumer closed diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh new file mode 100755 index 00000000..4637a7ad --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh @@ -0,0 +1,39 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Fixed bug 6399888 stop() hangs if ConsumerListener calls +# synchronized Consumer method. +# +# SECTION: Java API +# +############################################################################ + +java -cp test.jar TestStopLock diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh.out new file mode 100644 index 00000000..628d7870 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.StopLock.ksh.out @@ -0,0 +1 @@ +Successful diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.printa.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.printa.d new file mode 100644 index 00000000..574a9eab --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.printa.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + + +/* + * ASSERTION: + * printa() test with/without tuple, with multiple aggregations and + * mismatched format strings, and sorting options. + * + * SECTION: Aggregations/Aggregations; Output Formatting, printa() + * + * NOTES: This test attempts to cover all multi-agg printa() corner cases. + */ + +#pragma D option quiet + +BEGIN +{ + @ = count(); + @a[1, 2] = sum(1); + @b[1, 2] = sum(2); + @a[1, 3] = sum(3); + @b[2, 3] = sum(4); + @c = sum(3); + @d = sum(4); + setopt("aggsortpos", "1"); + setopt("aggsortrev"); + printa(@); + printa("count: %@d\n", @); + printa(" ", @); + printa(@a); + printa(@a, @b); + printa("%@d %@d\n", @c, @d); + printa("%@d %@d\n", @c, @d); + printa("%@d\n", @c, @d); + + printa("[%d, %d] %@d %@d\n", @a, @b); + setopt("aggsortkey"); + printa("[%d, %d] %@d %@d\n", @a, @b); + setopt("aggsortpos", "0"); + setopt("aggsortkeypos", "1"); + printa("[%d, %d] %@d %@d\n", @a, @b); + + printa("%@d %@d [%d, %d]\n", @a, @b); + printa("[%d, %d]\n", @a, @b); + printa("[%d]\n", @a, @b); + printa("[%d] %@d %@d\n", @a, @b); + printa("%@d %@d\n", @a, @b); + printa("%@d %@d %@d\n", @a, @b); + printa("[%d] %@d %@d %@d\n", @a, @b); + printa("[%d, %d] %@d %@d %@d\n", @a, @b); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.printa.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.printa.d.out new file mode 100644 index 00000000..10b90b3c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/java_api/tst.printa.d.out @@ -0,0 +1,47 @@ + + 1 +count: 1 + + 1 3 3 + 1 2 1 + + 2 3 0 4 + 1 2 1 2 + 1 3 3 0 +3 4 +3 4 +3 +[2, 3] 0 4 +[1, 2] 1 2 +[1, 3] 3 0 +[2, 3] 0 4 +[1, 3] 3 0 +[1, 2] 1 2 +[2, 3] 0 4 +[1, 3] 3 0 +[1, 2] 1 2 +0 4 [2, 3] +3 0 [1, 3] +1 2 [1, 2] +[2, 3] +[1, 3] +[1, 2] +[2] +[1] +[1] +[2] 0 4 +[1] 3 0 +[1] 1 2 +0 4 +3 0 +1 2 +0 4 4 +3 0 0 +1 2 2 +[2] 0 4 4 +[1] 3 0 0 +[1] 1 2 2 +[2, 3] 0 4 4 +[1, 3] 3 0 0 +[1, 2] 1 2 2 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NL.char.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NL.char.d new file mode 100644 index 00000000..9c0280c9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NL.char.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Newlines may not be embedded in character constants.. + * + * SECTION: Lexer + */ + + +BEGIN +{ + + h = ' + '; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NULL.char.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NULL.char.d new file mode 100644 index 00000000..aef5dab6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NULL.char.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Char constants may not be empty + * + * SECTION: Lexer + */ + + +BEGIN +{ + + h = ''; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_INT_DIGIT.InvalidDigit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_INT_DIGIT.InvalidDigit.d new file mode 100644 index 00000000..4fac03bc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_INT_DIGIT.InvalidDigit.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: If an integer representation contains an invalid digit + * a D_INT_DIGIT is thrown. + * + * SECTION: Errtags/D_INT_DIGIT + */ + +BEGIN +{ + 0128; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_INT_OFLOW.BigInt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_INT_OFLOW.BigInt.d new file mode 100644 index 00000000..1ec8be8f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_INT_OFLOW.BigInt.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Using an integer constant that cannot be represented in any of the + * builtin integral types throws a D_INT_OFLOW error. + * + * SECTION: Errtags/D_INT_OFLOW + */ + +BEGIN +{ + 0x12345678123456781; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_STR_NL.string.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_STR_NL.string.d new file mode 100644 index 00000000..68b4cd42 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_STR_NL.string.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Newlines may not be embedded in string literals. + * + * SECTION: Lexer + */ + + +BEGIN +{ + + h = "hello + + there"; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace1.d new file mode 100644 index 00000000..ae6dc6ce --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace1.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Test detection of extra curly braces. + * + * SECTION: Lexer + */ + +BEGIN +{ + trace(epid); +} +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace2.d new file mode 100644 index 00000000..196f7d7c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brace2.d @@ -0,0 +1,37 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: * Test detection of missing curly braces. + * + * SECTION: Lexer + */ + +BEGIN +{ + trace(epid); diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack1.d new file mode 100644 index 00000000..8e4c97da --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack1.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Test detection of extra square brackets + * + * SECTION: Lexer + */ + +BEGIN +{ + trace(args[0]]); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack2.d new file mode 100644 index 00000000..307bd08d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack2.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Test detection of missing square brackets + * + * SECTION: Lexer + */ + +BEGIN +{ + args[0 +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack3.d new file mode 100644 index 00000000..2d66828c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.brack3.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Test detection of missing square brackets + * + * SECTION: Lexer + */ + +BEGIN +/args[0/ +{ + trace(epid); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren1.d new file mode 100644 index 00000000..812dbb7d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren1.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Test detection of extra parentheses + * + * SECTION: Lexer + */ + +BEGIN +{ + trace(epid)); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren2.d new file mode 100644 index 00000000..078d08c6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren2.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Test detection of missing parentheses + * + * SECTION: Lexer + */ + +BEGIN +{ + rand( +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren3.d new file mode 100644 index 00000000..38cdb7e8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/err.D_SYNTAX.paren3.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Test detection of missing parentheses + * + * SECTION: Lexer + */ + +BEGIN +/rand(/ +{ + trace(epid); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh new file mode 100755 index 00000000..ad124ea9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/lexer/tst.D_MACRO_OFLOW.ParIntOvflow.d.ksh @@ -0,0 +1,54 @@ +#!/bin/ksh -p + +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +# +# ASSERTION: +# If a macro argument results in an integer overflow, a D_MACRO_OFLOW is +# thrown. +# +# SECTION: Errtags/D_MACRO_OFLOW +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -n 'BEGIN { $1; }' 0x12345678123456781 +status=$? + +if [ "$status" -ne 0 ]; then + exit 0 +fi + +echo dtrace failed +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mdb/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mdb/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mdb/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh new file mode 100755 index 00000000..561f8549 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mdb/tst.dtracedcmd.ksh @@ -0,0 +1,85 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# +# This script primarily tests that the ::dtrace dcmd is not dumping +# core. We don't try to make sense of the output of the dcmd nor +# do we check to see if any output is produced. We merely see if +# mdb fails with a fatal failure. +# + +script() +{ + $dtrace -o $dtraceout -s /dev/stdin <<EOF + syscall:::entry + { + @[probefunc] = count(); + } +EOF +} + +mdbdoit() +{ + mdb -k <<EOF + ::walk dtrace_state | ::dtrace +EOF + status=$? + kill $script +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +dtraceout=/tmp/dtrace.out.$$ +script & +script=$! +timeout=15 + +# +# Sleep while the above script fires into life. To guard against dtrace dying +# and us sleeping forever we allow 15 secs for this to happen. This should be +# enough for even the slowest systems. +# +while [ ! -f $dtraceout ]; do + sleep 1 + timeout=$(($timeout-1)) + if [ $timeout -eq 0 ]; then + echo "dtrace failed to start. Exiting." + exit 1 + fi +done + +mdbdoit + +rm $dtraceout + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh new file mode 100644 index 00000000..b1cac20f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.icmp.ksh @@ -0,0 +1,79 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that several of the the mib:::icmp* probes fire and fire +# with a valid args[0]. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + mib:::icmpInEchos + { + in = args[0]; + } + + mib:::icmpOutEchoReps + { + reps = args[0]; + } + + mib:::icmpOutMsgs + { + msgs = args[0]; + } + + profile:::tick-10msec + /in && reps && msgs/ + { + exit(0); + } +EOF +} + +pinger() +{ + while true; do + ping -A inet localhost + /usr/bin/sleep 1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +pinger & +pinger=$! +script +status=$? + +kill $pinger +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.tcp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.tcp.ksh new file mode 100644 index 00000000..ee602e86 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.tcp.ksh @@ -0,0 +1,155 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that several of the the mib:::tcp* probes fire and fire +# with a valid args[0]. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +dtraceout=/tmp/dtrace.out.$$ +timeout=15 +port=2000 + +if [ -f $dtraceout ]; then + rm -f $dtraceout +fi + +script() +{ + $dtrace -o $dtraceout -s /dev/stdin <<EOF + mib:::tcpActiveOpens + { + opens = args[0]; + } + + mib:::tcpOutDataBytes + { + bytes = args[0]; + } + + mib:::tcpOutDataSegs + { + segs = args[0]; + } + + profile:::tick-10msec + /opens && bytes && segs/ + { + exit(0); + } + + profile:::tick-1s + /n++ >= 10/ + { + exit(1); + } +EOF +} + +server() +{ + perl /dev/stdin /dev/stdout << EOF + use strict; + use Socket; + + socket(S, AF_INET, SOCK_STREAM, getprotobyname('tcp')) + or die "socket() failed: \$!"; + + setsockopt(S, SOL_SOCKET, SO_REUSEADDR, 1) + or die "setsockopt() failed: \$!"; + + my \$addr = sockaddr_in($port, INADDR_ANY); + bind(S, \$addr) or die "bind() failed: \$!"; + listen(S, SOMAXCONN) or die "listen() failed: \$!"; + + while (1) { + next unless my \$raddr = accept(SESSION, S); + + while (<SESSION>) { + } + + close SESSION; + } +EOF +} + +client() +{ + perl /dev/stdin /dev/stdout <<EOF + use strict; + use Socket; + + my \$peer = sockaddr_in($port, INADDR_ANY); + + socket(S, AF_INET, SOCK_STREAM, getprotobyname('tcp')) + or die "socket() failed: \$!"; + + connect(S, \$peer) or die "connect failed: \$!"; + + for (my \$i = 0; \$i < 10; \$i++) { + send(S, "There!", 0) or die "send() failed: \$!"; + sleep (1); + } +EOF +} + +script & +dtrace_pid=$! + +# +# Sleep while the above script fires into life. To guard against dtrace dying +# and us sleeping forever we allow 15 secs for this to happen. This should be +# enough for even the slowest systems. +# +while [ ! -f $dtraceout ]; do + sleep 1 + timeout=$(($timeout-1)) + if [ $timeout -eq 0 ]; then + echo "dtrace failed to start. Exiting." + exit 1 + fi +done + +server & +server_pid=$! +sleep 2 +client & +client_pid=$! + +wait $dtrace_pid +status=$? + +kill $server_pid +kill $client_pid + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.udp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.udp.ksh new file mode 100644 index 00000000..a492124c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/mib/tst.udp.ksh @@ -0,0 +1,74 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that several of the the mib:::udp* probes fire and fire +# with a valid args[0]. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + mib:::udpHCOutDatagrams + { + out = args[0]; + } + + mib:::udpHCInDatagrams + { + in = args[0]; + } + + profile:::tick-10msec + /in && out/ + { + exit(0); + } +EOF +} + +rupper() +{ + while true; do + rup localhost + /usr/bin/sleep 1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +rupper & +rupper=$! +script +status=$? + +kill $rupper +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/err.D_PRAGMA_OPTSET.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/err.D_PRAGMA_OPTSET.d new file mode 100644 index 00000000..5238e3f3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/err.D_PRAGMA_OPTSET.d @@ -0,0 +1,34 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet=please + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.badopt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.badopt.d new file mode 100644 index 00000000..868b756f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.badopt.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + setopt("Nixon"); + setopt("Harding"); + setopt("Hoover"); + setopt("Bush"); + setopt("quiet", "hell no"); + setopt("aggrate", "0.5hz"); + setopt("bufsize", "1m"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.boolopt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.boolopt.d new file mode 100644 index 00000000..0755271f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.boolopt.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet=yes +#pragma D option quiet=YES +#pragma D option quiet=true +#pragma D option quiet=enable +#pragma D option quiet=enabled +#pragma D option quiet=on +#pragma D option quiet=set +#pragma D option quiet=SeT + +#pragma D option flowindent=no +#pragma D option flowindent=NO +#pragma D option flowindent=false +#pragma D option flowindent=disable +#pragma D option flowindent=disabled +#pragma D option flowindent=off +#pragma D option flowindent=UnSeT + +BEGIN +{ + printf(".lived eht si paTmetsyS, lived eht si paTmetsyS\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.boolopt.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.boolopt.d.out new file mode 100644 index 00000000..2554be5c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.boolopt.d.out @@ -0,0 +1,2 @@ +.lived eht si paTmetsyS, lived eht si paTmetsyS + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.dynopt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.dynopt.d new file mode 100644 index 00000000..cb98d733 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.dynopt.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +#pragma D option switchrate=1ms +#pragma D option aggrate=1ms + +tick-100ms +{ + i++; +} + +tick-100ms +/i > 1/ +{ + setopt("quiet", "no"); + setopt("quiet"); + setopt("quiet"); + setopt("quiet", "yes"); + @["abc"] = count(); + printa("%@d\n", @); +} + +tick-100ms +/i == 5/ +{ + setopt("switchrate", "5sec"); + setopt("aggrate", "5sec"); +} + +tick-100ms +/i == 31/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.dynopt.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.dynopt.d.out new file mode 100644 index 00000000..092a0426 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.dynopt.d.out @@ -0,0 +1,31 @@ +1 +2 +3 +4 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 +30 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.enablerace.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.enablerace.ksh new file mode 100644 index 00000000..b4d56bb6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.enablerace.ksh @@ -0,0 +1,89 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +# +# This script attempts to tease out a race when probes are initially enabled. +# +script() +{ + # + # Nauseatingly, the #defines below must be in the 0th column to + # satisfy the ancient cpp that -C defaults to. + # + $dtrace -C -s /dev/stdin <<EOF +#define PROF1 profile:::profile-4000hz +#define PROF4 PROF1, PROF1, PROF1, PROF1 +#define PROF16 PROF4, PROF4, PROF4, PROF4 +#define PROF64 PROF16, PROF16, PROF16, PROF16 +#define PROF256 PROF64, PROF64, PROF64, PROF64 +#define PROF512 PROF256, PROF256 + + PROF1 + { + this->x = 0; + } + + PROF512 + { + this->x++; + } + + PROF1 + /this->x != 512/ + { + printf("failed! x is %d (expected 512)", this->x); + exit(1); + } + + tick-1sec + /secs++/ + { + exit(0); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +let i=0 + +while [ "$i" -lt 20 ]; do + script + status=$? + + if [ "$status" -ne 0 ]; then + exit $status + fi + + let i=i+1 +done + +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.haslam.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.haslam.d new file mode 100644 index 00000000..a0b437b4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.haslam.d @@ -0,0 +1,63 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: test for off-by-one error in the format lookup code + * + * SECTION: Aggregations/Aggregations; Misc + */ + +/* + * A script from Jon Haslam that induced an off-by-one error in the + * format lookup code. + */ +BEGIN +{ + start = timestamp; + allocd = 0; + numallocs = 0; + numfrees = 0; + numtids = 0; +} + +syscall:::entry +{ + @sys[tid] = sum(tid); +} + +END +{ + printf("%s, %s, %s, %d numtids", "hhh", "jjj", "ggg", numtids ); + printa(@sys); +} + +tick-1sec +/n++ == 5/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.include.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.include.ksh new file mode 100644 index 00000000..ec328021 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.include.ksh @@ -0,0 +1,135 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +CC=/usr/sfw/bin/gcc +CFLAGS= + +doit() +{ + file=$1 + ofile=$2 + errfile=$3 + cfile=${TMPDIR:-/tmp}/inc.$$.$file.c + cofile=${TMPDIR:-/tmp}/inc.$$.$file + cat > $cfile <<EOF +#include <sys/$file> +void +main() +{} +EOF + if $CC $CFLAGS -o $cofile $cfile >/dev/null 2>&1; then + $dtrace -xerrtags -C -s /dev/stdin \ + >/dev/null 2>$errfile <<EOF +#include <sys/$file> +BEGIN +{ + exit(0); +} +EOF + if [ $? -ne 0 ]; then + echo $inc failed: `cat $errfile | head -1` > $ofile + else + echo $inc succeeded > $ofile + fi + rm -f $errfile + fi + + rm -f $cofile $cfile 2>/dev/null +} + +if [ ! -x $CC ]; then + echo "$0: bad compiler: $CC" >& 2 + exit 1 +fi + +concurrency=`psrinfo | wc -l` +let concurrency=concurrency*4 +let i=0 + +files=/usr/include/sys/*.h + +# +# There are a few files in /usr/include/sys that are known to be bad -- usually +# because they include static globals (!) or function bodies (!!) in the header +# file. Hopefully these remain sufficiently few that the O(#files * #badfiles) +# algorithm, below, doesn't become a problem. (And yes, writing scripts in +# something other than ksh1888 would probably be a good idea.) If this script +# becomes a problem, kindly fix it by reducing the number of bad files! (That +# is, fix it by fixing the broken file, not the broken script.) +# +badfiles="ctype.h eri_msg.h ser_sync.h sbpro.h neti.h hook_event.h \ + bootconf.h bootstat.h dtrace.h dumphdr.h exacct_impl.h fasttrap.h \ + kobj.h kobj_impl.h ksyms.h lockstat.h smedia.h stat.h utsname.h" + +for inc in $files; do + file=`basename $inc` + for bad in $badfiles; do + if [ "$file" = "$bad" ]; then + continue 2 + fi + done + + ofile=${TMPDIR:-/tmp}/inc.$file.$$.out + errfile=${TMPDIR:-/tmp}/inc.$file.$$.err + doit $file $ofile $errfile & + let i=i+1 + + if [ $i -eq $concurrency ]; then + # + # This isn't optimal -- it creates a highly fluctuating load + # as we wait for all work to complete -- but it's an easy + # way of parallelizing work. + # + wait + let i=0 + fi +done + +wait + +bigofile=${TMPDIR:-/tmp}/inc.$$.out + +for inc in $files; do + file=`basename $inc` + ofile=${TMPDIR:-/tmp}/inc.$file.$$.out + + if [ -f $ofile ]; then + cat $ofile >> $bigofile + rm $ofile + fi +done + +status=$(grep "failed:" $bigofile | wc -l) +cat $bigofile +rm -f $bigofile +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh new file mode 100644 index 00000000..a5114f49 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh @@ -0,0 +1,41 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -ln 'syscall::*$1:entry' read | awk '{print $(NF-1),$NF}' | sort +$dtrace -ln 'syscall::$1*:entry' read | awk '{print $(NF-1),$NF}' | sort +$dtrace -ln 'syscall::re$1*:entry' ad | awk '{print $(NF-1),$NF}' | sort +$dtrace -ln 'syscall::$1l*:entry' read | awk '{print $(NF-1),$NF}' | sort +$dtrace -ln 'syscall::p$1[0-9][0-9]:entry' read | awk '{print $(NF-1),$NF}' | \ + sort + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out new file mode 100644 index 00000000..8a9ac6d9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out @@ -0,0 +1,15 @@ +FUNCTION NAME +pread entry +read entry +FUNCTION NAME +read entry +readlink entry +readv entry +FUNCTION NAME +read entry +readlink entry +readv entry +FUNCTION NAME +readlink entry +FUNCTION NAME +pread64 entry diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.roch.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.roch.d new file mode 100644 index 00000000..67f44622 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.roch.d @@ -0,0 +1,93 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: test for assertion failure in the ring buffer code + * + * SECTION: Buffers and Buffering/ring Policy; Misc + */ + +#pragma ident "@(#)tst.roch.d 1.2 03/08/11 SMI" + +/* + * A script from Roch Bourbonnais that induced an assertion failure in the + * ring buffer code. + */ +#pragma D option strsize=16 +#pragma D option bufsize=10K +#pragma D option bufpolicy=ring + +fbt:::entry +/(self->done == 0) && (curthread->t_cpu->cpu_intr_actv == 0) / +{ + self->done = 1; + printf(" %u 0x%llX %d %d comm:%s csathr:%lld", timestamp, + (long long)curthread, pid, tid, + execname, (long long)stackdepth); + stack(20); +} + +fbt:::return +/(self->done == 0) && (curthread->t_cpu->cpu_intr_actv == 0) / +{ + self->done = 1; + printf(" %u 0x%llX %d %d comm:%s csathr:%lld", timestamp, + (long long) curthread, pid, tid, + execname, (long long) stackdepth); + stack(20); +} + +fbt:::entry +{ + printf(" %u 0x%llX %d %d ", timestamp, + (long long)curthread, pid, tid); +} + +fbt:::return +{ + printf(" %u 0x%llX %d %d tag:%d off:%d ", timestamp, + (long long)curthread, pid, tid, (int)arg1, (int)arg0); +} + +mutex_enter:adaptive-acquire +{ + printf(" %u 0x%llX %d %d lock:0x%llX", timestamp, + (long long)curthread, pid, tid, arg0); +} + +mutex_exit:adaptive-release +{ + printf(" %u 0x%llX %d %d lock:0x%llX", timestamp, + (long long) curthread, pid, tid, arg0); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh new file mode 100644 index 00000000..494f6f8e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh @@ -0,0 +1,79 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +# +# /usr/ccs/bin/nm execs a 64-bit version of itself. DTrace uses libproc +# (which uses /proc) to find out when the traced process exits, but a +# 32-bit process can't examine a 64-bit one with libproc. The +# LD_NOEXEC_64 variable prevents nm from re-execing itself. +# +LD_NOEXEC_64=tomeeisrad $dtrace -F -s /dev/stdin -c \ + '/usr/ccs/bin/nm /bin/ls' stat <<EOF + +pid\$target::\$1:entry +{ + self->start = vtimestamp; +} + +pid\$target:::entry +/self->start/ +{ + trace(vtimestamp - self->start); +} + +pid\$target:::return +/self->start/ +{ + trace(vtimestamp - self->start); +} + +pid\$target::\$1:return +/self->start/ +{ + self->start = 0; + exit(0); +} + +syscall::: +/self->start/ +{ + trace(vtimestamp - self->start); +} + +fbt::: +/self->start/ +{ + trace(vtimestamp - self->start); +} +EOF diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGKEY.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGKEY.d new file mode 100644 index 00000000..8074e6e3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGKEY.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + @foo[123] = sum(123); + @bar = sum(456); + + printa("%10d %@10d %@10d\n", @foo, @bar); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGPROTO.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGPROTO.d new file mode 100644 index 00000000..dc65947a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/err.D_PRINTA_AGGPROTO.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + @foo[123] = sum(123); + @bar["fooey"] = sum(456); + + printa("%10d %@10d %@10d\n", @foo, @bar); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.many.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.many.d new file mode 100644 index 00000000..00588c66 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.many.d @@ -0,0 +1,311 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option destructive +#pragma D option quiet + +BEGIN +/0/ +{ + @agg996[996] = quantize(998); + @agg997[997] = count(); + @agg998[998] = min(998); + @agg999[999] = lquantize(0, -10, 10, 1); +} + +BEGIN +{ + @agg0[0] = sum(0); + @agg1[1] = sum(1); + @agg2[2] = sum(2); + @agg3[3] = sum(3); + @agg4[4] = sum(4); + @agg5[5] = sum(5); + @agg6[6] = sum(6); + @agg7[7] = sum(7); + @agg8[8] = sum(8); + @agg9[9] = sum(9); + @agg10[10] = sum(10); + @agg11[11] = sum(11); + @agg12[12] = sum(12); + @agg13[13] = sum(13); + @agg14[14] = sum(14); + @agg15[15] = sum(15); + @agg16[16] = sum(16); + @agg17[17] = sum(17); + @agg18[18] = sum(18); + @agg19[19] = sum(19); + @agg20[20] = sum(20); + @agg21[21] = sum(21); + @agg22[22] = sum(22); + @agg23[23] = sum(23); + @agg24[24] = sum(24); + @agg25[25] = sum(25); + @agg26[26] = sum(26); + @agg27[27] = sum(27); + @agg28[28] = sum(28); + @agg29[29] = sum(29); + @agg30[30] = sum(30); + @agg31[31] = sum(31); + @agg32[32] = sum(32); + @agg33[33] = sum(33); + @agg34[34] = sum(34); + @agg35[35] = sum(35); + @agg36[36] = sum(36); + @agg37[37] = sum(37); + @agg38[38] = sum(38); + @agg39[39] = sum(39); + @agg40[40] = sum(40); + @agg41[41] = sum(41); + @agg42[42] = sum(42); + @agg43[43] = sum(43); + @agg44[44] = sum(44); + @agg45[45] = sum(45); + @agg46[46] = sum(46); + @agg47[47] = sum(47); + @agg48[48] = sum(48); + @agg49[49] = sum(49); + @agg50[50] = sum(50); + @agg51[51] = sum(51); + @agg52[52] = sum(52); + @agg53[53] = sum(53); + @agg54[54] = sum(54); + @agg55[55] = sum(55); + @agg56[56] = sum(56); + @agg57[57] = sum(57); + @agg58[58] = sum(58); + @agg59[59] = sum(59); + @agg60[60] = sum(60); + @agg61[61] = sum(61); + @agg62[62] = sum(62); + @agg63[63] = sum(63); + @agg64[64] = sum(64); + @agg65[65] = sum(65); + @agg66[66] = sum(66); + @agg67[67] = sum(67); + @agg68[68] = sum(68); + @agg69[69] = sum(69); + @agg70[70] = sum(70); + @agg71[71] = sum(71); + @agg72[72] = sum(72); + @agg73[73] = sum(73); + @agg74[74] = sum(74); + @agg75[75] = sum(75); + @agg76[76] = sum(76); + @agg77[77] = sum(77); + @agg78[78] = sum(78); + @agg79[79] = sum(79); + @agg80[80] = sum(80); + @agg81[81] = sum(81); + @agg82[82] = sum(82); + @agg83[83] = sum(83); + @agg84[84] = sum(84); + @agg85[85] = sum(85); + @agg86[86] = sum(86); + @agg87[87] = sum(87); + @agg88[88] = sum(88); + @agg89[89] = sum(89); + @agg90[90] = sum(90); + @agg91[91] = sum(91); + @agg92[92] = sum(92); + @agg93[93] = sum(93); + @agg94[94] = sum(94); + @agg95[95] = sum(95); + @agg96[96] = sum(96); + @agg97[97] = sum(97); + @agg98[98] = sum(98); + @agg99[99] = sum(99); + @agg100[100] = sum(100); + @agg101[101] = sum(101); + @agg102[102] = sum(102); + @agg103[103] = sum(103); + @agg104[104] = sum(104); + @agg105[105] = sum(105); + @agg106[106] = sum(106); + @agg107[107] = sum(107); + @agg108[108] = sum(108); + @agg109[109] = sum(109); + @agg110[110] = sum(110); + @agg111[111] = sum(111); + @agg112[112] = sum(112); + @agg113[113] = sum(113); + @agg114[114] = sum(114); + @agg115[115] = sum(115); + @agg116[116] = sum(116); + @agg117[117] = sum(117); + @agg118[118] = sum(118); + @agg119[119] = sum(119); + @agg120[120] = sum(120); + @agg121[121] = sum(121); + @agg122[122] = sum(122); + @agg123[123] = sum(123); + @agg124[124] = sum(124); + @agg125[125] = sum(125); + @agg126[126] = sum(126); + @agg127[127] = sum(127); + @agg128[128] = sum(128); + @agg129[129] = sum(129); + @agg130[130] = sum(130); + @agg131[131] = sum(131); + @agg132[132] = sum(132); + @agg133[133] = sum(133); + @agg134[134] = sum(134); + @agg135[135] = sum(135); + @agg136[136] = sum(136); + @agg137[137] = sum(137); + @agg138[138] = sum(138); + @agg139[139] = sum(139); + @agg140[140] = sum(140); + @agg141[141] = sum(141); + @agg142[142] = sum(142); + @agg143[143] = sum(143); + @agg144[144] = sum(144); + @agg145[145] = sum(145); + @agg146[146] = sum(146); + @agg147[147] = sum(147); + @agg148[148] = sum(148); + @agg149[149] = sum(149); + @agg150[150] = sum(150); + @agg151[151] = sum(151); + @agg152[152] = sum(152); + @agg153[153] = sum(153); + @agg154[154] = sum(154); + @agg155[155] = sum(155); + @agg156[156] = sum(156); + @agg157[157] = sum(157); + @agg158[158] = sum(158); + @agg159[159] = sum(159); + @agg160[160] = sum(160); + @agg161[161] = sum(161); + @agg162[162] = sum(162); + @agg163[163] = sum(163); + @agg164[164] = sum(164); + @agg165[165] = sum(165); + @agg166[166] = sum(166); + @agg167[167] = sum(167); + @agg168[168] = sum(168); + @agg169[169] = sum(169); + @agg170[170] = sum(170); + @agg171[171] = sum(171); + @agg172[172] = sum(172); + @agg173[173] = sum(173); + @agg174[174] = sum(174); + @agg175[175] = sum(175); + @agg176[176] = sum(176); + @agg177[177] = sum(177); + @agg178[178] = sum(178); + @agg179[179] = sum(179); + @agg180[180] = sum(180); + @agg181[181] = sum(181); + @agg182[182] = sum(182); + @agg183[183] = sum(183); + @agg184[184] = sum(184); + @agg185[185] = sum(185); + @agg186[186] = sum(186); + @agg187[187] = sum(187); + @agg188[188] = sum(188); + @agg189[189] = sum(189); + @agg190[190] = sum(190); + @agg191[191] = sum(191); + @agg192[192] = sum(192); + @agg193[193] = sum(193); + @agg194[194] = sum(194); + @agg195[195] = sum(195); + @agg196[196] = sum(196); + @agg197[197] = sum(197); + @agg198[198] = sum(198); + @agg199[199] = sum(199); + @agg200[200] = sum(200); + @agg201[201] = sum(201); + @agg202[202] = sum(202); + @agg203[203] = sum(203); + @agg204[204] = sum(204); + @agg205[205] = sum(205); + @agg206[206] = sum(206); + @agg207[207] = sum(207); + @agg208[208] = sum(208); + @agg209[209] = sum(209); + @agg210[210] = sum(210); + @agg211[211] = sum(211); + @agg212[212] = sum(212); + @agg213[213] = sum(213); + @agg214[214] = sum(214); + @agg215[215] = sum(215); + @agg216[216] = sum(216); + @agg217[217] = sum(217); + @agg218[218] = sum(218); + @agg219[219] = sum(219); + @agg220[220] = sum(220); + @agg221[221] = sum(221); + @agg222[222] = sum(222); + @agg223[223] = sum(223); + @agg224[224] = sum(224); + @agg225[225] = sum(225); + @agg226[226] = sum(226); + @agg227[227] = sum(227); + @agg228[228] = sum(228); + @agg229[229] = sum(229); + @agg230[230] = sum(230); + @agg231[231] = sum(231); + @agg232[232] = sum(232); + @agg233[233] = sum(233); + @agg234[234] = sum(234); + @agg235[235] = sum(235); + @agg236[236] = sum(236); + @agg237[237] = sum(237); + @agg238[238] = sum(238); + @agg239[239] = sum(239); + @agg240[240] = sum(240); + @agg241[241] = sum(241); + @agg242[242] = sum(242); + @agg243[243] = sum(243); + @agg244[244] = sum(244); + @agg245[245] = sum(245); + @agg246[246] = sum(246); + + printa("%8d %8@d %8@d\n", @agg0, @agg1); + printf("\n"); + + printa("%8d %8@d %8@d\n", @agg0, @agg996); + printf("\n"); + + printa("%4d %4@d %4@d %4@d %4@d %4@d %4@d %4@d %4@d %4@d %4@d %4@d\n", + @agg12, @agg3, @agg73, @agg997, + @agg9, @agg9, @agg4, @agg998, + @agg11, @agg23, @agg69); + + printf("\n"); + + printa("%8d %8@d %8@d\n", @agg245, @agg246); + printf("\n"); + + printa("%8d %8@d %8@d\n", @agg999, @agg246); + printf("\n"); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.many.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.many.d.out new file mode 100644 index 00000000..e048d432 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.many.d.out @@ -0,0 +1,265 @@ + 0 0 0 + 1 0 1 + + 0 0 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + + 69 0 0 0 0 0 0 0 0 0 0 69 + 23 0 0 0 0 0 0 0 0 0 23 0 + 11 0 0 0 0 0 0 0 0 11 0 0 + 4 0 0 0 0 0 0 4 0 0 0 0 + 9 0 0 0 0 9 9 0 0 0 0 0 + 73 0 0 73 0 0 0 0 0 0 0 0 + 3 0 3 0 0 0 0 0 0 0 0 0 + 12 12 0 0 0 0 0 0 0 0 0 0 + + 246 0 246 + 245 245 0 + + 246 + value ------------- Distribution ------------- count + < -10 | 0 + -10 | 0 + -9 | 0 + 246 + + + 2 2 + 5 5 + 6 6 + 7 7 + 8 8 + 10 10 + 13 13 + 14 14 + 15 15 + 16 16 + 17 17 + 18 18 + 19 19 + 20 20 + 21 21 + 22 22 + 24 24 + 25 25 + 26 26 + 27 27 + 28 28 + 29 29 + 30 30 + 31 31 + 32 32 + 33 33 + 34 34 + 35 35 + 36 36 + 37 37 + 38 38 + 39 39 + 40 40 + 41 41 + 42 42 + 43 43 + 44 44 + 45 45 + 46 46 + 47 47 + 48 48 + 49 49 + 50 50 + 51 51 + 52 52 + 53 53 + 54 54 + 55 55 + 56 56 + 57 57 + 58 58 + 59 59 + 60 60 + 61 61 + 62 62 + 63 63 + 64 64 + 65 65 + 66 66 + 67 67 + 68 68 + 70 70 + 71 71 + 72 72 + 74 74 + 75 75 + 76 76 + 77 77 + 78 78 + 79 79 + 80 80 + 81 81 + 82 82 + 83 83 + 84 84 + 85 85 + 86 86 + 87 87 + 88 88 + 89 89 + 90 90 + 91 91 + 92 92 + 93 93 + 94 94 + 95 95 + 96 96 + 97 97 + 98 98 + 99 99 + 100 100 + 101 101 + 102 102 + 103 103 + 104 104 + 105 105 + 106 106 + 107 107 + 108 108 + 109 109 + 110 110 + 111 111 + 112 112 + 113 113 + 114 114 + 115 115 + 116 116 + 117 117 + 118 118 + 119 119 + 120 120 + 121 121 + 122 122 + 123 123 + 124 124 + 125 125 + 126 126 + 127 127 + 128 128 + 129 129 + 130 130 + 131 131 + 132 132 + 133 133 + 134 134 + 135 135 + 136 136 + 137 137 + 138 138 + 139 139 + 140 140 + 141 141 + 142 142 + 143 143 + 144 144 + 145 145 + 146 146 + 147 147 + 148 148 + 149 149 + 150 150 + 151 151 + 152 152 + 153 153 + 154 154 + 155 155 + 156 156 + 157 157 + 158 158 + 159 159 + 160 160 + 161 161 + 162 162 + 163 163 + 164 164 + 165 165 + 166 166 + 167 167 + 168 168 + 169 169 + 170 170 + 171 171 + 172 172 + 173 173 + 174 174 + 175 175 + 176 176 + 177 177 + 178 178 + 179 179 + 180 180 + 181 181 + 182 182 + 183 183 + 184 184 + 185 185 + 186 186 + 187 187 + 188 188 + 189 189 + 190 190 + 191 191 + 192 192 + 193 193 + 194 194 + 195 195 + 196 196 + 197 197 + 198 198 + 199 199 + 200 200 + 201 201 + 202 202 + 203 203 + 204 204 + 205 205 + 206 206 + 207 207 + 208 208 + 209 209 + 210 210 + 211 211 + 212 212 + 213 213 + 214 214 + 215 215 + 216 216 + 217 217 + 218 218 + 219 219 + 220 220 + 221 221 + 222 222 + 223 223 + 224 224 + 225 225 + 226 226 + 227 227 + 228 228 + 229 229 + 230 230 + 231 231 + 232 232 + 233 233 + 234 234 + 235 235 + 236 236 + 237 237 + 238 238 + 239 239 + 240 240 + 241 241 + 242 242 + 243 243 + 244 244 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.same.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.same.d new file mode 100644 index 00000000..0e675579 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.same.d @@ -0,0 +1,37 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + @ = sum(90904); + printa("%@d %@d %@d\n", @, @, @); + printa("%@d %@d %@d\n", @); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.same.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.same.d.out new file mode 100644 index 00000000..b382c35a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.same.d.out @@ -0,0 +1,3 @@ +90904 90904 90904 +90904 90904 90904 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d new file mode 100644 index 00000000..7bfd9e57 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +tick-1ms +{ + i++; + @a[i] = sum(100 - (i / 2)); + @b[i] = sum(100 - (i / 4)); + @c[i] = sum(100 - (i / 8)); + @d[i] = sum(100 - (i / 16)); +} + +tick-1ms +/i == 100/ +{ + printa("%10d %@10d %@10d %@10d %@10d\n", @a, @b, @c, @d); + printa("%10d %@10d %@10d %@10d %@10d\n", @d, @c, @b, @a); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d.out new file mode 100644 index 00000000..8c79190f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sort.d.out @@ -0,0 +1,201 @@ + 100 50 75 88 94 + 98 51 76 88 94 + 99 51 76 88 94 + 96 52 76 88 94 + 97 52 76 88 94 + 94 53 77 89 95 + 95 53 77 89 95 + 92 54 77 89 95 + 93 54 77 89 95 + 90 55 78 89 95 + 91 55 78 89 95 + 88 56 78 89 95 + 89 56 78 89 95 + 86 57 79 90 95 + 87 57 79 90 95 + 84 58 79 90 95 + 85 58 79 90 95 + 82 59 80 90 95 + 83 59 80 90 95 + 80 60 80 90 95 + 81 60 80 90 95 + 78 61 81 91 96 + 79 61 81 91 96 + 76 62 81 91 96 + 77 62 81 91 96 + 74 63 82 91 96 + 75 63 82 91 96 + 72 64 82 91 96 + 73 64 82 91 96 + 70 65 83 92 96 + 71 65 83 92 96 + 68 66 83 92 96 + 69 66 83 92 96 + 66 67 84 92 96 + 67 67 84 92 96 + 64 68 84 92 96 + 65 68 84 92 96 + 62 69 85 93 97 + 63 69 85 93 97 + 60 70 85 93 97 + 61 70 85 93 97 + 58 71 86 93 97 + 59 71 86 93 97 + 56 72 86 93 97 + 57 72 86 93 97 + 54 73 87 94 97 + 55 73 87 94 97 + 52 74 87 94 97 + 53 74 87 94 97 + 50 75 88 94 97 + 51 75 88 94 97 + 48 76 88 94 97 + 49 76 88 94 97 + 46 77 89 95 98 + 47 77 89 95 98 + 44 78 89 95 98 + 45 78 89 95 98 + 42 79 90 95 98 + 43 79 90 95 98 + 40 80 90 95 98 + 41 80 90 95 98 + 38 81 91 96 98 + 39 81 91 96 98 + 36 82 91 96 98 + 37 82 91 96 98 + 34 83 92 96 98 + 35 83 92 96 98 + 32 84 92 96 98 + 33 84 92 96 98 + 30 85 93 97 99 + 31 85 93 97 99 + 28 86 93 97 99 + 29 86 93 97 99 + 26 87 94 97 99 + 27 87 94 97 99 + 24 88 94 97 99 + 25 88 94 97 99 + 22 89 95 98 99 + 23 89 95 98 99 + 20 90 95 98 99 + 21 90 95 98 99 + 18 91 96 98 99 + 19 91 96 98 99 + 16 92 96 98 99 + 17 92 96 98 99 + 14 93 97 99 100 + 15 93 97 99 100 + 12 94 97 99 100 + 13 94 97 99 100 + 10 95 98 99 100 + 11 95 98 99 100 + 8 96 98 99 100 + 9 96 98 99 100 + 6 97 99 100 100 + 7 97 99 100 100 + 4 98 99 100 100 + 5 98 99 100 100 + 2 99 100 100 100 + 3 99 100 100 100 + 1 100 100 100 100 + 100 94 88 75 50 + 98 94 88 76 51 + 99 94 88 76 51 + 96 94 88 76 52 + 97 94 88 76 52 + 94 95 89 77 53 + 95 95 89 77 53 + 92 95 89 77 54 + 93 95 89 77 54 + 90 95 89 78 55 + 91 95 89 78 55 + 88 95 89 78 56 + 89 95 89 78 56 + 86 95 90 79 57 + 87 95 90 79 57 + 84 95 90 79 58 + 85 95 90 79 58 + 82 95 90 80 59 + 83 95 90 80 59 + 80 95 90 80 60 + 81 95 90 80 60 + 78 96 91 81 61 + 79 96 91 81 61 + 76 96 91 81 62 + 77 96 91 81 62 + 74 96 91 82 63 + 75 96 91 82 63 + 72 96 91 82 64 + 73 96 91 82 64 + 70 96 92 83 65 + 71 96 92 83 65 + 68 96 92 83 66 + 69 96 92 83 66 + 66 96 92 84 67 + 67 96 92 84 67 + 64 96 92 84 68 + 65 96 92 84 68 + 62 97 93 85 69 + 63 97 93 85 69 + 60 97 93 85 70 + 61 97 93 85 70 + 58 97 93 86 71 + 59 97 93 86 71 + 56 97 93 86 72 + 57 97 93 86 72 + 54 97 94 87 73 + 55 97 94 87 73 + 52 97 94 87 74 + 53 97 94 87 74 + 50 97 94 88 75 + 51 97 94 88 75 + 48 97 94 88 76 + 49 97 94 88 76 + 46 98 95 89 77 + 47 98 95 89 77 + 44 98 95 89 78 + 45 98 95 89 78 + 42 98 95 90 79 + 43 98 95 90 79 + 40 98 95 90 80 + 41 98 95 90 80 + 38 98 96 91 81 + 39 98 96 91 81 + 36 98 96 91 82 + 37 98 96 91 82 + 34 98 96 92 83 + 35 98 96 92 83 + 32 98 96 92 84 + 33 98 96 92 84 + 30 99 97 93 85 + 31 99 97 93 85 + 28 99 97 93 86 + 29 99 97 93 86 + 26 99 97 94 87 + 27 99 97 94 87 + 24 99 97 94 88 + 25 99 97 94 88 + 22 99 98 95 89 + 23 99 98 95 89 + 20 99 98 95 90 + 21 99 98 95 90 + 18 99 98 96 91 + 19 99 98 96 91 + 16 99 98 96 92 + 17 99 98 96 92 + 14 100 99 97 93 + 15 100 99 97 93 + 12 100 99 97 94 + 13 100 99 97 94 + 10 100 99 98 95 + 11 100 99 98 95 + 8 100 99 98 96 + 9 100 99 98 96 + 6 100 100 99 97 + 7 100 100 99 97 + 4 100 100 99 98 + 5 100 100 99 98 + 2 100 100 100 99 + 3 100 100 100 99 + 1 100 100 100 100 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d new file mode 100644 index 00000000..ddb297f9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + j = 0; +} + +tick-1ms +/i < 100/ +{ + i++; + @a[i] = sum(i); + @b[i] = sum((25 + i) % 100); + @c[i] = sum((50 + i) % 100); + @d[i] = sum((75 + i) % 100); +} + +tick-1ms +/i == 100 && j < 10/ +{ + printf("Sorted at position %d:\n", j); + setopt("aggsortpos", lltostr(j)); + printa("%9d %@9d %@9d %@9d %@9d %@9d %@9d\n", @a, @b, @c, @a, @d, @a); + printf("\n"); + j++; +} + +tick-1ms +/i == 100 && j == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d.out new file mode 100644 index 00000000..ce175391 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.sortpos.d.out @@ -0,0 +1,1021 @@ +Sorted at position 0: + 1 1 26 51 1 76 1 + 2 2 27 52 2 77 2 + 3 3 28 53 3 78 3 + 4 4 29 54 4 79 4 + 5 5 30 55 5 80 5 + 6 6 31 56 6 81 6 + 7 7 32 57 7 82 7 + 8 8 33 58 8 83 8 + 9 9 34 59 9 84 9 + 10 10 35 60 10 85 10 + 11 11 36 61 11 86 11 + 12 12 37 62 12 87 12 + 13 13 38 63 13 88 13 + 14 14 39 64 14 89 14 + 15 15 40 65 15 90 15 + 16 16 41 66 16 91 16 + 17 17 42 67 17 92 17 + 18 18 43 68 18 93 18 + 19 19 44 69 19 94 19 + 20 20 45 70 20 95 20 + 21 21 46 71 21 96 21 + 22 22 47 72 22 97 22 + 23 23 48 73 23 98 23 + 24 24 49 74 24 99 24 + 25 25 50 75 25 0 25 + 26 26 51 76 26 1 26 + 27 27 52 77 27 2 27 + 28 28 53 78 28 3 28 + 29 29 54 79 29 4 29 + 30 30 55 80 30 5 30 + 31 31 56 81 31 6 31 + 32 32 57 82 32 7 32 + 33 33 58 83 33 8 33 + 34 34 59 84 34 9 34 + 35 35 60 85 35 10 35 + 36 36 61 86 36 11 36 + 37 37 62 87 37 12 37 + 38 38 63 88 38 13 38 + 39 39 64 89 39 14 39 + 40 40 65 90 40 15 40 + 41 41 66 91 41 16 41 + 42 42 67 92 42 17 42 + 43 43 68 93 43 18 43 + 44 44 69 94 44 19 44 + 45 45 70 95 45 20 45 + 46 46 71 96 46 21 46 + 47 47 72 97 47 22 47 + 48 48 73 98 48 23 48 + 49 49 74 99 49 24 49 + 50 50 75 0 50 25 50 + 51 51 76 1 51 26 51 + 52 52 77 2 52 27 52 + 53 53 78 3 53 28 53 + 54 54 79 4 54 29 54 + 55 55 80 5 55 30 55 + 56 56 81 6 56 31 56 + 57 57 82 7 57 32 57 + 58 58 83 8 58 33 58 + 59 59 84 9 59 34 59 + 60 60 85 10 60 35 60 + 61 61 86 11 61 36 61 + 62 62 87 12 62 37 62 + 63 63 88 13 63 38 63 + 64 64 89 14 64 39 64 + 65 65 90 15 65 40 65 + 66 66 91 16 66 41 66 + 67 67 92 17 67 42 67 + 68 68 93 18 68 43 68 + 69 69 94 19 69 44 69 + 70 70 95 20 70 45 70 + 71 71 96 21 71 46 71 + 72 72 97 22 72 47 72 + 73 73 98 23 73 48 73 + 74 74 99 24 74 49 74 + 75 75 0 25 75 50 75 + 76 76 1 26 76 51 76 + 77 77 2 27 77 52 77 + 78 78 3 28 78 53 78 + 79 79 4 29 79 54 79 + 80 80 5 30 80 55 80 + 81 81 6 31 81 56 81 + 82 82 7 32 82 57 82 + 83 83 8 33 83 58 83 + 84 84 9 34 84 59 84 + 85 85 10 35 85 60 85 + 86 86 11 36 86 61 86 + 87 87 12 37 87 62 87 + 88 88 13 38 88 63 88 + 89 89 14 39 89 64 89 + 90 90 15 40 90 65 90 + 91 91 16 41 91 66 91 + 92 92 17 42 92 67 92 + 93 93 18 43 93 68 93 + 94 94 19 44 94 69 94 + 95 95 20 45 95 70 95 + 96 96 21 46 96 71 96 + 97 97 22 47 97 72 97 + 98 98 23 48 98 73 98 + 99 99 24 49 99 74 99 + 100 100 25 50 100 75 100 + +Sorted at position 1: + 75 75 0 25 75 50 75 + 76 76 1 26 76 51 76 + 77 77 2 27 77 52 77 + 78 78 3 28 78 53 78 + 79 79 4 29 79 54 79 + 80 80 5 30 80 55 80 + 81 81 6 31 81 56 81 + 82 82 7 32 82 57 82 + 83 83 8 33 83 58 83 + 84 84 9 34 84 59 84 + 85 85 10 35 85 60 85 + 86 86 11 36 86 61 86 + 87 87 12 37 87 62 87 + 88 88 13 38 88 63 88 + 89 89 14 39 89 64 89 + 90 90 15 40 90 65 90 + 91 91 16 41 91 66 91 + 92 92 17 42 92 67 92 + 93 93 18 43 93 68 93 + 94 94 19 44 94 69 94 + 95 95 20 45 95 70 95 + 96 96 21 46 96 71 96 + 97 97 22 47 97 72 97 + 98 98 23 48 98 73 98 + 99 99 24 49 99 74 99 + 100 100 25 50 100 75 100 + 1 1 26 51 1 76 1 + 2 2 27 52 2 77 2 + 3 3 28 53 3 78 3 + 4 4 29 54 4 79 4 + 5 5 30 55 5 80 5 + 6 6 31 56 6 81 6 + 7 7 32 57 7 82 7 + 8 8 33 58 8 83 8 + 9 9 34 59 9 84 9 + 10 10 35 60 10 85 10 + 11 11 36 61 11 86 11 + 12 12 37 62 12 87 12 + 13 13 38 63 13 88 13 + 14 14 39 64 14 89 14 + 15 15 40 65 15 90 15 + 16 16 41 66 16 91 16 + 17 17 42 67 17 92 17 + 18 18 43 68 18 93 18 + 19 19 44 69 19 94 19 + 20 20 45 70 20 95 20 + 21 21 46 71 21 96 21 + 22 22 47 72 22 97 22 + 23 23 48 73 23 98 23 + 24 24 49 74 24 99 24 + 25 25 50 75 25 0 25 + 26 26 51 76 26 1 26 + 27 27 52 77 27 2 27 + 28 28 53 78 28 3 28 + 29 29 54 79 29 4 29 + 30 30 55 80 30 5 30 + 31 31 56 81 31 6 31 + 32 32 57 82 32 7 32 + 33 33 58 83 33 8 33 + 34 34 59 84 34 9 34 + 35 35 60 85 35 10 35 + 36 36 61 86 36 11 36 + 37 37 62 87 37 12 37 + 38 38 63 88 38 13 38 + 39 39 64 89 39 14 39 + 40 40 65 90 40 15 40 + 41 41 66 91 41 16 41 + 42 42 67 92 42 17 42 + 43 43 68 93 43 18 43 + 44 44 69 94 44 19 44 + 45 45 70 95 45 20 45 + 46 46 71 96 46 21 46 + 47 47 72 97 47 22 47 + 48 48 73 98 48 23 48 + 49 49 74 99 49 24 49 + 50 50 75 0 50 25 50 + 51 51 76 1 51 26 51 + 52 52 77 2 52 27 52 + 53 53 78 3 53 28 53 + 54 54 79 4 54 29 54 + 55 55 80 5 55 30 55 + 56 56 81 6 56 31 56 + 57 57 82 7 57 32 57 + 58 58 83 8 58 33 58 + 59 59 84 9 59 34 59 + 60 60 85 10 60 35 60 + 61 61 86 11 61 36 61 + 62 62 87 12 62 37 62 + 63 63 88 13 63 38 63 + 64 64 89 14 64 39 64 + 65 65 90 15 65 40 65 + 66 66 91 16 66 41 66 + 67 67 92 17 67 42 67 + 68 68 93 18 68 43 68 + 69 69 94 19 69 44 69 + 70 70 95 20 70 45 70 + 71 71 96 21 71 46 71 + 72 72 97 22 72 47 72 + 73 73 98 23 73 48 73 + 74 74 99 24 74 49 74 + +Sorted at position 2: + 50 50 75 0 50 25 50 + 51 51 76 1 51 26 51 + 52 52 77 2 52 27 52 + 53 53 78 3 53 28 53 + 54 54 79 4 54 29 54 + 55 55 80 5 55 30 55 + 56 56 81 6 56 31 56 + 57 57 82 7 57 32 57 + 58 58 83 8 58 33 58 + 59 59 84 9 59 34 59 + 60 60 85 10 60 35 60 + 61 61 86 11 61 36 61 + 62 62 87 12 62 37 62 + 63 63 88 13 63 38 63 + 64 64 89 14 64 39 64 + 65 65 90 15 65 40 65 + 66 66 91 16 66 41 66 + 67 67 92 17 67 42 67 + 68 68 93 18 68 43 68 + 69 69 94 19 69 44 69 + 70 70 95 20 70 45 70 + 71 71 96 21 71 46 71 + 72 72 97 22 72 47 72 + 73 73 98 23 73 48 73 + 74 74 99 24 74 49 74 + 75 75 0 25 75 50 75 + 76 76 1 26 76 51 76 + 77 77 2 27 77 52 77 + 78 78 3 28 78 53 78 + 79 79 4 29 79 54 79 + 80 80 5 30 80 55 80 + 81 81 6 31 81 56 81 + 82 82 7 32 82 57 82 + 83 83 8 33 83 58 83 + 84 84 9 34 84 59 84 + 85 85 10 35 85 60 85 + 86 86 11 36 86 61 86 + 87 87 12 37 87 62 87 + 88 88 13 38 88 63 88 + 89 89 14 39 89 64 89 + 90 90 15 40 90 65 90 + 91 91 16 41 91 66 91 + 92 92 17 42 92 67 92 + 93 93 18 43 93 68 93 + 94 94 19 44 94 69 94 + 95 95 20 45 95 70 95 + 96 96 21 46 96 71 96 + 97 97 22 47 97 72 97 + 98 98 23 48 98 73 98 + 99 99 24 49 99 74 99 + 100 100 25 50 100 75 100 + 1 1 26 51 1 76 1 + 2 2 27 52 2 77 2 + 3 3 28 53 3 78 3 + 4 4 29 54 4 79 4 + 5 5 30 55 5 80 5 + 6 6 31 56 6 81 6 + 7 7 32 57 7 82 7 + 8 8 33 58 8 83 8 + 9 9 34 59 9 84 9 + 10 10 35 60 10 85 10 + 11 11 36 61 11 86 11 + 12 12 37 62 12 87 12 + 13 13 38 63 13 88 13 + 14 14 39 64 14 89 14 + 15 15 40 65 15 90 15 + 16 16 41 66 16 91 16 + 17 17 42 67 17 92 17 + 18 18 43 68 18 93 18 + 19 19 44 69 19 94 19 + 20 20 45 70 20 95 20 + 21 21 46 71 21 96 21 + 22 22 47 72 22 97 22 + 23 23 48 73 23 98 23 + 24 24 49 74 24 99 24 + 25 25 50 75 25 0 25 + 26 26 51 76 26 1 26 + 27 27 52 77 27 2 27 + 28 28 53 78 28 3 28 + 29 29 54 79 29 4 29 + 30 30 55 80 30 5 30 + 31 31 56 81 31 6 31 + 32 32 57 82 32 7 32 + 33 33 58 83 33 8 33 + 34 34 59 84 34 9 34 + 35 35 60 85 35 10 35 + 36 36 61 86 36 11 36 + 37 37 62 87 37 12 37 + 38 38 63 88 38 13 38 + 39 39 64 89 39 14 39 + 40 40 65 90 40 15 40 + 41 41 66 91 41 16 41 + 42 42 67 92 42 17 42 + 43 43 68 93 43 18 43 + 44 44 69 94 44 19 44 + 45 45 70 95 45 20 45 + 46 46 71 96 46 21 46 + 47 47 72 97 47 22 47 + 48 48 73 98 48 23 48 + 49 49 74 99 49 24 49 + +Sorted at position 3: + 1 1 26 51 1 76 1 + 2 2 27 52 2 77 2 + 3 3 28 53 3 78 3 + 4 4 29 54 4 79 4 + 5 5 30 55 5 80 5 + 6 6 31 56 6 81 6 + 7 7 32 57 7 82 7 + 8 8 33 58 8 83 8 + 9 9 34 59 9 84 9 + 10 10 35 60 10 85 10 + 11 11 36 61 11 86 11 + 12 12 37 62 12 87 12 + 13 13 38 63 13 88 13 + 14 14 39 64 14 89 14 + 15 15 40 65 15 90 15 + 16 16 41 66 16 91 16 + 17 17 42 67 17 92 17 + 18 18 43 68 18 93 18 + 19 19 44 69 19 94 19 + 20 20 45 70 20 95 20 + 21 21 46 71 21 96 21 + 22 22 47 72 22 97 22 + 23 23 48 73 23 98 23 + 24 24 49 74 24 99 24 + 25 25 50 75 25 0 25 + 26 26 51 76 26 1 26 + 27 27 52 77 27 2 27 + 28 28 53 78 28 3 28 + 29 29 54 79 29 4 29 + 30 30 55 80 30 5 30 + 31 31 56 81 31 6 31 + 32 32 57 82 32 7 32 + 33 33 58 83 33 8 33 + 34 34 59 84 34 9 34 + 35 35 60 85 35 10 35 + 36 36 61 86 36 11 36 + 37 37 62 87 37 12 37 + 38 38 63 88 38 13 38 + 39 39 64 89 39 14 39 + 40 40 65 90 40 15 40 + 41 41 66 91 41 16 41 + 42 42 67 92 42 17 42 + 43 43 68 93 43 18 43 + 44 44 69 94 44 19 44 + 45 45 70 95 45 20 45 + 46 46 71 96 46 21 46 + 47 47 72 97 47 22 47 + 48 48 73 98 48 23 48 + 49 49 74 99 49 24 49 + 50 50 75 0 50 25 50 + 51 51 76 1 51 26 51 + 52 52 77 2 52 27 52 + 53 53 78 3 53 28 53 + 54 54 79 4 54 29 54 + 55 55 80 5 55 30 55 + 56 56 81 6 56 31 56 + 57 57 82 7 57 32 57 + 58 58 83 8 58 33 58 + 59 59 84 9 59 34 59 + 60 60 85 10 60 35 60 + 61 61 86 11 61 36 61 + 62 62 87 12 62 37 62 + 63 63 88 13 63 38 63 + 64 64 89 14 64 39 64 + 65 65 90 15 65 40 65 + 66 66 91 16 66 41 66 + 67 67 92 17 67 42 67 + 68 68 93 18 68 43 68 + 69 69 94 19 69 44 69 + 70 70 95 20 70 45 70 + 71 71 96 21 71 46 71 + 72 72 97 22 72 47 72 + 73 73 98 23 73 48 73 + 74 74 99 24 74 49 74 + 75 75 0 25 75 50 75 + 76 76 1 26 76 51 76 + 77 77 2 27 77 52 77 + 78 78 3 28 78 53 78 + 79 79 4 29 79 54 79 + 80 80 5 30 80 55 80 + 81 81 6 31 81 56 81 + 82 82 7 32 82 57 82 + 83 83 8 33 83 58 83 + 84 84 9 34 84 59 84 + 85 85 10 35 85 60 85 + 86 86 11 36 86 61 86 + 87 87 12 37 87 62 87 + 88 88 13 38 88 63 88 + 89 89 14 39 89 64 89 + 90 90 15 40 90 65 90 + 91 91 16 41 91 66 91 + 92 92 17 42 92 67 92 + 93 93 18 43 93 68 93 + 94 94 19 44 94 69 94 + 95 95 20 45 95 70 95 + 96 96 21 46 96 71 96 + 97 97 22 47 97 72 97 + 98 98 23 48 98 73 98 + 99 99 24 49 99 74 99 + 100 100 25 50 100 75 100 + +Sorted at position 4: + 25 25 50 75 25 0 25 + 26 26 51 76 26 1 26 + 27 27 52 77 27 2 27 + 28 28 53 78 28 3 28 + 29 29 54 79 29 4 29 + 30 30 55 80 30 5 30 + 31 31 56 81 31 6 31 + 32 32 57 82 32 7 32 + 33 33 58 83 33 8 33 + 34 34 59 84 34 9 34 + 35 35 60 85 35 10 35 + 36 36 61 86 36 11 36 + 37 37 62 87 37 12 37 + 38 38 63 88 38 13 38 + 39 39 64 89 39 14 39 + 40 40 65 90 40 15 40 + 41 41 66 91 41 16 41 + 42 42 67 92 42 17 42 + 43 43 68 93 43 18 43 + 44 44 69 94 44 19 44 + 45 45 70 95 45 20 45 + 46 46 71 96 46 21 46 + 47 47 72 97 47 22 47 + 48 48 73 98 48 23 48 + 49 49 74 99 49 24 49 + 50 50 75 0 50 25 50 + 51 51 76 1 51 26 51 + 52 52 77 2 52 27 52 + 53 53 78 3 53 28 53 + 54 54 79 4 54 29 54 + 55 55 80 5 55 30 55 + 56 56 81 6 56 31 56 + 57 57 82 7 57 32 57 + 58 58 83 8 58 33 58 + 59 59 84 9 59 34 59 + 60 60 85 10 60 35 60 + 61 61 86 11 61 36 61 + 62 62 87 12 62 37 62 + 63 63 88 13 63 38 63 + 64 64 89 14 64 39 64 + 65 65 90 15 65 40 65 + 66 66 91 16 66 41 66 + 67 67 92 17 67 42 67 + 68 68 93 18 68 43 68 + 69 69 94 19 69 44 69 + 70 70 95 20 70 45 70 + 71 71 96 21 71 46 71 + 72 72 97 22 72 47 72 + 73 73 98 23 73 48 73 + 74 74 99 24 74 49 74 + 75 75 0 25 75 50 75 + 76 76 1 26 76 51 76 + 77 77 2 27 77 52 77 + 78 78 3 28 78 53 78 + 79 79 4 29 79 54 79 + 80 80 5 30 80 55 80 + 81 81 6 31 81 56 81 + 82 82 7 32 82 57 82 + 83 83 8 33 83 58 83 + 84 84 9 34 84 59 84 + 85 85 10 35 85 60 85 + 86 86 11 36 86 61 86 + 87 87 12 37 87 62 87 + 88 88 13 38 88 63 88 + 89 89 14 39 89 64 89 + 90 90 15 40 90 65 90 + 91 91 16 41 91 66 91 + 92 92 17 42 92 67 92 + 93 93 18 43 93 68 93 + 94 94 19 44 94 69 94 + 95 95 20 45 95 70 95 + 96 96 21 46 96 71 96 + 97 97 22 47 97 72 97 + 98 98 23 48 98 73 98 + 99 99 24 49 99 74 99 + 100 100 25 50 100 75 100 + 1 1 26 51 1 76 1 + 2 2 27 52 2 77 2 + 3 3 28 53 3 78 3 + 4 4 29 54 4 79 4 + 5 5 30 55 5 80 5 + 6 6 31 56 6 81 6 + 7 7 32 57 7 82 7 + 8 8 33 58 8 83 8 + 9 9 34 59 9 84 9 + 10 10 35 60 10 85 10 + 11 11 36 61 11 86 11 + 12 12 37 62 12 87 12 + 13 13 38 63 13 88 13 + 14 14 39 64 14 89 14 + 15 15 40 65 15 90 15 + 16 16 41 66 16 91 16 + 17 17 42 67 17 92 17 + 18 18 43 68 18 93 18 + 19 19 44 69 19 94 19 + 20 20 45 70 20 95 20 + 21 21 46 71 21 96 21 + 22 22 47 72 22 97 22 + 23 23 48 73 23 98 23 + 24 24 49 74 24 99 24 + +Sorted at position 5: + 1 1 26 51 1 76 1 + 2 2 27 52 2 77 2 + 3 3 28 53 3 78 3 + 4 4 29 54 4 79 4 + 5 5 30 55 5 80 5 + 6 6 31 56 6 81 6 + 7 7 32 57 7 82 7 + 8 8 33 58 8 83 8 + 9 9 34 59 9 84 9 + 10 10 35 60 10 85 10 + 11 11 36 61 11 86 11 + 12 12 37 62 12 87 12 + 13 13 38 63 13 88 13 + 14 14 39 64 14 89 14 + 15 15 40 65 15 90 15 + 16 16 41 66 16 91 16 + 17 17 42 67 17 92 17 + 18 18 43 68 18 93 18 + 19 19 44 69 19 94 19 + 20 20 45 70 20 95 20 + 21 21 46 71 21 96 21 + 22 22 47 72 22 97 22 + 23 23 48 73 23 98 23 + 24 24 49 74 24 99 24 + 25 25 50 75 25 0 25 + 26 26 51 76 26 1 26 + 27 27 52 77 27 2 27 + 28 28 53 78 28 3 28 + 29 29 54 79 29 4 29 + 30 30 55 80 30 5 30 + 31 31 56 81 31 6 31 + 32 32 57 82 32 7 32 + 33 33 58 83 33 8 33 + 34 34 59 84 34 9 34 + 35 35 60 85 35 10 35 + 36 36 61 86 36 11 36 + 37 37 62 87 37 12 37 + 38 38 63 88 38 13 38 + 39 39 64 89 39 14 39 + 40 40 65 90 40 15 40 + 41 41 66 91 41 16 41 + 42 42 67 92 42 17 42 + 43 43 68 93 43 18 43 + 44 44 69 94 44 19 44 + 45 45 70 95 45 20 45 + 46 46 71 96 46 21 46 + 47 47 72 97 47 22 47 + 48 48 73 98 48 23 48 + 49 49 74 99 49 24 49 + 50 50 75 0 50 25 50 + 51 51 76 1 51 26 51 + 52 52 77 2 52 27 52 + 53 53 78 3 53 28 53 + 54 54 79 4 54 29 54 + 55 55 80 5 55 30 55 + 56 56 81 6 56 31 56 + 57 57 82 7 57 32 57 + 58 58 83 8 58 33 58 + 59 59 84 9 59 34 59 + 60 60 85 10 60 35 60 + 61 61 86 11 61 36 61 + 62 62 87 12 62 37 62 + 63 63 88 13 63 38 63 + 64 64 89 14 64 39 64 + 65 65 90 15 65 40 65 + 66 66 91 16 66 41 66 + 67 67 92 17 67 42 67 + 68 68 93 18 68 43 68 + 69 69 94 19 69 44 69 + 70 70 95 20 70 45 70 + 71 71 96 21 71 46 71 + 72 72 97 22 72 47 72 + 73 73 98 23 73 48 73 + 74 74 99 24 74 49 74 + 75 75 0 25 75 50 75 + 76 76 1 26 76 51 76 + 77 77 2 27 77 52 77 + 78 78 3 28 78 53 78 + 79 79 4 29 79 54 79 + 80 80 5 30 80 55 80 + 81 81 6 31 81 56 81 + 82 82 7 32 82 57 82 + 83 83 8 33 83 58 83 + 84 84 9 34 84 59 84 + 85 85 10 35 85 60 85 + 86 86 11 36 86 61 86 + 87 87 12 37 87 62 87 + 88 88 13 38 88 63 88 + 89 89 14 39 89 64 89 + 90 90 15 40 90 65 90 + 91 91 16 41 91 66 91 + 92 92 17 42 92 67 92 + 93 93 18 43 93 68 93 + 94 94 19 44 94 69 94 + 95 95 20 45 95 70 95 + 96 96 21 46 96 71 96 + 97 97 22 47 97 72 97 + 98 98 23 48 98 73 98 + 99 99 24 49 99 74 99 + 100 100 25 50 100 75 100 + +Sorted at position 6: + 1 1 26 51 1 76 1 + 2 2 27 52 2 77 2 + 3 3 28 53 3 78 3 + 4 4 29 54 4 79 4 + 5 5 30 55 5 80 5 + 6 6 31 56 6 81 6 + 7 7 32 57 7 82 7 + 8 8 33 58 8 83 8 + 9 9 34 59 9 84 9 + 10 10 35 60 10 85 10 + 11 11 36 61 11 86 11 + 12 12 37 62 12 87 12 + 13 13 38 63 13 88 13 + 14 14 39 64 14 89 14 + 15 15 40 65 15 90 15 + 16 16 41 66 16 91 16 + 17 17 42 67 17 92 17 + 18 18 43 68 18 93 18 + 19 19 44 69 19 94 19 + 20 20 45 70 20 95 20 + 21 21 46 71 21 96 21 + 22 22 47 72 22 97 22 + 23 23 48 73 23 98 23 + 24 24 49 74 24 99 24 + 25 25 50 75 25 0 25 + 26 26 51 76 26 1 26 + 27 27 52 77 27 2 27 + 28 28 53 78 28 3 28 + 29 29 54 79 29 4 29 + 30 30 55 80 30 5 30 + 31 31 56 81 31 6 31 + 32 32 57 82 32 7 32 + 33 33 58 83 33 8 33 + 34 34 59 84 34 9 34 + 35 35 60 85 35 10 35 + 36 36 61 86 36 11 36 + 37 37 62 87 37 12 37 + 38 38 63 88 38 13 38 + 39 39 64 89 39 14 39 + 40 40 65 90 40 15 40 + 41 41 66 91 41 16 41 + 42 42 67 92 42 17 42 + 43 43 68 93 43 18 43 + 44 44 69 94 44 19 44 + 45 45 70 95 45 20 45 + 46 46 71 96 46 21 46 + 47 47 72 97 47 22 47 + 48 48 73 98 48 23 48 + 49 49 74 99 49 24 49 + 50 50 75 0 50 25 50 + 51 51 76 1 51 26 51 + 52 52 77 2 52 27 52 + 53 53 78 3 53 28 53 + 54 54 79 4 54 29 54 + 55 55 80 5 55 30 55 + 56 56 81 6 56 31 56 + 57 57 82 7 57 32 57 + 58 58 83 8 58 33 58 + 59 59 84 9 59 34 59 + 60 60 85 10 60 35 60 + 61 61 86 11 61 36 61 + 62 62 87 12 62 37 62 + 63 63 88 13 63 38 63 + 64 64 89 14 64 39 64 + 65 65 90 15 65 40 65 + 66 66 91 16 66 41 66 + 67 67 92 17 67 42 67 + 68 68 93 18 68 43 68 + 69 69 94 19 69 44 69 + 70 70 95 20 70 45 70 + 71 71 96 21 71 46 71 + 72 72 97 22 72 47 72 + 73 73 98 23 73 48 73 + 74 74 99 24 74 49 74 + 75 75 0 25 75 50 75 + 76 76 1 26 76 51 76 + 77 77 2 27 77 52 77 + 78 78 3 28 78 53 78 + 79 79 4 29 79 54 79 + 80 80 5 30 80 55 80 + 81 81 6 31 81 56 81 + 82 82 7 32 82 57 82 + 83 83 8 33 83 58 83 + 84 84 9 34 84 59 84 + 85 85 10 35 85 60 85 + 86 86 11 36 86 61 86 + 87 87 12 37 87 62 87 + 88 88 13 38 88 63 88 + 89 89 14 39 89 64 89 + 90 90 15 40 90 65 90 + 91 91 16 41 91 66 91 + 92 92 17 42 92 67 92 + 93 93 18 43 93 68 93 + 94 94 19 44 94 69 94 + 95 95 20 45 95 70 95 + 96 96 21 46 96 71 96 + 97 97 22 47 97 72 97 + 98 98 23 48 98 73 98 + 99 99 24 49 99 74 99 + 100 100 25 50 100 75 100 + +Sorted at position 7: + 1 1 26 51 1 76 1 + 2 2 27 52 2 77 2 + 3 3 28 53 3 78 3 + 4 4 29 54 4 79 4 + 5 5 30 55 5 80 5 + 6 6 31 56 6 81 6 + 7 7 32 57 7 82 7 + 8 8 33 58 8 83 8 + 9 9 34 59 9 84 9 + 10 10 35 60 10 85 10 + 11 11 36 61 11 86 11 + 12 12 37 62 12 87 12 + 13 13 38 63 13 88 13 + 14 14 39 64 14 89 14 + 15 15 40 65 15 90 15 + 16 16 41 66 16 91 16 + 17 17 42 67 17 92 17 + 18 18 43 68 18 93 18 + 19 19 44 69 19 94 19 + 20 20 45 70 20 95 20 + 21 21 46 71 21 96 21 + 22 22 47 72 22 97 22 + 23 23 48 73 23 98 23 + 24 24 49 74 24 99 24 + 25 25 50 75 25 0 25 + 26 26 51 76 26 1 26 + 27 27 52 77 27 2 27 + 28 28 53 78 28 3 28 + 29 29 54 79 29 4 29 + 30 30 55 80 30 5 30 + 31 31 56 81 31 6 31 + 32 32 57 82 32 7 32 + 33 33 58 83 33 8 33 + 34 34 59 84 34 9 34 + 35 35 60 85 35 10 35 + 36 36 61 86 36 11 36 + 37 37 62 87 37 12 37 + 38 38 63 88 38 13 38 + 39 39 64 89 39 14 39 + 40 40 65 90 40 15 40 + 41 41 66 91 41 16 41 + 42 42 67 92 42 17 42 + 43 43 68 93 43 18 43 + 44 44 69 94 44 19 44 + 45 45 70 95 45 20 45 + 46 46 71 96 46 21 46 + 47 47 72 97 47 22 47 + 48 48 73 98 48 23 48 + 49 49 74 99 49 24 49 + 50 50 75 0 50 25 50 + 51 51 76 1 51 26 51 + 52 52 77 2 52 27 52 + 53 53 78 3 53 28 53 + 54 54 79 4 54 29 54 + 55 55 80 5 55 30 55 + 56 56 81 6 56 31 56 + 57 57 82 7 57 32 57 + 58 58 83 8 58 33 58 + 59 59 84 9 59 34 59 + 60 60 85 10 60 35 60 + 61 61 86 11 61 36 61 + 62 62 87 12 62 37 62 + 63 63 88 13 63 38 63 + 64 64 89 14 64 39 64 + 65 65 90 15 65 40 65 + 66 66 91 16 66 41 66 + 67 67 92 17 67 42 67 + 68 68 93 18 68 43 68 + 69 69 94 19 69 44 69 + 70 70 95 20 70 45 70 + 71 71 96 21 71 46 71 + 72 72 97 22 72 47 72 + 73 73 98 23 73 48 73 + 74 74 99 24 74 49 74 + 75 75 0 25 75 50 75 + 76 76 1 26 76 51 76 + 77 77 2 27 77 52 77 + 78 78 3 28 78 53 78 + 79 79 4 29 79 54 79 + 80 80 5 30 80 55 80 + 81 81 6 31 81 56 81 + 82 82 7 32 82 57 82 + 83 83 8 33 83 58 83 + 84 84 9 34 84 59 84 + 85 85 10 35 85 60 85 + 86 86 11 36 86 61 86 + 87 87 12 37 87 62 87 + 88 88 13 38 88 63 88 + 89 89 14 39 89 64 89 + 90 90 15 40 90 65 90 + 91 91 16 41 91 66 91 + 92 92 17 42 92 67 92 + 93 93 18 43 93 68 93 + 94 94 19 44 94 69 94 + 95 95 20 45 95 70 95 + 96 96 21 46 96 71 96 + 97 97 22 47 97 72 97 + 98 98 23 48 98 73 98 + 99 99 24 49 99 74 99 + 100 100 25 50 100 75 100 + +Sorted at position 8: + 1 1 26 51 1 76 1 + 2 2 27 52 2 77 2 + 3 3 28 53 3 78 3 + 4 4 29 54 4 79 4 + 5 5 30 55 5 80 5 + 6 6 31 56 6 81 6 + 7 7 32 57 7 82 7 + 8 8 33 58 8 83 8 + 9 9 34 59 9 84 9 + 10 10 35 60 10 85 10 + 11 11 36 61 11 86 11 + 12 12 37 62 12 87 12 + 13 13 38 63 13 88 13 + 14 14 39 64 14 89 14 + 15 15 40 65 15 90 15 + 16 16 41 66 16 91 16 + 17 17 42 67 17 92 17 + 18 18 43 68 18 93 18 + 19 19 44 69 19 94 19 + 20 20 45 70 20 95 20 + 21 21 46 71 21 96 21 + 22 22 47 72 22 97 22 + 23 23 48 73 23 98 23 + 24 24 49 74 24 99 24 + 25 25 50 75 25 0 25 + 26 26 51 76 26 1 26 + 27 27 52 77 27 2 27 + 28 28 53 78 28 3 28 + 29 29 54 79 29 4 29 + 30 30 55 80 30 5 30 + 31 31 56 81 31 6 31 + 32 32 57 82 32 7 32 + 33 33 58 83 33 8 33 + 34 34 59 84 34 9 34 + 35 35 60 85 35 10 35 + 36 36 61 86 36 11 36 + 37 37 62 87 37 12 37 + 38 38 63 88 38 13 38 + 39 39 64 89 39 14 39 + 40 40 65 90 40 15 40 + 41 41 66 91 41 16 41 + 42 42 67 92 42 17 42 + 43 43 68 93 43 18 43 + 44 44 69 94 44 19 44 + 45 45 70 95 45 20 45 + 46 46 71 96 46 21 46 + 47 47 72 97 47 22 47 + 48 48 73 98 48 23 48 + 49 49 74 99 49 24 49 + 50 50 75 0 50 25 50 + 51 51 76 1 51 26 51 + 52 52 77 2 52 27 52 + 53 53 78 3 53 28 53 + 54 54 79 4 54 29 54 + 55 55 80 5 55 30 55 + 56 56 81 6 56 31 56 + 57 57 82 7 57 32 57 + 58 58 83 8 58 33 58 + 59 59 84 9 59 34 59 + 60 60 85 10 60 35 60 + 61 61 86 11 61 36 61 + 62 62 87 12 62 37 62 + 63 63 88 13 63 38 63 + 64 64 89 14 64 39 64 + 65 65 90 15 65 40 65 + 66 66 91 16 66 41 66 + 67 67 92 17 67 42 67 + 68 68 93 18 68 43 68 + 69 69 94 19 69 44 69 + 70 70 95 20 70 45 70 + 71 71 96 21 71 46 71 + 72 72 97 22 72 47 72 + 73 73 98 23 73 48 73 + 74 74 99 24 74 49 74 + 75 75 0 25 75 50 75 + 76 76 1 26 76 51 76 + 77 77 2 27 77 52 77 + 78 78 3 28 78 53 78 + 79 79 4 29 79 54 79 + 80 80 5 30 80 55 80 + 81 81 6 31 81 56 81 + 82 82 7 32 82 57 82 + 83 83 8 33 83 58 83 + 84 84 9 34 84 59 84 + 85 85 10 35 85 60 85 + 86 86 11 36 86 61 86 + 87 87 12 37 87 62 87 + 88 88 13 38 88 63 88 + 89 89 14 39 89 64 89 + 90 90 15 40 90 65 90 + 91 91 16 41 91 66 91 + 92 92 17 42 92 67 92 + 93 93 18 43 93 68 93 + 94 94 19 44 94 69 94 + 95 95 20 45 95 70 95 + 96 96 21 46 96 71 96 + 97 97 22 47 97 72 97 + 98 98 23 48 98 73 98 + 99 99 24 49 99 74 99 + 100 100 25 50 100 75 100 + +Sorted at position 9: + 1 1 26 51 1 76 1 + 2 2 27 52 2 77 2 + 3 3 28 53 3 78 3 + 4 4 29 54 4 79 4 + 5 5 30 55 5 80 5 + 6 6 31 56 6 81 6 + 7 7 32 57 7 82 7 + 8 8 33 58 8 83 8 + 9 9 34 59 9 84 9 + 10 10 35 60 10 85 10 + 11 11 36 61 11 86 11 + 12 12 37 62 12 87 12 + 13 13 38 63 13 88 13 + 14 14 39 64 14 89 14 + 15 15 40 65 15 90 15 + 16 16 41 66 16 91 16 + 17 17 42 67 17 92 17 + 18 18 43 68 18 93 18 + 19 19 44 69 19 94 19 + 20 20 45 70 20 95 20 + 21 21 46 71 21 96 21 + 22 22 47 72 22 97 22 + 23 23 48 73 23 98 23 + 24 24 49 74 24 99 24 + 25 25 50 75 25 0 25 + 26 26 51 76 26 1 26 + 27 27 52 77 27 2 27 + 28 28 53 78 28 3 28 + 29 29 54 79 29 4 29 + 30 30 55 80 30 5 30 + 31 31 56 81 31 6 31 + 32 32 57 82 32 7 32 + 33 33 58 83 33 8 33 + 34 34 59 84 34 9 34 + 35 35 60 85 35 10 35 + 36 36 61 86 36 11 36 + 37 37 62 87 37 12 37 + 38 38 63 88 38 13 38 + 39 39 64 89 39 14 39 + 40 40 65 90 40 15 40 + 41 41 66 91 41 16 41 + 42 42 67 92 42 17 42 + 43 43 68 93 43 18 43 + 44 44 69 94 44 19 44 + 45 45 70 95 45 20 45 + 46 46 71 96 46 21 46 + 47 47 72 97 47 22 47 + 48 48 73 98 48 23 48 + 49 49 74 99 49 24 49 + 50 50 75 0 50 25 50 + 51 51 76 1 51 26 51 + 52 52 77 2 52 27 52 + 53 53 78 3 53 28 53 + 54 54 79 4 54 29 54 + 55 55 80 5 55 30 55 + 56 56 81 6 56 31 56 + 57 57 82 7 57 32 57 + 58 58 83 8 58 33 58 + 59 59 84 9 59 34 59 + 60 60 85 10 60 35 60 + 61 61 86 11 61 36 61 + 62 62 87 12 62 37 62 + 63 63 88 13 63 38 63 + 64 64 89 14 64 39 64 + 65 65 90 15 65 40 65 + 66 66 91 16 66 41 66 + 67 67 92 17 67 42 67 + 68 68 93 18 68 43 68 + 69 69 94 19 69 44 69 + 70 70 95 20 70 45 70 + 71 71 96 21 71 46 71 + 72 72 97 22 72 47 72 + 73 73 98 23 73 48 73 + 74 74 99 24 74 49 74 + 75 75 0 25 75 50 75 + 76 76 1 26 76 51 76 + 77 77 2 27 77 52 77 + 78 78 3 28 78 53 78 + 79 79 4 29 79 54 79 + 80 80 5 30 80 55 80 + 81 81 6 31 81 56 81 + 82 82 7 32 82 57 82 + 83 83 8 33 83 58 83 + 84 84 9 34 84 59 84 + 85 85 10 35 85 60 85 + 86 86 11 36 86 61 86 + 87 87 12 37 87 62 87 + 88 88 13 38 88 63 88 + 89 89 14 39 89 64 89 + 90 90 15 40 90 65 90 + 91 91 16 41 91 66 91 + 92 92 17 42 92 67 92 + 93 93 18 43 93 68 93 + 94 94 19 44 94 69 94 + 95 95 20 45 95 70 95 + 96 96 21 46 96 71 96 + 97 97 22 47 97 72 97 + 98 98 23 48 98 73 98 + 99 99 24 49 99 74 99 + 100 100 25 50 100 75 100 + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d new file mode 100644 index 00000000..ebb916a0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d @@ -0,0 +1,37 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + @one["foo", 789, "bar", curthread] = sum(123); + @two["foo", 789, "bar", curthread] = sum(456); + printa("%10s %10d %10s %@10d %@10d\n", @one, @two); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d.out new file mode 100644 index 00000000..002f5aa1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.tuplecompat.d.out @@ -0,0 +1,2 @@ + foo 789 bar 123 456 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d new file mode 100644 index 00000000..5a57b2b0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +/0/ +{ + @bop[345] = quantize(0); + @baz[345] = lquantize(0, -10, 10, 1); +} + +BEGIN +{ + @foo[123] = sum(123); + @bar[456] = sum(456); + + @foo[789] = sum(789); + @bar[789] = sum(789); + + printa("%10d %@10d %@10d\n", @foo, @bar); + printa("%10d %@10d %@10d %@10d\n", @foo, @bar, @bop); + printa("%10d %@10d %@10d %@10d %@10d\n", @foo, @bar, @bop, @baz); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d.out new file mode 100644 index 00000000..dde9e41c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero.d.out @@ -0,0 +1,55 @@ + 456 0 456 + 123 123 0 + 789 789 789 + 456 0 456 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + 123 123 0 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + 789 789 789 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + 456 0 456 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + value ------------- Distribution ------------- count + < -10 | 0 + -10 | 0 + -9 | 0 + + 123 123 0 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + value ------------- Distribution ------------- count + < -10 | 0 + -10 | 0 + -9 | 0 + + 789 789 789 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + value ------------- Distribution ------------- count + < -10 | 0 + -10 | 0 + -9 | 0 + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d new file mode 100644 index 00000000..79e756bd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + @bop[345] = quantize(0, 0); + @baz[345] = lquantize(0, -10, 10, 1, 0); +} + +BEGIN +{ + @foo[123] = sum(123); + @bar[456] = sum(456); + + @foo[789] = sum(789); + @bar[789] = sum(789); + + printa("%10d %@10d %@10d\n", @foo, @bar); + printa("%10d %@10d %@10d %@10d\n", @foo, @bar, @bop); + printa("%10d %@10d %@10d %@10d %@10d\n", @foo, @bar, @bop, @baz); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d.out new file mode 100644 index 00000000..9b28d8e7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero2.d.out @@ -0,0 +1,72 @@ + 456 0 456 + 123 123 0 + 789 789 789 + 345 0 0 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + 456 0 456 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + 123 123 0 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + 789 789 789 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + 345 0 0 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + value ------------- Distribution ------------- count + < -10 | 0 + -10 | 0 + -9 | 0 + + 456 0 456 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + value ------------- Distribution ------------- count + < -10 | 0 + -10 | 0 + -9 | 0 + + 123 123 0 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + value ------------- Distribution ------------- count + < -10 | 0 + -10 | 0 + -9 | 0 + + 789 789 789 + value ------------- Distribution ------------- count + -1 | 0 + 0 | 0 + 1 | 0 + + value ------------- Distribution ------------- count + < -10 | 0 + -10 | 0 + -9 | 0 + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d new file mode 100644 index 00000000..bc17bc96 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +/0/ +{ + @bop[345] = quantize(0, 0); + @baz[345] = lquantize(0, -10, 10, 1, 0); +} + +BEGIN +{ + printa(@bop); + printa(@baz); + printa("%@10d %@10d\n", @bop, @baz); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d.out new file mode 100644 index 00000000..b28b04f6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/multiaggs/tst.zero3.d.out @@ -0,0 +1,3 @@ + + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call.c new file mode 100644 index 00000000..6194c580 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call.c @@ -0,0 +1,120 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <strings.h> +#include <rpc/rpc.h> + +#include "rpcsvc/nfs4_prot.h" + +int nfs4_skip_bytes; + +/* + * The waiting() function returns the value passed in, until something + * external modifies it. In this case, the D script tst.call.d will + * modify the value of *a, and thus break the while loop in dotest(). + * + * This serves the purpose of not making the RPC calls until tst.call.d + * is active. Thus, the probes in tst.call.d can fire as a result of + * the RPC call in dotest(). + */ + +int +waiting(volatile int *a) +{ + return (*a); +} + +int +dotest(void) +{ + CLIENT *client; + AUTH *auth; + COMPOUND4args args; + COMPOUND4res res; + enum clnt_stat status; + struct timeval timeout; + nfs_argop4 arg[1]; + char *tag = "dtrace test"; + volatile int a = 0; + + while (waiting(&a) == 0) + continue; + + timeout.tv_sec = 30; + timeout.tv_usec = 0; + + client = clnt_create("localhost", NFS4_PROGRAM, NFS_V4, "tcp"); + if (client == NULL) { + clnt_pcreateerror("test"); + return (1); + } + auth = authsys_create_default(); + client->cl_auth = auth; + args.minorversion = 0; + args.tag.utf8string_len = strlen(tag); + args.tag.utf8string_val = tag; + args.argarray.argarray_len = sizeof (arg) / sizeof (nfs_argop4); + args.argarray.argarray_val = arg; + + arg[0].argop = OP_PUTROOTFH; + /* no need to manipulate nfs_argop4_u */ + + bzero(&res, sizeof (res)); + + status = clnt_call(client, NFSPROC4_COMPOUND, + xdr_COMPOUND4args, (caddr_t)&args, + xdr_COMPOUND4res, (caddr_t)&res, + timeout); + if (status != RPC_SUCCESS) { + clnt_perror(client, "test"); + return (2); + } + + return (0); +} + +/*ARGSUSED*/ +int +main(int argc, char **argv) +{ + char shareline[BUFSIZ], unshareline[BUFSIZ]; + int rc; + + (void) snprintf(shareline, sizeof (shareline), + "mkdir /tmp/nfsv4test.%d ; share /tmp/nfsv4test.%d", getpid(), + getpid()); + (void) snprintf(unshareline, sizeof (unshareline), + "unshare /tmp/nfsv4test.%d ; rmdir /tmp/nfsv4test.%d", getpid(), + getpid()); + + (void) system(shareline); + rc = dotest(); + (void) system(unshareline); + + return (rc); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call.d new file mode 100644 index 00000000..15cf8bc0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call.d @@ -0,0 +1,70 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Make sure nfs provider probes are firing + * + * SECTION: nfs4 provider + */ + +#pragma D option destructive +#pragma D option quiet + +pid$1:a.out:waiting:entry +{ + this->value = (int *)alloca(sizeof (int)); + *this->value = 1; + copyout(this->value, arg0, sizeof (int)); +} + +nfsv4:::compound-start +{ + cstart++; +} + +nfsv4:::op-putrootfh-start +{ + opstart++; +} + +nfsv4:::op-putrootfh-done +{ + opdone++; +} + +nfsv4:::compound-done +/cstart && opstart && opdone/ +{ + exit(0); +} + +tick-1s +/tick++ == 3/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call3.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call3.c new file mode 100644 index 00000000..bd89fffc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call3.c @@ -0,0 +1,441 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <strings.h> +#include <rpc/rpc.h> +#include <stdlib.h> +#include <sys/param.h> +#include <rpcsvc/mount.h> + +#include "rpcsvc/nfs_prot.h" + +char sharedpath[MAXPATHLEN]; +fhandle3 *rootfh; + +/* + * The waiting() function returns the value passed in, until something + * external modifies it. In this case, the D script tst.call.d will + * modify the value of *a, and thus break the while loop in dotest(). + * + * This serves the purpose of not making the RPC calls until tst.call.d + * is active. Thus, the probes in tst.call.d can fire as a result of + * the RPC call in dotest(). + */ + +int +waiting(volatile int *a) +{ + return (*a); +} + +static void +getattr_arginit(void *argp) +{ + GETATTR3args *args = argp; + + args->object.data.data_len = rootfh->fhandle3_len; + args->object.data.data_val = rootfh->fhandle3_val; +} + +static void +setattr_arginit(void *argp) +{ + SETATTR3args *args = argp; + + bzero(args, sizeof (*args)); + args->object.data.data_len = rootfh->fhandle3_len; + args->object.data.data_val = rootfh->fhandle3_val; +} + +static void +lookup_arginit(void *argp) +{ + LOOKUP3args *args = argp; + + args->what.name = "giant-skunk"; + args->what.dir.data.data_len = rootfh->fhandle3_len; + args->what.dir.data.data_val = rootfh->fhandle3_val; +} + +static void +access_arginit(void *argp) +{ + ACCESS3args *args = argp; + + args->object.data.data_len = rootfh->fhandle3_len; + args->object.data.data_val = rootfh->fhandle3_val; +} + +static void +commit_arginit(void *argp) +{ + COMMIT3args *args = argp; + + bzero(args, sizeof (*args)); + args->file.data.data_len = rootfh->fhandle3_len; + args->file.data.data_val = rootfh->fhandle3_val; +} + +static void +create_arginit(void *argp) +{ + CREATE3args *args = argp; + + bzero(args, sizeof (*args)); + args->where.name = "pinky-blue"; + args->where.dir.data.data_len = rootfh->fhandle3_len; + args->where.dir.data.data_val = rootfh->fhandle3_val; +} + +static void +fsinfo_arginit(void *argp) +{ + FSINFO3args *args = argp; + + args->fsroot.data.data_len = rootfh->fhandle3_len; + args->fsroot.data.data_val = rootfh->fhandle3_val; +} + +static void +fsstat_arginit(void *argp) +{ + FSSTAT3args *args = argp; + + args->fsroot.data.data_len = rootfh->fhandle3_len; + args->fsroot.data.data_val = rootfh->fhandle3_val; +} + +static void +link_arginit(void *argp) +{ + LINK3args *args = argp; + + args->file.data.data_len = rootfh->fhandle3_len; + args->file.data.data_val = rootfh->fhandle3_val; + args->link.dir.data.data_len = rootfh->fhandle3_len; + args->link.dir.data.data_val = rootfh->fhandle3_val; + args->link.name = "samf"; +} + +static void +mkdir_arginit(void *argp) +{ + MKDIR3args *args = argp; + + bzero(args, sizeof (*args)); + args->where.dir.data.data_len = rootfh->fhandle3_len; + args->where.dir.data.data_val = rootfh->fhandle3_val; + args->where.name = "cookie"; +} + +static void +mknod_arginit(void *argp) +{ + MKNOD3args *args = argp; + + bzero(args, sizeof (*args)); + args->where.dir.data.data_len = rootfh->fhandle3_len; + args->where.dir.data.data_val = rootfh->fhandle3_val; + args->where.name = "pookie"; +} + +static void +null_arginit(void *argp) +{ +} + +static void +pathconf_arginit(void *argp) +{ + PATHCONF3args *args = argp; + + args->object.data.data_len = rootfh->fhandle3_len; + args->object.data.data_val = rootfh->fhandle3_val; +} + +static void +read_arginit(void *argp) +{ + READ3args *args = argp; + + bzero(args, sizeof (*args)); + args->file.data.data_len = rootfh->fhandle3_len; + args->file.data.data_val = rootfh->fhandle3_val; +} + +static void +readdir_arginit(void *argp) +{ + READDIR3args *args = argp; + + bzero(args, sizeof (*args)); + args->dir.data.data_len = rootfh->fhandle3_len; + args->dir.data.data_val = rootfh->fhandle3_val; + args->count = 1024; +} + +static void +readdirplus_arginit(void *argp) +{ + READDIRPLUS3args *args = argp; + + bzero(args, sizeof (*args)); + args->dir.data.data_len = rootfh->fhandle3_len; + args->dir.data.data_val = rootfh->fhandle3_val; + args->dircount = 1024; + args->maxcount = 1024; +} + +static void +readlink_arginit(void *argp) +{ + READLINK3args *args = argp; + + args->symlink.data.data_len = rootfh->fhandle3_len; + args->symlink.data.data_val = rootfh->fhandle3_val; +} + +static void +remove_arginit(void *argp) +{ + REMOVE3args *args = argp; + + args->object.dir.data.data_len = rootfh->fhandle3_len; + args->object.dir.data.data_val = rootfh->fhandle3_val; + args->object.name = "antelope"; +} + +static void +rename_arginit(void *argp) +{ + RENAME3args *args = argp; + + args->from.dir.data.data_len = rootfh->fhandle3_len; + args->from.dir.data.data_val = rootfh->fhandle3_val; + args->from.name = "walter"; + args->to.dir.data.data_len = rootfh->fhandle3_len; + args->to.dir.data.data_val = rootfh->fhandle3_val; + args->to.name = "wendy"; +} + +static void +rmdir_arginit(void *argp) +{ + RMDIR3args *args = argp; + + args->object.dir.data.data_len = rootfh->fhandle3_len; + args->object.dir.data.data_val = rootfh->fhandle3_val; + args->object.name = "bunny"; +} + +static void +symlink_arginit(void *argp) +{ + SYMLINK3args *args = argp; + + bzero(args, sizeof (*args)); + args->where.dir.data.data_len = rootfh->fhandle3_len; + args->where.dir.data.data_val = rootfh->fhandle3_val; + args->where.name = "parlor"; + args->symlink.symlink_data = "interior"; +} + +static void +write_arginit(void *argp) +{ + WRITE3args *args = argp; + + bzero(args, sizeof (*args)); + args->file.data.data_len = rootfh->fhandle3_len; + args->file.data.data_val = rootfh->fhandle3_val; +} + +typedef void (*call3_arginit_t)(void *); + +typedef struct { + call3_arginit_t arginit; + rpcproc_t proc; + xdrproc_t xdrargs; + size_t argsize; + xdrproc_t xdrres; + size_t ressize; +} call3_test_t; +call3_test_t call3_tests[] = { + {getattr_arginit, NFSPROC3_GETATTR, xdr_GETATTR3args, + sizeof (GETATTR3args), xdr_GETATTR3res, sizeof (GETATTR3res)}, + {setattr_arginit, NFSPROC3_SETATTR, xdr_SETATTR3args, + sizeof (SETATTR3args), xdr_SETATTR3res, sizeof (SETATTR3res)}, + {lookup_arginit, NFSPROC3_LOOKUP, xdr_LOOKUP3args, + sizeof (LOOKUP3args), xdr_LOOKUP3res, sizeof (LOOKUP3res)}, + {access_arginit, NFSPROC3_ACCESS, xdr_ACCESS3args, + sizeof (ACCESS3args), xdr_ACCESS3res, sizeof (ACCESS3res)}, + {commit_arginit, NFSPROC3_COMMIT, xdr_COMMIT3args, + sizeof (COMMIT3args), xdr_COMMIT3res, sizeof (COMMIT3res)}, + {create_arginit, NFSPROC3_CREATE, xdr_CREATE3args, + sizeof (CREATE3args), xdr_CREATE3res, sizeof (CREATE3res)}, + {fsinfo_arginit, NFSPROC3_FSINFO, xdr_FSINFO3args, + sizeof (FSINFO3args), xdr_FSINFO3res, sizeof (FSINFO3res)}, + {fsstat_arginit, NFSPROC3_FSSTAT, xdr_FSSTAT3args, + sizeof (FSSTAT3args), xdr_FSSTAT3res, sizeof (FSSTAT3res)}, + {link_arginit, NFSPROC3_LINK, xdr_LINK3args, + sizeof (LINK3args), xdr_LINK3res, sizeof (LINK3res)}, + {mkdir_arginit, NFSPROC3_MKDIR, xdr_MKDIR3args, + sizeof (MKDIR3args), xdr_MKDIR3res, sizeof (MKDIR3res)}, + {mknod_arginit, NFSPROC3_MKNOD, xdr_MKNOD3args, + sizeof (MKNOD3args), xdr_MKNOD3res, sizeof (MKNOD3res)}, + /* + * NULL proc is special. Rather than special case its zero-sized + * args/results, we give it a small nonzero size, so as to not + * make realloc() do the wrong thing. + */ + {null_arginit, NFSPROC3_NULL, xdr_void, sizeof (int), xdr_void, + sizeof (int)}, + {pathconf_arginit, NFSPROC3_PATHCONF, xdr_PATHCONF3args, + sizeof (PATHCONF3args), xdr_PATHCONF3res, sizeof (PATHCONF3res)}, + {read_arginit, NFSPROC3_READ, xdr_READ3args, + sizeof (READ3args), xdr_READ3res, sizeof (READ3res)}, + {readdir_arginit, NFSPROC3_READDIR, xdr_READDIR3args, + sizeof (READDIR3args), xdr_READDIR3res, sizeof (READDIR3res)}, + {readdirplus_arginit, NFSPROC3_READDIRPLUS, xdr_READDIRPLUS3args, + sizeof (READDIRPLUS3args), xdr_READDIRPLUS3res, + sizeof (READDIRPLUS3res)}, + {readlink_arginit, NFSPROC3_READLINK, xdr_READLINK3args, + sizeof (READLINK3args), xdr_READLINK3res, sizeof (READLINK3res)}, + {remove_arginit, NFSPROC3_REMOVE, xdr_REMOVE3args, + sizeof (REMOVE3args), xdr_REMOVE3res, sizeof (REMOVE3res)}, + {rename_arginit, NFSPROC3_RENAME, xdr_RENAME3args, + sizeof (RENAME3args), xdr_RENAME3res, sizeof (RENAME3res)}, + {rmdir_arginit, NFSPROC3_RMDIR, xdr_RMDIR3args, + sizeof (RMDIR3args), xdr_RMDIR3res, sizeof (RMDIR3res)}, + {symlink_arginit, NFSPROC3_SYMLINK, xdr_SYMLINK3args, + sizeof (SYMLINK3args), xdr_SYMLINK3res, sizeof (SYMLINK3res)}, + {write_arginit, NFSPROC3_WRITE, xdr_WRITE3args, + sizeof (WRITE3args), xdr_WRITE3res, sizeof (WRITE3res)}, + {NULL} +}; + +int +dotest(void) +{ + CLIENT *client, *mountclient; + AUTH *auth; + struct timeval timeout; + caddr_t args, res; + enum clnt_stat status; + rpcproc_t proc; + call3_test_t *test; + void *argbuf = NULL; + void *resbuf = NULL; + struct mountres3 mountres3; + char *sp; + volatile int a = 0; + + while (waiting(&a) == 0) + continue; + + timeout.tv_sec = 30; + timeout.tv_usec = 0; + + mountclient = clnt_create("localhost", MOUNTPROG, MOUNTVERS3, "tcp"); + if (mountclient == NULL) { + clnt_pcreateerror("clnt_create mount"); + return (1); + } + auth = authsys_create_default(); + mountclient->cl_auth = auth; + sp = sharedpath; + bzero(&mountres3, sizeof (mountres3)); + status = clnt_call(mountclient, MOUNTPROC_MNT, + xdr_dirpath, (char *)&sp, + xdr_mountres3, (char *)&mountres3, + timeout); + if (status != RPC_SUCCESS) { + clnt_perror(mountclient, "mnt"); + return (1); + } + if (mountres3.fhs_status != 0) { + fprintf(stderr, "MOUNTPROG/MOUNTVERS3 failed %d\n", + mountres3.fhs_status); + return (1); + } + rootfh = &mountres3.mountres3_u.mountinfo.fhandle; + + client = clnt_create("localhost", NFS3_PROGRAM, NFS_V3, "tcp"); + if (client == NULL) { + clnt_pcreateerror("clnt_create"); + return (1); + } + client->cl_auth = auth; + + for (test = call3_tests; test->arginit; ++test) { + argbuf = realloc(argbuf, test->argsize); + resbuf = realloc(resbuf, test->ressize); + if ((argbuf == NULL) || (resbuf == NULL)) { + perror("realloc() failed"); + return (1); + } + (test->arginit)(argbuf); + bzero(resbuf, test->ressize); + status = clnt_call(client, test->proc, + test->xdrargs, argbuf, + test->xdrres, resbuf, + timeout); + if (status != RPC_SUCCESS) + clnt_perror(client, "call"); + } + + status = clnt_call(mountclient, MOUNTPROC_UMNT, + xdr_dirpath, (char *)&sp, + xdr_void, NULL, + timeout); + if (status != RPC_SUCCESS) + clnt_perror(mountclient, "umnt"); + + return (0); +} + +/*ARGSUSED*/ +int +main(int argc, char **argv) +{ + char shareline[BUFSIZ], unshareline[BUFSIZ]; + int rc; + + (void) snprintf(sharedpath, sizeof (sharedpath), + "/tmp/nfsv3test.%d", getpid()); + (void) snprintf(shareline, sizeof (shareline), + "mkdir %s ; share %s", sharedpath, sharedpath); + (void) snprintf(unshareline, sizeof (unshareline), + "unshare %s ; rmdir %s", sharedpath, sharedpath); + + (void) system(shareline); + rc = dotest(); + (void) system(unshareline); + + return (rc); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call3.d new file mode 100644 index 00000000..b635b166 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/nfs/tst.call3.d @@ -0,0 +1,91 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Make sure nfsv3 provider probes are firing, and that the + * arguments are properly visible. + * + * SECTION: nfs3 provider + */ + +#pragma D option destructive +#pragma D option quiet + +pid$1:a.out:waiting:entry +{ + this->value = (int *)alloca(sizeof (int)); + *this->value = 1; + copyout(this->value, arg0, sizeof (int)); +} + +nfsv3:::op-getattr-start +{ + printf("ci_local: %s\n", args[0]->ci_local); + printf("ci_remote: %s\n", args[0]->ci_remote); + printf("ci_protocol: %s\n", args[0]->ci_protocol); + + printf("noi_xid: %d\n", args[1]->noi_xid); + printf("noi_cred->cr_uid: %d\n", args[1]->noi_cred->cr_uid); + printf("noi_curpath: %s\n", args[1]->noi_curpath); + + printf("fh3_flags: %d\n", args[2]->object.fh3_flags); +} + +nfsv3:::op-getattr-done +{ + printf("ci_local: %s\n", args[0]->ci_local); + printf("ci_remote: %s\n", args[0]->ci_remote); + printf("ci_protocol: %s\n", args[0]->ci_protocol); + + printf("noi_xid: %d\n", args[1]->noi_xid); + printf("noi_cred->cr_uid: %d\n", args[1]->noi_cred->cr_uid); + printf("noi_curpath: %s\n", args[1]->noi_curpath); + + printf("status: %d\n", args[2]->status); +} + +nfsv3:::*-done +/seen[probename] == 0/ +{ + ++numberseen; + seen[probename] = 1; + printf("%d ops seen, latest op is %s\n", numberseen, probename); +} + +nfsv3:::*-done +/numberseen == 22/ +{ + exit(0); +} + +tick-1s +/tick++ == 10/ +{ + printf("%d nfsv3 ops seen; should be 22\n", numberseen); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d new file mode 100644 index 00000000..cc488463 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Test invocation of offsetof() with a member that is a bit-field. + * This should fail at compile time. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + * NOTES: + * + */ + +struct foo { + int a:1; + int b:3; +}; + +BEGIN +{ + trace(offsetof(struct foo, b)); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.badtype.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.badtype.d new file mode 100644 index 00000000..4e8a8858 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.badtype.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Test invocation of offsetof() with an invalid type. + * This should fail at compile time. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + * NOTES: + * + */ + +BEGIN +{ + trace(offsetof(struct no_such_type, x)); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.notsou.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.notsou.d new file mode 100644 index 00000000..84209530 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_OFFSETOF_TYPE.notsou.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + + +/* + * ASSERTION: + * + * Test invocation of offsetof() with a type that is not a struct or union. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + * NOTES: + * + */ + +BEGIN +{ + trace(offsetof(int, x)); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.OffsetofNULL.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.OffsetofNULL.d new file mode 100644 index 00000000..5a341a33 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.OffsetofNULL.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Querying the offsetof an non-member variable of a struct throws + * a D_UNKNOWN error. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + */ +#pragma D option quiet + +struct record { + int a; + int b; + int c : 4; +}; + +BEGIN +{ + printf("offsetof (struct record, NULL): %d\n", + offsetof (struct record, NULL)); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.badmemb.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.badmemb.d new file mode 100644 index 00000000..caf0a1d1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.badmemb.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Test invocation of offsetof() with an invalid member. + * This should fail at compile time. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + * NOTES: + * + */ + +BEGIN +{ + trace(offsetof(vnode_t, v_no_such_member)); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofAlias.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofAlias.d new file mode 100644 index 00000000..c7494d20 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofAlias.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test invocation of offsetof() with a struct type alias. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + * NOTES: + * + */ + +#pragma D option quiet + +typedef struct record { + char c; + int x; + int y; +} record_t; + +BEGIN +{ + printf("offsetof(record_t, c) = %d\n", offsetof(record_t, c)); + printf("offsetof(record_t, x) = %d\n", offsetof(record_t, x)); + printf("offsetof(record_t, y) = %d\n", offsetof(record_t, y)); + exit(0); +} + +END +/(8 != offsetof(record_t, y)) || (4 != offsetof(record_t, x)) || + (0 != offsetof(record_t, c))/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofArith.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofArith.d new file mode 100644 index 00000000..7e2b3308 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofArith.d @@ -0,0 +1,73 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: offsetof can be used anywhere in a D program that an integer + * constant can be used. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + * NOTES: + * + */ + +#pragma D option quiet + +typedef struct record { + char c; + int x; + int y; +} record_t; + +BEGIN +{ + + add = offsetof(record_t, c) + offsetof(record_t, x) + + offsetof(record_t, y); + sub = offsetof(record_t, y) - offsetof(record_t, x); + mul = offsetof(record_t, x) * offsetof(record_t, c); + div = offsetof(record_t, y) / offsetof(record_t, x); + + printf("offsetof(record_t, c) = %d\n", offsetof(record_t, c)); + printf("offsetof(record_t, x) = %d\n", offsetof(record_t, x)); + printf("offsetof(record_t, y) = %d\n", offsetof(record_t, y)); + + printf("Addition of offsets (c+x+y)= %d\n", add); + printf("Subtraction of offsets (y-x)= %d\n", sub); + printf("Multiplication of offsets (x*c) = %d\n", mul); + printf("Division of offsets (y/x) = %d\n", div); + + exit(0); +} + +END +/(8 != offsetof(record_t, y)) || (4 != offsetof(record_t, x)) || + (0 != offsetof(record_t, c)) || (12 != add) || (4 != sub) || (0 != mul) + || (2 != div)/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofUnion.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofUnion.d new file mode 100644 index 00000000..de1a5fab --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.OffsetofUnion.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test invocation of offsetof() with a union type alias. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + * NOTES: + * + */ + +#pragma D option quiet + +union record { + int x; + int y; + char c; +}; + +BEGIN +{ + printf("offsetof(record, x) = %d\n", offsetof(union D`record, x)); + printf("offsetof(record, y) = %d\n", offsetof(union D`record, y)); + printf("offsetof(record, c) = %d\n", offsetof(union D`record, c)); + exit(0); +} + +END +/(0 != offsetof(union D`record, y)) && (0 != offsetof(union D`record, x)) && + (0 != offsetof(union D`record, c))/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.struct.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.struct.d new file mode 100644 index 00000000..60b88637 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.struct.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test invocation of offsetof() with a struct type. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + * NOTES: + * + */ + +#pragma D option quiet + +struct s { + int x; + int y; +}; + +BEGIN +{ + printf("offsetof(s, y) = %d\n", offsetof(struct D`s, y)); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.struct.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.struct.d.out new file mode 100644 index 00000000..04b666e2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.struct.d.out @@ -0,0 +1,2 @@ +offsetof(s, y) = 4 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.union.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.union.d new file mode 100644 index 00000000..1b37c4c1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.union.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test invocation of offsetof() with a union type. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + * NOTES: + * + */ + +#pragma D option quiet + +union s { + int x; + int y; +}; + +BEGIN +{ + printf("offsetof(s, y) = %d\n", offsetof(union D`s, y)); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.union.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.union.d.out new file mode 100644 index 00000000..e3918bef --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/offsetof/tst.union.d.out @@ -0,0 +1,2 @@ +offsetof(s, y) = 0 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/tst.ternary.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/tst.ternary.d new file mode 100644 index 00000000..cd375195 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/tst.ternary.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the ternary operator. Test left-hand side true, right-hand side true, + * and multiple nested instances of the ternary operator. + * + * SECTION: Types, Operators, and Expressions/Conditional Expressions + */ + +#pragma D option quiet + +BEGIN +{ + x = 0; + printf("x is %s\n", x == 0 ? "zero" : "one"); + x = 1; + printf("x is %s\n", x == 0 ? "zero" : "one"); + x = 2; + printf("x is %s\n", x == 0 ? "zero" : x == 1 ? "one" : "two"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/tst.ternary.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/tst.ternary.d.out new file mode 100644 index 00000000..ec30800e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/operators/tst.ternary.d.out @@ -0,0 +1,4 @@ +x is zero +x is one +x is two + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.d new file mode 100644 index 00000000..a3fa24ff --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: can't specify a bogus library name + * + * SECTION: User Process Tracing/pid Provider + * + */ + +pid$1:libbmc_sucks.so.1::entry +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe new file mode 100755 index 00000000..595db1de --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe @@ -0,0 +1,29 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +sleep 1000000 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badproc1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badproc1.d new file mode 100644 index 00000000..3f3ca22d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badproc1.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Verify that we don't grab bogus process IDs. + * + * SECTION: User Process Tracing/pid Provider + * + */ + +pidgin:::entry +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_BADPID.badproc2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_BADPID.badproc2.d new file mode 100644 index 00000000..8e01b060 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_BADPID.badproc2.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Make sure we can't grab pid 0 + * + * SECTION: User Process Tracing/pid Provider + * + */ + +pid0:::entry +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.d new file mode 100644 index 00000000..dabcd9c6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.d @@ -0,0 +1,36 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +pid$1::: +{ +} + +BEGIN +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe new file mode 100755 index 00000000..25b4ff14 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe @@ -0,0 +1,29 @@ +#!/bin/bash +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +sleep 1000000 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.d new file mode 100644 index 00000000..f1c44e86 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Can't specify a bogus function name (if the module is specified) + * + * SECTION: User Process Tracing/pid Provider + * + * NOTES: + * + */ + +pid$1:a.out:ahl_r00lz:entry +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe new file mode 100755 index 00000000..595db1de --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe @@ -0,0 +1,29 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +sleep 1000000 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.d new file mode 100644 index 00000000..dd905303 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Test that the '-' function doesn't work with random modules + * + * SECTION: User Process Tracing/pid Provider + * + */ + +pid$1:libc:-:800 +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe new file mode 100755 index 00000000..595db1de --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe @@ -0,0 +1,29 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +sleep 1000000 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.d new file mode 100644 index 00000000..6acf8aa0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Verify that you can't enable "all" '-' function probes + * + * SECTION: User Process Tracing/pid Provider + * + */ + +pid$1::-: +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe new file mode 100755 index 00000000..595db1de --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe @@ -0,0 +1,29 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +sleep 1000000 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d new file mode 100644 index 00000000..829c002c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Only entry, return and offsets are valid names + * + * SECTION: User Process Tracing/pid Provider + * + */ + +pid$1:a.out:main:beginning +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe new file mode 100755 index 00000000..595db1de --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe @@ -0,0 +1,29 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +sleep 1000000 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.d new file mode 100644 index 00000000..36bf9d6e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Verify that you can't glob the probe name with the '-' function + * + * SECTION: User Process Tracing/pid Provider + * + */ + +pid$1::-:10* +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe new file mode 100755 index 00000000..595db1de --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe @@ -0,0 +1,29 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +sleep 1000000 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.d new file mode 100644 index 00000000..60e5a8c6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Can't have an offset that's outside of a function + * + * SECTION: User Process Tracing/pid Provider + * + * NOTES: If _exit(2) becomes _way_ more complex this could fail... + * + */ + +pid$1::_exit:100 +{ +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe new file mode 100755 index 00000000..595db1de --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe @@ -0,0 +1,29 @@ +#!/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +sleep 1000000 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.addprobes.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.addprobes.ksh new file mode 100755 index 00000000..6c269ca2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.addprobes.ksh @@ -0,0 +1,61 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# +# This test verifies that it's possible to add new pid probes to an existing +# pid provider. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +sleep 60 & +pid=$! + +$dtrace -n pid$pid:libc::entry -n 'tick-1s{exit(0);}' +status=$? + +if [ $status -gt 0 ]; then + exit $status; +fi + +$dtrace -n pid$pid:libc::return -n 'tick-1s{exit(0);}' +status=$? + +if [ $status -gt 0 ]; then + exit $status; +fi + +kill $pid + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.args1.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.args1.c new file mode 100644 index 00000000..23bbab22 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.args1.c @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <signal.h> +#include <unistd.h> + +int +go(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, + int arg7, int arg8, int arg9) +{ + return (arg1); +} + +static void +handle(int sig) +{ + go(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +} + +int +main(int argc, char **argv) +{ + (void) signal(SIGUSR1, handle); + for (;;) + getpid(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.args1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.args1.d new file mode 100644 index 00000000..a3ad6c9a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.args1.d @@ -0,0 +1,75 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: test that all 10 arguments are what we expect them to be. + * + * SECTION: pid provider + */ + +#pragma D option destructive + +BEGIN +{ + /* + * Wait no more than a second for the first call to getpid(2). + */ + timeout = timestamp + 1000000000; +} + +syscall::getpid:return +/pid == $1/ +{ + i = 0; + raise(SIGUSR1); + /* + * Wait half a second after raising the signal. + */ + timeout = timestamp + 500000000; +} + +pid$1:a.out:go:entry +/arg0 == 0 && arg1 == 1 && arg2 == 2 && arg3 == 3 && arg4 == 4 && +arg5 == 5 && arg6 == 6 && arg7 == 7 && arg8 == 8 && arg9 == 9/ +{ + exit(0); +} + +pid$1:a.out:go:entry +{ + printf("wrong args: %d %d %d %d %d %d %d %d %d %d", arg0, arg1, arg2, + arg3, arg4, arg5, arg6, arg7, arg8, arg9); + exit(1); +} + +profile:::tick-4 +/timestamp > timeout/ +{ + trace("test timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.coverage.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.coverage.d new file mode 100644 index 00000000..d3d568e7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.coverage.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: test that we can trace every instruction safely + * + * SECTION: pid provider + * + */ + +BEGIN +{ + /* + * Let's just do this for 2 seconds. + */ + timeout = timestamp + 2000000000; +} + +pid$1:a.out:: +{} + +profile:::tick-4 +/timestamp > timeout/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.coverage.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.coverage.exe new file mode 100755 index 00000000..07e84583 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.coverage.exe @@ -0,0 +1,29 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +while true; do env > /dev/null; done diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.d new file mode 100644 index 00000000..e0fada86 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.d @@ -0,0 +1,64 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: the stack() action should be empty for all pid probes + * + * SECTION: pid provider + */ + +#pragma D option quiet + +BEGIN +{ + /* + * Monitor the program for two seconds. + */ + timeout = timestamp + 1000000000 * 2; +} + +pid$1:::return +{ + @[stack()] = sum(0); +} + +pid$1:a.out:: +{ + @[stack()] = sum(0); +} + +pid$1:::entry +{ + @[stack()] = sum(0); +} + +profile:::tick-4 +/timestamp > timeout/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.d.out new file mode 100644 index 00000000..2304a615 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.d.out @@ -0,0 +1,3 @@ + + + 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe new file mode 100755 index 00000000..a8bc8cb3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe @@ -0,0 +1,29 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +exec find / > /dev/null 2>&1 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.float.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.float.c new file mode 100644 index 00000000..450c6aae --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.float.c @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> + +volatile double c = 1.2; + +int +main(int argc, char **argv) +{ + double a = 1.56; + double b = (double)argc; + + for (;;) { + c *= a; + c += b; + (void) usleep(1000); + } + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.float.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.float.d new file mode 100644 index 00000000..4e11ee33 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.float.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Make sure we can work on processes that use the FPU + * + * SECTION: pid provider + */ + +BEGIN +{ + /* + * Let's just do this for 5 seconds. + */ + timeout = timestamp + 5000000000; +} + +pid$1:a.out:main: +{} + +profile:::tick-4 +/timestamp > timeout/ +{ + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.fork.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.fork.c new file mode 100644 index 00000000..d5e90dbc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.fork.c @@ -0,0 +1,63 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> + +int +waiting(volatile int *a) +{ + return (*a); +} + +int +go(void) +{ + int i, j, total = 0; + + for (i = 0; i < 10; i++) { + for (j = 0; j < 10; j++) { + total += i * j; + } + } + + return (total); +} + +int +main(int argc, char **argv) +{ + volatile int a = 0; + + while (waiting(&a) == 0) + continue; + + (void) forkall(); + (void) go(); + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.fork.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.fork.d new file mode 100644 index 00000000..f1b11978 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.fork.d @@ -0,0 +1,86 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: make sure fork(2) is okay + * + * SECTION: pid provider + */ + +#pragma D option destructive + +pid$1:a.out:waiting:entry +{ + this->value = (int *)alloca(sizeof (int)); + *this->value = 1; + copyout(this->value, arg0, sizeof (int)); +} + +proc:::create +/pid == $1/ +{ + child = args[0]->pr_pid; + trace(pid); +} + +pid$1:a.out:go: +/pid == child/ +{ + trace("wrong pid"); + exit(1); +} + +proc:::exit +/pid == $1 || pid == child/ +{ + out++; + trace(pid); +} + +proc:::exit +/out == 2/ +{ + exit(0); +} + + +BEGIN +{ + /* + * Let's just do this for 5 seconds. + */ + timeout = timestamp + 5000000000; +} + +profile:::tick-4 +/timestamp > timeout/ +{ + trace("test timed out"); + exit(1); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.gcc.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.gcc.c new file mode 100644 index 00000000..b97fa9d1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.gcc.c @@ -0,0 +1,63 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <spawn.h> +#include <signal.h> + +void +go(void) +{ + pid_t pid; + + (void) posix_spawn(&pid, "/usr/bin/ls", NULL, NULL, NULL, NULL); + + (void) waitpid(pid, NULL, 0); +} + +void +intr(int sig) +{ +} + +int +main(int argc, char **argv) +{ + struct sigaction sa; + + sa.sa_handler = intr; + sigfillset(&sa.sa_mask); + sa.sa_flags = 0; + + (void) sigaction(SIGUSR1, &sa, NULL); + + for (;;) { + go(); + } + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.gcc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.gcc.d new file mode 100644 index 00000000..f119098f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.gcc.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: test that we can trace every instruction safely for gcc + * compiled apps. + * + * SECTION: pid provider + * + */ + +BEGIN +{ + /* + * Let's just do this for 2 seconds. + */ + timeout = timestamp + 2000000000; +} + +pid$1:a.out:: +{} + +profile:::tick-4 +/timestamp > timeout/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.killonerror.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.killonerror.ksh new file mode 100755 index 00000000..587878c3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.killonerror.ksh @@ -0,0 +1,41 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +# +# Make sure we kill a process if the dtrace(1M) command fails. +# + +rc=`$dtrace -c date -n jarod 2>/dev/null | /usr/bin/wc -l` + +exit $rc diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.main.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.main.ksh new file mode 100755 index 00000000..b3b99601 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.main.ksh @@ -0,0 +1,59 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +# +# Make sure we can trace main:entry properly -- this was problematic because +# we also set a breakpoint on the same spot in libdtrace. +# + +$dtrace -c date -s /dev/stdin <<EOF + BEGIN + { + status = 1; + } + + pid\$target::main:entry + { + status = 0; + } + + END + { + exit(status); + } +EOF + +exit $? diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.manypids.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.manypids.ksh new file mode 100644 index 00000000..869339ba --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.manypids.ksh @@ -0,0 +1,70 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +set -A pids + +for lib in `ls -1 /lib/lib*.so.1 | grep -v ld.so.1`; do + preload=$lib:${preload} +done + +export LD_PRELOAD=$preload + +let numkids=100 +let i=0 + +tmpfile=/tmp/dtest.$$ + +while [ "$i" -lt "$numkids" ]; do + sleep 500 & + pids[$i]=$! + let i=i+1 +done + +export LD_PRELOAD= + +let i=0 + +echo "tick-1sec\n{\n\texit(0);\n}\n" > $tmpfile + +while [ "$i" -lt "$numkids" ]; do + echo "pid${pids[$i]}::malloc:entry\n{}\n" >> $tmpfile + let i=i+1 +done + +$dtrace -s $tmpfile +status=$? + +rm $tmpfile +pkill sleep +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh new file mode 100755 index 00000000..35f0391b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh @@ -0,0 +1,62 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -wZq -x switchrate=100ms -s /dev/stdin <<EOF +pid*:date:: +{ + printf("%s:%s\n", probefunc, probename); +} + +tick-1s +/i++ > 5/ +{ + exit(0); +} + +tick-1s +/(i % 2) == 0/ +{ + system("dtrace -c date -ln 'pid\$target::main:entry' >/dev/null"); +} + +tick-1s +/(i % 2) == 1/ +{ + system("dtrace -c date -ln 'pid\$target::main:return' >/dev/null"); +} +EOF + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh.out new file mode 100644 index 00000000..b2742c47 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh.out @@ -0,0 +1,7 @@ +main:return +main:entry +main:return +main:entry +main:return +main:entry + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.probemod.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.probemod.ksh new file mode 100755 index 00000000..326fd1ab --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.probemod.ksh @@ -0,0 +1,54 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +# +# Let's see if we can successfully specify a module using partial +# matches as well as the full module name. We'll use 'libc.so.1' +# (and therefore 'libc' and 'libc.so') as it's definitely there. +# + +for lib in libc libc.so libc.so.1 'lib[c]*'; do + sleep 60 & + pid=$! + dtrace -n "pid$pid:$lib::entry" -n 'tick-2s{exit(0);}' + status=$? + + kill $pid + + if [ $status -gt 0 ]; then + exit $status + fi +done + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh new file mode 100755 index 00000000..892ff3e2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh @@ -0,0 +1,93 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This test verifies that specifying a glob in a pid provider name +# (e.g., p*d$target) works. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=${TMPDIR:-/tmp}/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > Makefile <<EOF +all: main + +main: main.o + cc -o main main.o + +main.o: main.c + cc -c main.c +EOF + +cat > main.c <<EOF +void +go(void) +{ +} + +int +main(int argc, char **argv) +{ + go(); + + return (0); +} +EOF + +make > /dev/null +if [ $? -ne 0 ]; then + print -u2 "failed to build" + exit 1 +fi + +cat > main.d <<'EOF' +p*d$target::go:entry +{ + printf("%s:%s:%s\n", probemod, probefunc, probename); +} +EOF + +script() { + $dtrace -q -s ./main.d -c ./main +} + +script +status=$? + +cd /tmp +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh new file mode 100755 index 00000000..8d83bddd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh @@ -0,0 +1,131 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This test verifies that probes will be picked up after a dlopen(3C) +# when the pid provider is specified as a glob (e.g., p*d$target.) +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=${TMPDIR:-/tmp}/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > Makefile <<EOF +all: main altlib.so + +main: main.o + cc -o main main.o + +main.o: main.c + cc -c main.c + +altlib.so: altlib.o + cc -z defs -G -o altlib.so altlib.o -lc + +altlib.o: altlib.c + cc -c altlib.c +EOF + +cat > altlib.c <<EOF +void +go(void) +{ +} +EOF + +cat > main.c <<EOF +#include <dlfcn.h> +#include <unistd.h> +#include <stdio.h> + +void +go(void) +{ +} + +int +main(int argc, char **argv) +{ + void *alt; + void *alt_go; + + go(); + + if ((alt = dlopen("./altlib.so", RTLD_LAZY | RTLD_LOCAL)) + == NULL) { + printf("dlopen of altlib.so failed: %s\n", dlerror()); + return (1); + } + + if ((alt_go = dlsym(alt, "go")) == NULL) { + printf("failed to lookup 'go' in altlib.so\n"); + return (1); + } + + ((void (*)(void))alt_go)(); + + return (0); +} +EOF + +make > /dev/null +if [ $? -ne 0 ]; then + print -u2 "failed to build" + exit 1 +fi + +cat > main.d <<'EOF' +p*d$target::go:entry +{ + @foo[probemod, probefunc, probename] = count(); +} + +END +{ + printa("%s:%s:%s %@u\n",@foo); +} +EOF + +script() { + $dtrace -q -s ./main.d -c ./main +} + +script +status=$? + +cd /tmp +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh.out new file mode 100644 index 00000000..824d8985 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh.out @@ -0,0 +1,3 @@ +altlib.so:go:entry 1 +main:go:entry 1 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh new file mode 100755 index 00000000..c9ac6b1d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh @@ -0,0 +1,102 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This test verifies that a regex in the provider name will match +# USDT probes as well as pid probes (e.g., p*d$target matches both +# pid$target and pyramid$target.) +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=${TMPDIR:-/tmp}/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > Makefile <<EOF + all: main + +main: main.o prov.o + cc -o main main.o prov.o + +main.o: main.c prov.h + cc -c main.c + +prov.h: prov.d + $dtrace -h -s prov.d + +prov.o: prov.d main.o + $dtrace -G -32 -s prov.d main.o +EOF + +cat > prov.d <<EOF +provider pyramid { + probe entry(); +}; +EOF + +cat > main.c <<EOF +#include <sys/sdt.h> +#include "prov.h" + +int +main(int argc, char **argv) +{ + PYRAMID_ENTRY(); +} +EOF + +make > /dev/null +if [ $? -ne 0 ]; then + print -u2 "failed to build" + exit 1 +fi + +cat > main.d <<'EOF' +p*d$target::main:entry +{ + printf("%s:%s:%s\n", probemod, probefunc, probename); +} +EOF + +script() { + $dtrace -q -s ./main.d -c ./main +} + +script +status=$? + +cd /tmp +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh.out new file mode 100644 index 00000000..5a8938fe --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh.out @@ -0,0 +1,3 @@ +main:main:entry +main:main:entry + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh new file mode 100755 index 00000000..278ec128 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh @@ -0,0 +1,154 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This test verifies that USDT probes will be picked up after a dlopen(3C) +# when a regex in the provider name matches both USDT probes and pid probes +# (e.g., p*d$target matches both pid$target and pyramid$target.) +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=${TMPDIR:-/tmp}/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > Makefile <<EOF +all: main altlib.so + +main: main.o provmain.o + cc -o main main.o provmain.o + +main.o: main.c prov.h + cc -c main.c + +prov.h: prov.d + $dtrace -h -s prov.d + +provmain.o: prov.d main.o + $dtrace -G -32 -o provmain.o -s prov.d main.o + +altlib.so: altlib.o provalt.o + cc -z defs -G -o altlib.so altlib.o provalt.o -lc + +altlib.o: altlib.c prov.h + cc -c altlib.c + +provalt.o: prov.d altlib.o + $dtrace -G -32 -o provalt.o -s prov.d altlib.o +EOF + +cat > prov.d <<EOF +provider pyramid { + probe entry(); +}; +EOF + +cat > altlib.c <<EOF +#include <sys/sdt.h> +#include "prov.h" + +void +go(void) +{ + PYRAMID_ENTRY(); +} +EOF + +cat > main.c <<EOF +#include <dlfcn.h> +#include <unistd.h> +#include <stdio.h> +#include <sys/sdt.h> +#include "prov.h" + +void +go(void) +{ + PYRAMID_ENTRY(); +} + +int +main(int argc, char **argv) +{ + void *alt; + void *alt_go; + + go(); + + if ((alt = dlopen("./altlib.so", RTLD_LAZY | RTLD_LOCAL)) + == NULL) { + printf("dlopen of altlib.so failed: %s\n", dlerror()); + return (1); + } + + if ((alt_go = dlsym(alt, "go")) == NULL) { + printf("failed to lookup 'go' in altlib.so\n"); + return (1); + } + + ((void (*)(void))alt_go)(); + + return (0); +} +EOF + +make > /dev/null +if [ $? -ne 0 ]; then + print -u2 "failed to build" + exit 1 +fi + +cat > main.d <<'EOF' +p*d$target::go:entry +{ + @foo[probemod, probefunc, probename] = count(); +} + +END +{ + printa("%s:%s:%s %@u\n",@foo); +} +EOF + +script() { + $dtrace -q -s ./main.d -c ./main +} + +script +status=$? + +cd /tmp +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh.out new file mode 100644 index 00000000..f4715384 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh.out @@ -0,0 +1,3 @@ +altlib.so:go:entry 2 +main:go:entry 2 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret1.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret1.c new file mode 100644 index 00000000..cfb88a83 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret1.c @@ -0,0 +1,64 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <signal.h> +#include <unistd.h> + +/* + * The canonical name should be 'go' since we prefer symbol names with fewer + * leading underscores. + */ + +int a = 100; + +int +help(void) +{ + return (a); +} + +int +go(void) +{ + return (help() + 1); +} + +static void +handle(int sig) +{ + go(); + exit(0); +} + +int +main(int argc, char **argv) +{ + (void) signal(SIGUSR1, handle); + for (;;) + getpid(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret1.d new file mode 100644 index 00000000..0305d098 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret1.d @@ -0,0 +1,73 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: test that we get the right return value from non-leaf returns + * + * SECTION: pid provider + */ + +#pragma D option destructive + +BEGIN +{ + /* + * Wait no more than a second for the first call to getpid(2). + */ + timeout = timestamp + 1000000000; +} + +syscall::getpid:return +/pid == $1/ +{ + i = 0; + raise(SIGUSR1); + /* + * Wait half a second after raising the signal. + */ + timeout = timestamp + 500000000; +} + +pid$1:a.out:go:return +/arg1 == 101/ +{ + exit(0); +} + +pid$1:a.out:go:return +{ + printf("wrong return value: %d", arg1); + exit(1); +} + +profile:::tick-4 +/timestamp > timeout/ +{ + trace("test timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret2.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret2.c new file mode 100644 index 00000000..b64aa051 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret2.c @@ -0,0 +1,58 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <signal.h> +#include <unistd.h> + +/* + * The canonical name should be 'go' since we prefer symbol names with fewer + * leading underscores. + */ + +int a = 100; + +int +go(void) +{ + return (a); +} + +static void +handle(int sig) +{ + go(); + exit(0); +} + +int +main(int argc, char **argv) +{ + (void) signal(SIGUSR1, handle); + for (;;) + getpid(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret2.d new file mode 100644 index 00000000..0232948c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.ret2.d @@ -0,0 +1,73 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: test that we get the right return value from leaf returns + * + * SECTION: pid provider + */ + +#pragma D option destructive + +BEGIN +{ + /* + * Wait no more than a second for the first call to getpid(2). + */ + timeout = timestamp + 1000000000; +} + +syscall::getpid:return +/pid == $1/ +{ + i = 0; + raise(SIGUSR1); + /* + * Wait half a second after raising the signal. + */ + timeout = timestamp + 500000000; +} + +pid$1:a.out:go:return +/arg1 == 100/ +{ + exit(0); +} + +pid$1:a.out:go:return +{ + printf("wrong return value: %d", arg1); + exit(1); +} + +profile:::tick-4 +/timestamp > timeout/ +{ + trace("test timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.vfork.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.vfork.c new file mode 100644 index 00000000..76fa711a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.vfork.c @@ -0,0 +1,65 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> + +int +waiting(volatile int *a) +{ + return (*a); +} + +int +go(void) +{ + int i, j, total = 0; + + for (i = 0; i < 10; i++) { + for (j = 0; j < 10; j++) { + total += i * j; + } + } + + return (total); +} + +int +main(int argc, char **argv) +{ + volatile int a = 0; + + while (waiting(&a) == 0) + continue; + + if (vfork() == 0) { + int ret = go(); + (void) _exit(ret); + } + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.vfork.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.vfork.d new file mode 100644 index 00000000..b31bb7f3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.vfork.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: make sure probes called from a vfork(2) child fire in the parent + * + * SECTION: pid provider + */ + +#pragma D option destructive + +pid$1:a.out:waiting:entry +{ + this->value = (int *)alloca(sizeof (int)); + *this->value = 1; + copyout(this->value, arg0, sizeof (int)); +} + +proc:::create +/pid == $1/ +{ + child = args[0]->pr_pid; +} + +pid$1:a.out:go: +/child != pid/ +{ + printf("wrong pid (%d %d)", pid, child); + exit(1); +} + +syscall::rexit:entry +/pid == $1/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak1.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak1.c new file mode 100644 index 00000000..1418f2a3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak1.c @@ -0,0 +1,58 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <signal.h> +#include <unistd.h> + +/* + * The canonical name should be 'go' since we prefer symbol names with fewer + * leading underscores. + */ + +#pragma weak _go = go + +int +go(int a) +{ + return (a + 1); +} + +static void +handle(int sig) +{ + _go(1); + exit(0); +} + +int +main(int argc, char **argv) +{ + (void) signal(SIGUSR1, handle); + for (;;) + getpid(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak1.d new file mode 100644 index 00000000..458eada0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak1.d @@ -0,0 +1,83 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: test that we prefer symbols with fewer underscores + * + * SECTION: pid provider + */ + +#pragma D option destructive + +BEGIN +{ + /* + * Wait no more than a second for the first call to getpid(2). + */ + timeout = timestamp + 1000000000; +} + +syscall::getpid:return +/pid == $1/ +{ + i = 0; + raise(SIGUSR1); + /* + * Wait half a second after raising the signal. + */ + timeout = timestamp + 500000000; +} + +pid$1:a.out:go:entry, +pid$1:a.out:_go:entry +/probefunc == "go"/ +{ + i++; +} + +pid$1:a.out:go:entry, +pid$1:a.out:_go:entry +/probefunc == "_go"/ +{ + trace("resolved to '_go' rather than 'go'"); + exit(1); +} + +pid$1:a.out:go:entry, +pid$1:a.out:_go:entry +/i == 2/ +{ + exit(0); +} + +profile:::tick-4 +/timestamp > timeout/ +{ + trace("test timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak2.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak2.c new file mode 100644 index 00000000..8dabbe6e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak2.c @@ -0,0 +1,58 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <signal.h> +#include <unistd.h> + +/* + * The canonical name should be 'go' since we prefer symbol names with fewer + * leading underscores. + */ + +#pragma weak _go = go + +static int +go(int a) +{ + return (a + 1); +} + +static void +handle(int sig) +{ + _go(1); + exit(0); +} + +int +main(int argc, char **argv) +{ + (void) signal(SIGUSR1, handle); + for (;;) + getpid(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak2.d new file mode 100644 index 00000000..e3688b56 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pid/tst.weak2.d @@ -0,0 +1,83 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: check that we prefer weak symbols to local ones + * + * SECTION: pid provider + */ + +#pragma D option destructive + +BEGIN +{ + /* + * Wait no more than a second for the first call to getpid(2). + */ + timeout = timestamp + 1000000000; +} + +syscall::getpid:return +/pid == $1/ +{ + i = 0; + raise(SIGUSR1); + /* + * Wait half a second after raising the signal. + */ + timeout = timestamp + 500000000; +} + +pid$1:a.out:go:entry, +pid$1:a.out:_go:entry +/probefunc == "_go"/ +{ + i++; +} + +pid$1:a.out:go:entry, +pid$1:a.out:_go:entry +/probefunc == "go"/ +{ + trace("resolved to '_go' rather than 'go'"); + exit(1); +} + +pid$1:a.out:go:entry, +pid$1:a.out:_go:entry +/i == 2/ +{ + exit(0); +} + +profile:::tick-4 +/timestamp > timeout/ +{ + trace("test timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.available.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.available.d new file mode 100644 index 00000000..6fc9f2ff --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.available.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: make sure the plockstat probes are present in libc. + */ + +plockstat$1:libc.so.1:: +{} + +profile:::tick-1 +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.available.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.available.exe new file mode 100755 index 00000000..221e8b1d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.available.exe @@ -0,0 +1,29 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +sleep 100000000 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.libmap.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.libmap.d new file mode 100644 index 00000000..5f755b3f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.libmap.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: make sure the plockstat probes are present in libc. + */ + +plockstat$1:libc:: +{} + +profile:::tick-1 +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe new file mode 100755 index 00000000..221e8b1d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe @@ -0,0 +1,29 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +sleep 100000000 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d new file mode 100644 index 00000000..ab4106db --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.BadAlign.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: This test reproduces the alignment error. + * + * SECTION: Type and Constant Definitions/Enumerations + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + x = (int *) 64; + y = *x; + trace(y); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.ArrayVar.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.ArrayVar.d new file mode 100644 index 00000000..b6832087 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.ArrayVar.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Trying to access the address of a user defined array variable should throw + * a D_ADDROF_VAR error. + * + * SECTION: Pointers and Arrays/Pointers and Address Spaces + */ + +#pragma D option quiet + +int a[5]; +int *p; + +BEGIN +{ + p = &a; + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.DynamicVar.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.DynamicVar.d new file mode 100644 index 00000000..028a30a4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.DynamicVar.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Trying to access the address of a user defined dynamic variable should throw + * a D_ADDROF_VAR error. + * + * SECTION: Pointers and Arrays/Generic Pointers + * SECTION: Pointers and Arrays/Pointers to Dtrace Objects + */ + +#pragma D option quiet + +int i; +int *p; + +BEGIN +{ + i = 10; + p = &i; + + printf("Integer: %d, Pointer: %d\n", i, *p); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.agg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.agg.d new file mode 100644 index 00000000..8b592620 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_ADDROF_VAR.agg.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test that the & operator fails with D_ADDROF_VAR if its operand + * is a dynamic variable such as an aggregation. + * + * SECTION: Pointers and Arrays/Pointers and Addresses + * SECTION: Pointers and Arrays/Pointers to Dtrace Objects + */ + +BEGIN +{ + @a = count(); + trace(&@a); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_NONPTR.noptr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_NONPTR.noptr.d new file mode 100644 index 00000000..96d25b40 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_NONPTR.noptr.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Can not dereference non-pointers + * + * SECTION: Pointers and Arrays/Pointer Safety + * + * NOTES: + * + */ + +#pragma D option quiet + +int x; + +BEGIN +{ + b = *x; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_VOID.VoidPointerDeref.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_VOID.VoidPointerDeref.d new file mode 100644 index 00000000..f2fa5b31 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_DEREF_VOID.VoidPointerDeref.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Cannot dereference a void * pointer. + * + * SECTION: Pointers and Arrays/Generic Pointers + */ + +#pragma D option quiet + +void *p; + +int array[3]; + +BEGIN +{ + array[0] = 234; + array[1] = 334; + array[2] = 434; + + p = &array[0]; + + printf("array[0]: %d, p: %d\n", array[0], *p); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_ARRFUN.ArrayAssignment.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_ARRFUN.ArrayAssignment.d new file mode 100644 index 00000000..94814a7b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_ARRFUN.ArrayAssignment.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Arrays may not be assigned as a whole in D. + * + * SECTION: Pointers and Arrays/Pointer and Array Relationship + * + * NOTES: + * + */ + +#pragma D option quiet + +int array1[3]; +int array2[3]; + +BEGIN +{ + array1[0] = 200; + array1[1] = 400; + array1[2] = 600; + + array2[0] = 300; + array2[1] = 500; + array2[2] = 700; + + array2 = array1; + + printf("array1[0]: %d\tarray2[0]: %d\n", array1[0], array2[0]); + printf("array1[1]: %d\tarray2[1]: %d\n", array1[1], array2[1]); + printf("array1[2]: %d\tarray2[2]: %d\n", array1[2], array2[2]); + + exit(0); + +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_INCOMPAT.VoidPointerArith.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_INCOMPAT.VoidPointerArith.d new file mode 100644 index 00000000..e81c2bd8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_INCOMPAT.VoidPointerArith.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * May not apply pointer arithmetic to an object of type void * + * + * SECTION: Pointers and Arrays/Generic Pointers + */ + +#pragma D option quiet + +void *p; + +BEGIN +{ + printf("p: %d\n", (int) p); + printf("p+1: %d\n", (int) (p+1)); + printf("p+2: %d\n", (int) (p+2)); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_LVAL.AddressChange.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_LVAL.AddressChange.d new file mode 100644 index 00000000..98282402 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_LVAL.AddressChange.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: D pointers do not allow invalid address changes. + * + * SECTION: Pointers and Arrays/Pointer Safety + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + &`kmem_flags = (int *) 0x185ede4; + printf("Address of kmem_flags: %d\n", (int) kmemAddress); + printf("Value of kmem_flags: %d\n", `kmem_flags); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.NonPointerAccess.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.NonPointerAccess.d new file mode 100644 index 00000000..6f253277 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.NonPointerAccess.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Accessing the members of a struct using the pointer notation using a + * nonpointer variable throws a D_OP_PTR error. + * + * SECTION: Structs and Unions/Pointers to Structs + * + */ + +#pragma D option quiet + +struct myinput_struct { + int i; + char c; +}; + +struct myinput_struct f; + +BEGIN +{ + f.i = 10; + f.c = 'c'; + + printf("f->i: %d\tf->c: %c\n", f->i, f->c); + exit(0); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.badpointer.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.badpointer.d new file mode 100644 index 00000000..b1524e53 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_PTR.badpointer.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * -> can only be used with pointer operands. + * + * SECTION: Pointers and Arrays/Pointers and Address Spaces + */ + +#pragma D option quiet + +struct teststruct { + int a; + int b; +}; + +struct teststruct xyz; + +BEGIN +{ + xyz->a = 1; + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.BadPointerAccess.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.BadPointerAccess.d new file mode 100644 index 00000000..75635773 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.BadPointerAccess.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Accessing a pointer to a struct like a non pointer throws a D_OP_SOU. + * + * SECTION: Structs and Unions/Pointers to Structs + * + */ + +#pragma D option quiet + +struct myinput_struct { + int i; + char c; +}; + +struct myinput_struct *f; +BEGIN +{ + f.i = 10; + f.c = 'c'; + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.badpointer.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.badpointer.d new file mode 100644 index 00000000..1b351f34 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.D_OP_SOU.badpointer.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * -> can only be used with pointer to structs and unions. + * + * SECTION: Pointers and Arrays/Pointers and Address Spaces + */ + +#pragma D option quiet + +int *abc; + +BEGIN +{ + abc->a = 1; + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress1.d new file mode 100644 index 00000000..9c9d2f0f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress1.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: D pointers do not allow invalid pointer accesses. + * + * SECTION: Pointers and Arrays/Pointer Safety + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + kmemAddress = &`kmem_flags; + *kmemAddress = 20; + printf("Address of kmem_flags: %d\n", (int) kmemAddress); + printf("Value of kmem_flags: %d\n", `kmem_flags); + exit(0); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d new file mode 100644 index 00000000..324f4011 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: D pointers do not allow invalid pointer accesses. + * + * SECTION: Pointers and Arrays/Pointer Safety + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + x = (int *)alloca(sizeof (int)); + trace(x); + y = (int *) (x - 3300778156056); + *y = 3; + trace(*y); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d new file mode 100644 index 00000000..39bd1140 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: D pointers do not allow invalid pointer accesses. + * + * SECTION: Pointers and Arrays/Pointer Safety + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + y = (int *) (-33007); + *y = 3; + trace(*y); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d new file mode 100644 index 00000000..9d6b1440 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.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: Demonstrating valid memory access. + * + * SECTION: Pointers and Arrays/Pointers and Addresses + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + x = (int *)alloca(sizeof (int)); + printf("Address x: %x\n", (int) x); + y = (int *) (x - 2); + *y = 3; + printf("Address y: %x\tValue: %d\n", (int) y, *y); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d new file mode 100644 index 00000000..64b77289 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.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: + * Using integer arithmetic providing a non-aligned memory address will throw + * a runtime error. + * + * SECTION: Pointers and Arrays/Generic Pointers + * + * NOTES: + * This test doesn't apply to x86; for the time being, we're working + * around this with the preprocessor. + */ + +#pragma D option quiet + +int array[3]; +uintptr_t uptr; +int *p; +int *q; +int *r; + +BEGIN +{ +#ifdef __i386 + exit(1); +#else + array[0] = 20; + array[1] = 40; + array[2] = 80; + + uptr = (uintptr_t) &array[0]; + + p = (int *) (uptr); + q = (int *) (uptr + 2); + r = (int *) (uptr + 3); + + printf("array[0]: %d\t*p: %d\n", array[0], *p); + printf("array[1]: %d\t*q: %d\n", array[1], *q); + printf("array[2]: %d\t*r: %d\n", array[2], *r); + + exit(0); +#endif +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer1.d new file mode 100644 index 00000000..fb9db752 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer1.d @@ -0,0 +1,174 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Declare arrays of different data types and verify that the + * addresses of the individual elements differ by an amount equal to the number + * elements separating them multiplied by the size of each element. + * + * SECTION: Pointers and Arrays/Array Declarations and Storage; + * Pointers and Arrays/Pointer Arithmetic + * + * NOTES: + * + */ + +#pragma D option quiet + +char char_array[5]; +short short_array[5]; +int int_array[5]; +long long_array[5]; +long long long_long_array[5]; +int8_t int8_array[5]; +int16_t int16_array[5]; +int32_t int32_array[5]; +int64_t int64_array[5]; +intptr_t intptr_array[5]; +uint8_t uint8_array[5]; +uint16_t uint16_array[5]; +uint32_t uint32_array[5]; +uint64_t uint64_array[5]; +uintptr_t uintptr_array[5]; + +/* +float float_array[5]; +double double_array[5]; +long double long_double_array[5]; + +string string_array[5]; +*/ + +struct record { + char ch; + int in; +} struct_array[5]; + +struct { + char ch; + int in; +} anon_struct_array[5]; + +union record { + char ch; + int in; +} union_array[5]; + +union { + char ch; + int in; +} anon_union_array[5]; + +enum colors { + RED, + GREEN, + BLUE +} enum_array[5]; + +BEGIN +{ + char_var0 = &char_array[0]; char_var2 = &char_array[2]; + short_var0 = &short_array[0]; short_var3 = &short_array[3]; + int_var3 = &int_array[3]; int_var5 = &int_array[5]; + + long_var0 = &long_array[0]; long_var4 = &long_array[4]; + long_long_var0 = &long_long_array[0]; + long_long_var2 = &long_long_array[2]; + int8_var3 = &int8_array[3]; int8_var5 = &int8_array[5]; + + int16_var0 = &int16_array[0]; int16_var4 = &int16_array[4]; + int32_var0 = &int32_array[0]; int32_var3 = &int32_array[3]; + int64_var0 = &int64_array[0]; int64_var1 = &int64_array[1]; + + uintptr_var0 = &uintptr_array[0]; uintptr_var2 = &uintptr_array[2]; + struct_var0 = &struct_array[0]; struct_var2 = &struct_array[2]; + anon_struct_var3 = &anon_struct_array[3]; + anon_struct_var5 = &anon_struct_array[5]; + + union_var0 = &union_array[0]; union_var3 = &union_array[3]; + anon_union_var0 = &anon_union_array[0]; + anon_union_var4 = &anon_union_array[4]; + enum_var0 = &enum_array[0]; enum_var2 = &enum_array[2]; + + printf("char_var2 - char_var0: %d\n", + (int) char_var2 - (int) char_var0); + printf("short_var3 - short_var0: %d\n", + (int) short_var3 - (int) short_var0); + printf("int_var5 - int_var3: %d\n", (int) int_var5 - (int) int_var3); + + printf("long_var4 - long_var0: %d\n", + (int) long_var4 - (int) long_var0); + printf("long_long_var2 - long_long_var0: %d\n", + (int) long_long_var2 - (int) long_long_var0); + printf("int8_var5 - int8_var3: %d\n", + (int) int8_var5 - (int) int8_var3); + + printf("int16_var4 - int16_var0: %d\n", + (int) int16_var4 - (int) int16_var0); + printf("int32_var3 - int32_var0: %d\n", + (int) int32_var3 - (int) int32_var0); + printf("int64_var1 - int64_var0: %d\n", + (int) int64_var1 - (int) int64_var0); + + printf("uintptr_var2 - uintptr_var0: %d\n", + (int) uintptr_var2 - (int) uintptr_var0); + printf("struct_var2 - struct_var0: %d\n", + (int) struct_var2 - (int) struct_var0); + printf("anon_struct_var5 - anon_struct_var3: %d\n", + (int) anon_struct_var5 - (int) anon_struct_var3); + + printf("union_var3 - union_var0: %d\n", + (int) union_var3 - (int) union_var0); + printf("anon_union_var4 - anon_union_var0: %d\n", + (int) anon_union_var4 - (int) anon_union_var0); + printf("enum_var2 - enum_var0: %d\n", + (int) enum_var2 - (int) enum_var0); + exit(0); +} + +END +/(2 != ((int) char_var2 - (int) char_var0)) || + (6 != ((int) short_var3 - (int) short_var0)) || + (8 != ((int) int_var5 - (int) int_var3)) || + ((32 != ((int) long_var4 - (int) long_var0)) && + (16 != ((int) long_var4 - (int) long_var0))) || + (16 != ((int) long_long_var2 - (int) long_long_var0)) || + (2 != ((int) int8_var5 - (int) int8_var3)) + || (8 != ((int) int16_var4 - (int) int16_var0)) || + (12 != ((int) int32_var3 - (int) int32_var0)) || + (8 != ((int) int64_var1 - (int) int64_var0)) || + ((16 != ((int) uintptr_var2 - (int) uintptr_var0)) + && (8 != ((int) uintptr_var2 - (int) uintptr_var0))) || + (16 != ((int) struct_var2 - (int) struct_var0)) || + (16 != ((int) anon_struct_var5 - (int) anon_struct_var3)) + || (12 != ((int) union_var3 - (int) union_var0)) || + (16 != ((int) anon_union_var4 - (int) anon_union_var0)) || + (8 != ((int) enum_var2 - (int) enum_var0))/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer2.d new file mode 100644 index 00000000..bf645398 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer2.d @@ -0,0 +1,71 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: D permits the use of array [] index notation with both pointer + * variables and array variables. + * + * SECTION: Pointers and Arrays/Pointer and Array Relationship + * + * NOTES: + * + */ + +#pragma D option quiet + +int array[5]; +BEGIN +{ + array[0] = 100; + array[1] = 200; + array[2] = 300; + array[3] = 400; + array[4] = 500; + + p = &array[0]; + + printf("array[0]: %d\tp[0]: %d\n", array[0], p[0]); + printf("array[1]: %d\tp[1]: %d\n", array[1], p[1]); + printf("array[2]: %d\tp[2]: %d\n", array[2], p[2]); + printf("array[3]: %d\tp[3]: %d\n", array[3], p[3]); + printf("array[4]: %d\tp[4]: %d\n", array[4], p[4]); + + exit(0); + +} + +END +/(array[0] != p[0]) || (array[1] != p[1]) || (array[2] != p[2]) || + (array[3] != p[3]) || (array[4] != p[4])/ +{ + printf("Error"); + exit(1); +} + + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer3.d new file mode 100644 index 00000000..a0be1306 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ArrayPointer3.d @@ -0,0 +1,72 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: In D, the an array variable can be assigned to a pointer. + * + * SECTION: Pointers and Arrays/Pointer and Array Relationship + * + * NOTES: + * + */ + +#pragma D option quiet + +int array[5]; +int *p; + +BEGIN +{ + array[0] = 100; + array[1] = 200; + array[2] = 300; + array[3] = 400; + array[4] = 500; + + p = array; + + printf("array[0]: %d\tp[0]: %d\n", array[0], p[0]); + printf("array[1]: %d\tp[1]: %d\n", array[1], p[1]); + printf("array[2]: %d\tp[2]: %d\n", array[2], p[2]); + printf("array[3]: %d\tp[3]: %d\n", array[3], p[3]); + printf("array[4]: %d\tp[4]: %d\n", array[4], p[4]); + + exit(0); + +} + +END +/(array[0] != p[0]) || (array[1] != p[1]) || (array[2] != p[2]) || + (array[3] != p[3]) || (array[4] != p[4])/ +{ + printf("Error"); + exit(1); +} + + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.GlobalVar.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.GlobalVar.d new file mode 100644 index 00000000..8b7f36e3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.GlobalVar.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Pointer declarations are global. + * + * SECTION: Pointers and Arrays/Pointers and Addresses + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; + kmemAddress = &`kmem_flags; + kmemValue = *kmemAddress; + printf("Address of kmem_flags: %x\n", (int) kmemAddress); + printf("Value of kmem_flags: %d\n", kmemValue); +} + +profile:::tick-1sec +/(i < 1) && (&`kmem_flags == kmemAddress) && (*kmemAddress == kmemValue)/ +{ + exit(1); +} + +END +/(&`kmem_flags == kmemAddress) && (*kmemAddress == kmemValue)/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.IntegerArithmetic1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.IntegerArithmetic1.d new file mode 100644 index 00000000..99cbd7e5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.IntegerArithmetic1.d @@ -0,0 +1,72 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Integer arithmetic can be performed on pointers by casting to uintptr_t. + * + * SECTION: Pointers and Arrays/Generic Pointers + * + * NOTES: + * + */ + +#pragma D option quiet + +int array[3]; +uintptr_t uptr; +int *p; +int *q; +int *r; + +BEGIN +{ + array[0] = 20; + array[1] = 40; + array[2] = 80; + + uptr = (uintptr_t) &array[0]; + + p = (int *) (uptr); + q = (int *) (uptr + 4); + r = (int *) (uptr + 8); + + printf("array[0]: %d\t*p: %d\n", array[0], *p); + printf("array[1]: %d\t*q: %d\n", array[1], *q); + printf("array[2]: %d\t*r: %d\n", array[2], *r); + + exit(0); +} + +END +/(20 != *p) || (40 != *q) || (80 != *r)/ +{ + printf("Error"); + exit(1); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic1.d new file mode 100644 index 00000000..3a968325 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic1.d @@ -0,0 +1,58 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Pointer arithmetic implicitly adjusts the underlying address by + * multiplying or dividing the operands by the size of the type referenced + * by the pointer. + * + * SECTION: Pointers and Arrays/Pointer Arithmetic + * + * NOTES: + * + */ + +#pragma D option quiet + +int *x; + +BEGIN +{ + printf("x: %x\n", (int) x); + printf("x + 1: %x\n", (int) (x+1)); + printf("x + 2: %x\n", (int) (x+2)); + exit(0); +} + +END +/(0 != (int) x) || (4 != (int) (x+1)) || (8 != (int) (x+2))/ +{ + printf("Error"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic2.d new file mode 100644 index 00000000..ac55eb44 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic2.d @@ -0,0 +1,72 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * D pointers can be used to refer to consecutive storage locations like + * arrays. + * + * SECTION: Pointers and Arrays/Pointer and Array Relationship + * + * NOTES: + * + */ + +#pragma D option quiet + +int array[5]; +BEGIN +{ + array[0] = 100; + array[1] = 200; + array[2] = 300; + array[3] = 400; + array[4] = 500; + + p = &array[0]; + + printf("array[0]: %d\t*p: %d\n", array[0], *p); + printf("array[1]: %d\t*(p+1): %d\n", array[1], *(p+1)); + printf("array[2]: %d\t*(p+2): %d\n", array[2], *(p+2)); + printf("array[3]: %d\t*(p+3): %d\n", array[3], *(p+3)); + printf("array[4]: %d\t*(p+4): %d\n", array[4], *(p+4)); + + exit(0); + +} + +END +/(array[0] != *p) || (array[1] != *(p+1)) || (array[2] != *(p+2)) + || (array[3] != *(p+3)) || (array[4] != *(p+4))/ +{ + printf("Error"); + exit(1); +} + + + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic3.d new file mode 100644 index 00000000..a4f4bfc4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerArithmetic3.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Pointer arithmetic implicitly adjusts the underlying address by + * multiplying or dividing the operands by the size of the type referenced + * by the pointer. + * + * SECTION: Pointers and Arrays/Pointer Arithmetic + * + * NOTES: + * + */ + +#pragma D option quiet + +int *x; +int *y; +int a[5]; + +BEGIN +{ + x = &a[0]; + y = &a[2]; + + printf("y-x: %x\n", (int) (y-x)); + exit(0); +} + +END +/(2 != (int) (y-x)) / +{ + printf("Error"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerAssignment.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerAssignment.d new file mode 100644 index 00000000..3a496869 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.PointerAssignment.d @@ -0,0 +1,71 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Pointers assignment simply copies over the pointer address in the + * variable on the right hand side into the variable on the left hand side. + * + * SECTION: Pointers and Arrays/Pointer and Array Relationship + * + * NOTES: + * + */ + +#pragma D option quiet + +int array[3]; +int *ptr1; +int *ptr2; + +BEGIN +{ + array[0] = 200; + array[1] = 400; + array[2] = 600; + + ptr1 = array; + ptr2 = ptr1; + + ptr2[0] = 400; + ptr2[1] = 800; + ptr2[2] = 1200; + + printf("array[0]: %d\tptr2[0]: %d\n", array[0], ptr2[0]); + printf("array[1]: %d\tptr2[1]: %d\n", array[1], ptr2[1]); + printf("array[2]: %d\tptr2[2]: %d\n", array[2], ptr2[2]); + + exit(0); + +} + +END +/(array[0] != 400) || (array[1] != 800) || (array[2] != 1200)/ +{ + printf("Error"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer1.d new file mode 100644 index 00000000..5d9db388 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer1.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Demonstrating valid memory access. + * + * SECTION: Pointers and Arrays/Pointers and Addresses + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + x = (int *)alloca(sizeof (int)); + printf("Address x: %x\n", (int) x); + y = (int *) (x); + *y = 3; + printf("Address y: %x\tValue: %d\n", (int) y, *y); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer2.d new file mode 100644 index 00000000..26d698ae --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.ValidPointer2.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Demonstrating valid memory access. + * + * SECTION: Pointers and Arrays/Pointers and Addresses + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + x = (int *)alloca(sizeof (int)); + printf("Address x: %x\n", (int) x); + y = (int *) (x + 2); + *y = 3; + printf("Address y: %x\tValue: %d\n", (int) y, *y); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.VoidCast.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.VoidCast.d new file mode 100644 index 00000000..296fdf40 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.VoidCast.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Can dereference a void * pointer only by casting it to another type. + * + * SECTION: Pointers and Arrays/Generic Pointers + */ + +#pragma D option quiet + +void *p; + +int array[3]; + +BEGIN +{ + array[0] = 234; + array[1] = 334; + array[2] = 434; + + p = &array[0]; + newp = (int *) p; + + printf("array[0]: %d, newp: %d\n", array[0], *newp); + exit(0); +} + +END +/234 != *newp/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.basic1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.basic1.d new file mode 100644 index 00000000..bf3154a0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.basic1.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Pointers can be stored in variables. + * + * SECTION: Pointers and Arrays/Pointers and Addresses + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + kmemAddress = &`kmem_flags; + kmemValue = *kmemAddress; + printf("Address of kmem_flags: %x\n", (int) kmemAddress); + printf("Value of kmem_flags: %d\n", kmemValue); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.basic2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.basic2.d new file mode 100644 index 00000000..6b72b632 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pointers/tst.basic2.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Pointers can be stored in associative arrays. + * + * SECTION: Pointers and Arrays/Pointers and Addresses + * + * NOTES: + * + */ + +#pragma D option quiet + +BEGIN +{ + assoc_array["kmemAddress"] = &`kmem_flags; + kmemValue = *(assoc_array["kmemAddress"]); + printf("Address of kmem_flags: %x\n", (int) assoc_array["kmemAddress"]); + printf("Value of kmem_flags: %d\n", kmemValue); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGERR.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGERR.d new file mode 100644 index 00000000..863ddc86 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGERR.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify pragma errors + * + * SECTION: Pragmas + */ + + +#pragma D error "this is an error message" + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_DEPEND.main.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_DEPEND.main.d new file mode 100644 index 00000000..0b5a3402 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_DEPEND.main.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * It isn't permitted for a main program to contain a depends_on imperative. + */ + +#pragma D depends_on library net.d + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_INVAL.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_INVAL.d new file mode 100644 index 00000000..c6fd1471 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_INVAL.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify invalid attributes + * + * SECTION: Pragmas; + * Stabilty/Interface Attributes + */ + + +inline int foo + +#pragma D attributes incorrect_attr foo + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_MALFORM.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_MALFORM.d new file mode 100644 index 00000000..7f0ba232 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_MALFORM.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify malformed pragma argument list + * + * SECTION: Pragmas + */ + + +#pragma D attributes incorrect_attr + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_UNUSED.UnusedPragma.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_UNUSED.UnusedPragma.d new file mode 100644 index 00000000..da2336bc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_UNUSED.UnusedPragma.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Unused pragmas throw error D_PRAGMA_UNUSED + * + * SECTION: Errtags/D_PRAGMA_UNUSED + * + */ + +void func(int, int); + +#pragma D option quiet +#pragma D attributes Stable/Stable/Common func; + +BEGIN +{ + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.circlibdep.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.circlibdep.ksh new file mode 100644 index 00000000..6fbace8d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.circlibdep.ksh @@ -0,0 +1,58 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +libdir=${TMPDIR:-/tmp}/libdep.$$ +dtrace=$1 + +setup_libs() +{ + mkdir $libdir + cat > $libdir/liba.$$.d <<EOF +#pragma D depends_on library libb.$$.d +EOF + cat > $libdir/libb.$$.d <<EOF +#pragma D depends_on library libc.$$.d +EOF + cat > $libdir/libc.$$.d <<EOF +#pragma D depends_on library liba.$$.d +EOF +} + + +setup_libs + +$dtrace -L$libdir -e + +status=$? +rm -rf $libdir +return $status + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.invalidlibdep.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.invalidlibdep.ksh new file mode 100644 index 00000000..b05ae3dc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/err.invalidlibdep.ksh @@ -0,0 +1,57 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +libdir=${TMPDIR:-/tmp}/libdep.$$ +dtrace=$1 + +setup_libs() +{ + mkdir $libdir + cat > $libdir/liba.$$.d <<EOF +#pragma D depends_on library libnotthere.$$.d +EOF + cat > $libdir/libb.$$.d <<EOF +#pragma D depends_on library libc.$$.d +EOF + cat > $libdir/libc.$$.d <<EOF +#pragma D depends_on library liba.$$.d +EOF +} + + +setup_libs + +$dtrace -L$libdir -e + +status=$? +rm -rf $libdir +return $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh new file mode 100644 index 00000000..7c92243f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh @@ -0,0 +1,58 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +libdir=${TMPDIR:-/tmp}/libdep.$$ +dtrace=$1 + +setup_libs() +{ + mkdir $libdir + cat > $libdir/liba.$$.d <<EOF +#pragma D depends_on library libb.$$.d + +inline int foo = bar; +EOF + cat > $libdir/libb.$$.d <<EOF +#pragma D depends_on module doogle_knows_all_probes + +inline int bar = 0xd0061e; +EOF +} + + +setup_libs + +$dtrace -L$libdir -e + +status=$? +rm -rf $libdir +return $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libdep.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libdep.ksh new file mode 100644 index 00000000..38b34606 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libdep.ksh @@ -0,0 +1,66 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +libdir=${TMPDIR:-/tmp}/libdep.$$ +dtrace=$1 + +setup_libs() +{ + mkdir $libdir + cat > $libdir/liba.$$.d <<EOF +#pragma D depends_on library libb.$$.d +#pragma D depends_on library libc.$$.d +#pragma D depends_on library libd.$$.d +EOF + cat > $libdir/libb.$$.d <<EOF +#pragma D depends_on library libc.$$.d +EOF + cat > $libdir/libc.$$.d <<EOF +EOF + cat > $libdir/libd.$$.d <<EOF +EOF + cat > $libdir/libe.$$.d <<EOF +#pragma D depends_on library liba.$$.d +EOF + cat > $libdir/libf.$$.d <<EOF +EOF +} + + +setup_libs + +$dtrace -L$libdir -e + +status=$? +rm -rf $libdir +return $status + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libdepfullyconnected.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libdepfullyconnected.ksh new file mode 100644 index 00000000..e95de696 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/pragma/tst.libdepfullyconnected.ksh @@ -0,0 +1,100 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This test verifies that we can generate the correct ordering for +# a given dependency specification. All files either have a dependency +# on another file or are the dependent of another file. In this way we +# guarantee consistent ordering as no nodes in the dependency graph will +# be isolated. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +tmpfile=/tmp/libdeporder.$$ +libdir=${TMPDIR:-/tmp}/libdep.$$ +dtrace=$1 + +setup_libs() +{ + mkdir $libdir + cat > $libdir/liba.$$.d <<EOF +#pragma D depends_on library libd.$$.d +EOF + cat > $libdir/libb.$$.d <<EOF +EOF + cat > $libdir/libc.$$.d <<EOF +#pragma D depends_on library libe.$$.d +EOF + cat > $libdir/libd.$$.d <<EOF +#pragma D depends_on library libb.$$.d +EOF + cat > $libdir/libe.$$.d <<EOF +#pragma D depends_on library liba.$$.d +EOF +} + + +setup_libs + +DTRACE_DEBUG=1 $dtrace -L$libdir -e >$tmpfile 2>&1 + +perl /dev/stdin $tmpfile <<EOF + + @order = qw(libc libe liba libd libb); + + while (<>) { + if (\$_ =~ /lib[a-e]\.[0-9]+.d/) { + \$pos = length \$_; + for (\$i=0; \$i<=1;\$i++) { + \$pos = rindex(\$_, "/", \$pos); + \$pos--; + } + + push(@new, substr(\$_, \$pos+2, 4)); + next; + } + next; + } + + exit 1 if @new != @order; + + while (@new) { + exit 1 if pop(@new) ne pop(@order); + } + + exit 0; +EOF + + +status=$? +rm -rf $libdir +rm $tmpfile +return $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d new file mode 100644 index 00000000..5f02b7a4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Predicate result must be of scalar type. + * + * SECTION: Errtags/ D_PRED_SCALAR + * + */ + +#pragma D option quiet +int a[4]; + +BEGIN +/a/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d new file mode 100644 index 00000000..391d4256 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple if,then operation test. + * Call invalid conditions and make sure it gives compilation error. + * + * SECTION: Program Structure/Predicates + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile-1 +/i < != > 10/ +{ + i++; + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d new file mode 100644 index 00000000..8ffab279 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple if,then operations test. + * Call impossible conditions and make sure compilation fails. + * + * SECTION: Program Structure/Predicates + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile-1 +/i != 0 && >= 5 || <= 10/ +{ + i++; + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d new file mode 100644 index 00000000..f461c5dd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d @@ -0,0 +1,55 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +int schedules; +int executes; + +/* + * This script is a bit naughty: it's assuming the implementation of the + * VM system's page scanning. If this implementation changes -- either by + * changing the function that scans pages or by making that scanning + * multithreaded -- this script will break. + */ +fbt::timeout:entry +/args[0] == (void *)&genunix`schedpaging/ +{ + schedules++; +} + +fbt::schedpaging:entry +/executes == 10/ +{ + printf("%d schedules, %d executes\n", schedules, executes); + exit(executes == schedules ? 0 : 1); +} + +fbt::schedpaging:entry +{ + executes++; +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d new file mode 100644 index 00000000..9b43b619 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d @@ -0,0 +1,57 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple if,then operations test. + * Call simple expressions and make sure test satisfy conditions. + * Match expected output in tst.basics.d.out + * + * SECTION: Program Structure/Predicates + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +tick-10ms +/i < 10/ +{ + i++; + trace(i); +} + +tick-10ms +/i == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out new file mode 100644 index 00000000..2a5b99aa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out @@ -0,0 +1 @@ +12345678910 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d new file mode 100644 index 00000000..d08543f0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d @@ -0,0 +1,126 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Complex operations and if,then test. + * Call 'n' permutation and combination of operations over if,then. + * Match expected output in tst.complex.d.out + * + * SECTION: Program Structure/Predicates + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; + j = 0; +} + +tick-10ms +/i < 10/ +{ + i++; + j++; + printf("\n\n%d\n------\n", i); +} + +tick-10ms +/i == 5 || i == 10/ +{ + printf("i == 5 (or) i == 10\n"); +} + +tick-10ms +/i <= 5/ +{ + printf("i <= 5\n"); +} + +tick-10ms +/j >= 5/ +{ + printf("j >= 5\n"); +} + +tick-10ms +/j >= 5 || i <= 5/ +{ + printf("i >= 5 || j >= 5\n"); +} + +tick-10ms +/j >= 5 && i <= 5/ +{ + printf("j >= 5 && i <= 55\n"); +} + +tick-10ms +/i < 5/ +{ + printf("i < 5\n"); +} + +tick-10ms +/i == 2 || j == 2/ +{ + printf("i == 2 (or) j == 2\n"); +} + +tick-10ms +/i == 2 && j == 2/ +{ + printf("i == 2 (and) j == 2\n"); +} + +tick-10ms +/j != 10/ +{ + printf("j != 10\n"); +} + +tick-10ms +/j == 5 || i == 2/ +{ + printf("j == 5 || i == 2\n"); +} + +tick-10ms +/j == 5 && i == 2/ +{ + printf("j == 5 && i == 2\n"); +} + +tick-10ms +/i == 10/ +{ + printf("i == 10\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out new file mode 100644 index 00000000..5f16dbdb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out @@ -0,0 +1,83 @@ + + +1 +------ +i <= 5 +i >= 5 || j >= 5 +i < 5 +j != 10 + + +2 +------ +i <= 5 +i >= 5 || j >= 5 +i < 5 +i == 2 (or) j == 2 +i == 2 (and) j == 2 +j != 10 +j == 5 || i == 2 + + +3 +------ +i <= 5 +i >= 5 || j >= 5 +i < 5 +j != 10 + + +4 +------ +i <= 5 +i >= 5 || j >= 5 +i < 5 +j != 10 + + +5 +------ +i == 5 (or) i == 10 +i <= 5 +j >= 5 +i >= 5 || j >= 5 +j >= 5 && i <= 55 +j != 10 +j == 5 || i == 2 + + +6 +------ +j >= 5 +i >= 5 || j >= 5 +j != 10 + + +7 +------ +j >= 5 +i >= 5 || j >= 5 +j != 10 + + +8 +------ +j >= 5 +i >= 5 || j >= 5 +j != 10 + + +9 +------ +j >= 5 +i >= 5 || j >= 5 +j != 10 + + +10 +------ +i == 5 (or) i == 10 +j >= 5 +i >= 5 || j >= 5 +i == 10 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh new file mode 100644 index 00000000..f06edcb5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh @@ -0,0 +1,197 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +unload() +{ + # + # Get the list of services whose processes have USDT probes. Ideally + # it would be possible to unload the fasttrap provider while USDT + # probes exist -- once that fix is integrated, this hack can go away + # We create two lists -- one of regular SMF services and one of legacy + # services -- since each must be enabled and disabled using a specific + # mechanism. + # + pids=$(dtrace -l | \ + perl -ne 'print "$1\n" if (/^\s*\S+\s+\S*\D(\d+)\s+/);' | \ + sort | uniq | tr '\n' ',') + + ctids=$(ps -p $pids -o ctid | tail +2 | sort | uniq) + svcs= + lrcs= + + for ct in $ctids + do + line=$(svcs -o fmri,ctid | grep " $ct\$") + svc=$(echo $line | cut -d' ' -f1) + + if [[ $(svcs -Ho STA $svc) == "LRC" ]]; then + lrc=$(svcs -Ho SVC $svc | tr _ '?') + lrcs="$lrcs $lrc" + else + svcs="$svcs $svc" + fi + done + + for svc in $svcs + do + svcadm disable -ts $svc + done + + for lrc in $lrcs + do + # + # Does it seem a little paternalistic that lsvcrun requires + # this environment variable to be set? I'd say so... + # + SMF_RESTARTER=svc:/system/svc/restarter:default \ + /lib/svc/bin/lsvcrun $lrc stop + done + + modunload -i 0 + modunload -i 0 + modunload -i 0 + modinfo | grep dtrace + success=$? + + for svc in $svcs + do + svcadm enable -ts $svc + done + + for lrc in $lrcs + do + SMF_RESTARTER=svc:/system/svc/restarter:default \ + /lib/svc/bin/lsvcrun $lrc start + done + + if [ ! $success ]; then + echo $tst: could not unload dtrace + exit 1 + fi +} + +script1() +{ + $dtrace -s /dev/stdin <<EOF + syscall:::entry + /pid != $ppid/ + { + @a[probefunc] = count(); + } + + tick-1sec + /i++ == 5/ + { + exit(0); + } +EOF +} + +script2() +{ + $dtrace -s /dev/stdin <<EOF + + #pragma D option statusrate=1ms + + syscall:::entry + /pid == $ppid/ + { + ttl++; + } + + tick-1sec + /i++ == 5/ + { + exit(2); + } + + END + /ttl/ + { + printf("success; ttl is %d", ttl); + exit(0); + } + + END + /ttl == 0/ + { + printf("error -- total should be non-zero"); + exit(1); + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +ppid=$$ +dtrace=$1 + +unload +script1 & +child=$! + +let waited=0 + +while [ "$waited" -lt 5 ]; do + seconds=`date +%S` + + if [ "$seconds" -ne "$last" ]; then + last=$seconds + let waited=waited+1 + fi +done + +wait $child +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: first dtrace failed + exit $status +fi + +unload +script2 & +child=$! + +let waited=0 + +while [ "$waited" -lt 10 ]; do + seconds=`date +%S` + + if [ "$seconds" -ne "$last" ]; then + last=$seconds + let waited=waited+1 + fi +done + +wait $child +status=$? + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_IDENT_UNDEF.afterprobe.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_IDENT_UNDEF.afterprobe.d new file mode 100644 index 00000000..ac63b43e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_IDENT_UNDEF.afterprobe.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + + +/* + * ASSERTION: + * + * Declare 'ifdef' statements after probe clause definition and + * attempt to print the value before that. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + + +#pragma D option quiet + +tick-10ms +{ + + printf("The value is %d\n", VALUE); + exit(0); +} +#if !defined (FLAG) +#define VALUE 5 +#endif diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d new file mode 100644 index 00000000..e79ad2e5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_PRAGCTL_INVAL.tabdefine.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call #define statement not in first column, just after a tab. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + + #define VALUE 5 + + +#pragma D option quiet + +tick-10ms +{ + printf("The VALUE is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_SYNTAX.withoutpound.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_SYNTAX.withoutpound.d new file mode 100644 index 00000000..aac2bcf9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.D_SYNTAX.withoutpound.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Just call a 'define' statement without '#' + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +define VALUE 5 + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.defincomp.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.defincomp.d new file mode 100644 index 00000000..750ce6dd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.defincomp.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a incomplete #define statement + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#define + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefelsenotendif.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefelsenotendif.d new file mode 100644 index 00000000..6ad696a7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefelsenotendif.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call ifdef statement without endif statement. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if !defined (FLAG) +#define RETURN 5 +#else +#define RETURN 10 + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", RETURN); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefincomp.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefincomp.d new file mode 100644 index 00000000..37c637c9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefincomp.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call a 'if !defined' incomplete statement. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if !defined +#define VALUE 5 + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefnotendif.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefnotendif.d new file mode 100644 index 00000000..09fdb170 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.ifdefnotendif.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Call a complete '!ifdefine' statement but without 'endif' statement. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if !defined (FLAG) +#define VALUE 5 + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.incompelse.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.incompelse.d new file mode 100644 index 00000000..ee92f69c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.incompelse.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Just call a #else statement + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#else + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.mulelse.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.mulelse.d new file mode 100644 index 00000000..958f4e2b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/err.mulelse.d @@ -0,0 +1,55 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Attempt to declare a multiple else 'ifdef' declarations. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if !defined (FLAG) +#define VALUE 5 +#else +#define VALUE 10 +#else +#define VALUE 15 +#else +#define VALUE 20 +#endif + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d new file mode 100644 index 00000000..a17ee0e2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple test to test 'if defined' 'defined' 'else' 'endif' + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if defined (FLAG) +#define VALUE 5 +#else +#define VALUE 10 +#endif + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d.out new file mode 100644 index 00000000..2bde5e93 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifdef.d.out @@ -0,0 +1,2 @@ +The value is 10 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d new file mode 100644 index 00000000..b40cf012 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d @@ -0,0 +1,55 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple test for 'ifndef'. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#ifndef FLAG +#define FLAG +#endif + +#if defined (FLAG) +#define VALUE 5 +#else +#define VALUE 10 +#endif + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d.out new file mode 100644 index 00000000..d51d19fc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifndef.d.out @@ -0,0 +1,2 @@ +The value is 5 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d new file mode 100644 index 00000000..345a82f7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple if !defined, define, else and endif test + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if !defined (FLAG) +#define VALUE 5 +#else +#define VALUE 10 +#endif + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d.out new file mode 100644 index 00000000..d51d19fc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.ifnotdef.d.out @@ -0,0 +1,2 @@ +The value is 5 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d new file mode 100644 index 00000000..c8ea3481 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple !defined, logical 'and' (&&) test. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if !defined (FLAG) && !defined(STATUS) +#define VALUE 0 +#else +#define VALUE 1 +#endif + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d.out new file mode 100644 index 00000000..350295cc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicaland.d.out @@ -0,0 +1,2 @@ +The value is 0 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d new file mode 100644 index 00000000..63637d3c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple !defined logical-or(||) and logical-and(&&) test. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if !defined (FLAG) || !defined(STATUS) && !defined(STATE) +#define VALUE 0 +#else +#define VALUE 1 +#endif + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d.out new file mode 100644 index 00000000..350295cc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalandor.d.out @@ -0,0 +1,2 @@ +The value is 0 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d new file mode 100644 index 00000000..b99ee1dd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * if !defined (logical-or) usage. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if !defined (FLAG) || !defined(STATUS) +#define VALUE 0 +#else +#define VALUE 1 +#endif + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d.out new file mode 100644 index 00000000..350295cc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.logicalor.d.out @@ -0,0 +1,2 @@ +The value is 0 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d new file mode 100644 index 00000000..9bca2cb0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * if !defined multiple logical-and(&&) usage. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if !defined (FLAG) && !defined(STATUS) && !defined(STATE) +#define VALUE 0 +#else +#define VALUE 1 +#endif + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d.out new file mode 100644 index 00000000..350295cc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.muland.d.out @@ -0,0 +1,2 @@ +The value is 0 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d new file mode 100644 index 00000000..1d0c4d97 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple multiple ifdefined logical-or(||) test. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if !defined (FLAG) || !defined(STATUS) || !defined(STATE) +#define VALUE 0 +#else +#define VALUE 1 +#endif + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d.out new file mode 100644 index 00000000..350295cc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.mulor.d.out @@ -0,0 +1,2 @@ +The value is 0 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d new file mode 100644 index 00000000..1d21d472 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple #define test. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#define value 5 + + +#pragma D option quiet + +tick-10ms +/value == 5/ +{ + printf("The value is %d\n", value); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d.out new file mode 100644 index 00000000..d51d19fc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.precondi.d.out @@ -0,0 +1,2 @@ +The value is 5 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.predicatedeclare.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.predicatedeclare.d new file mode 100644 index 00000000..db5e94bb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.predicatedeclare.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Attempt to declare 'ifdef' statement inbetween probe declaration + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + + +#pragma D option quiet + +tick-10ms +#if !defined (FLAG) +#define VALUE 5 +#endif +{ + + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d new file mode 100644 index 00000000..044e5a1b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple #define and predicates test. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#define MAXVAL 10 * 15 + + +#pragma D option quiet + +tick-10ms +/MAXVAL > 5/ +{ + printf("The value is %d\n", MAXVAL); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d.out new file mode 100644 index 00000000..7ae49795 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexp.d.out @@ -0,0 +1,2 @@ +The value is 150 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d new file mode 100644 index 00000000..d917d334 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple ifdefined, define, else, endif test. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#if defined (FLAG) +#define VALUE 5 +#else +#define VALUE 10 +#endif + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d.out new file mode 100644 index 00000000..2bde5e93 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpelse.d.out @@ -0,0 +1,2 @@ +The value is 10 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d new file mode 100644 index 00000000..b0ae3953 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple define, if defined, define and endif tests. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#define FLAG 1 +#if defined (FLAG) +#define VALUE 5 +#endif + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d.out new file mode 100644 index 00000000..d51d19fc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpif.d.out @@ -0,0 +1,2 @@ +The value is 5 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d new file mode 100644 index 00000000..c6210d09 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple define, if defined, else, endif test. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + +#define FLAG 1 +#if defined (FLAG) +#define VALUE 5 +#else +#define VALUE 10 +#endif + + +#pragma D option quiet + +tick-10ms +{ + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d.out new file mode 100644 index 00000000..d51d19fc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.preexpifelse.d.out @@ -0,0 +1,2 @@ +The value is 5 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.withinprobe.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.withinprobe.d new file mode 100644 index 00000000..83a2445b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/preprocessor/tst.withinprobe.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a 'ifdef' section inside a probe clause. + * + * SECTION: Program Structure/Use of the C Preprocessor + * + */ + + +#pragma D option quiet + +tick-10ms +{ + +#if !defined (FLAG) +#define VALUE 5 +#endif + + printf("The value is %d\n", VALUE); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badagg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badagg.d new file mode 100644 index 00000000..817d9ac0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badagg.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invokes printa() with a bad aggregation argument. + * + * SECTION: Output Formatting/printa() + * + */ + +BEGIN +{ + printa("%d", 123); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badfmt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badfmt.d new file mode 100644 index 00000000..5a419822 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badfmt.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invokes printa() with a bad format string. + * + * SECTION: Output Formatting/printa() + * + */ + +BEGIN +{ + printa(123); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badval.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badval.d new file mode 100644 index 00000000..e8663ab7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_AGGARG.badval.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invokes printa() with an argument that does not match the aggregation + * convertion. + * + * SECTION: Output Formatting/printa() + * + */ + +BEGIN +{ + printa("%@d\n", 123); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_PROTO.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_PROTO.bad.d new file mode 100644 index 00000000..8e202f6d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTA_PROTO.bad.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invokes printa() with a bad aggregation argument. + * + * SECTION: Output Formatting/printa() + * + */ + +BEGIN +{ + printa("%d"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d new file mode 100644 index 00000000..09b4b27f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d @@ -0,0 +1,36 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +BEGIN +{ + @[jstack()] = count(); + + printa("%p\n", @); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.stack.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.stack.d new file mode 100644 index 00000000..8815ad68 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.stack.d @@ -0,0 +1,36 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +BEGIN +{ + @[stack()] = count(); + + printa("%p\n", @); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d new file mode 100644 index 00000000..bce1b673 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d @@ -0,0 +1,36 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +BEGIN +{ + @[ustack()] = count(); + + printa("%p\n", @); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.basics.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.basics.d new file mode 100644 index 00000000..f5353870 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.basics.d @@ -0,0 +1,58 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Test the basic formatting of all the supported kinds of aggregations. + * + * SECTION: Output Formatting/printa() + * + */ + +#pragma D option quiet + +BEGIN +{ + @a = avg(1); + @b = count(); + @c = lquantize(1, 1, 10); + @d = max(1); + @e = min(1); + @f = sum(1); + @g = quantize(1); + @h = stddev(1); + + printa("@a = %@u\n", @a); + printa("@b = %@u\n", @b); + printa("@c = %@d\n", @c); + printa("@d = %@u\n", @d); + printa("@e = %@u\n", @e); + printa("@f = %@u\n", @f); + printa("@g = %@d\n", @g); + printa("@h = %@d\n", @h); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.basics.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.basics.d.out new file mode 100644 index 00000000..ddad2134 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.basics.d.out @@ -0,0 +1,19 @@ +@a = 1 +@b = 1 +@c = + value ------------- Distribution ------------- count + < 1 | 0 + 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1 + 2 | 0 + +@d = 1 +@e = 1 +@f = 1 +@g = + value ------------- Distribution ------------- count + 0 | 0 + 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1 + 2 | 0 + +@h = 0 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.def.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.def.d new file mode 100644 index 00000000..50011e3f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.def.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the printa() default output format. + * + * SECTION: Output Formatting/printa() + * + */ + +#pragma D option quiet + +BEGIN +{ + @a = count(); + printa(@a); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.def.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.def.d.out new file mode 100644 index 00000000..7cf67012 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.def.d.out @@ -0,0 +1,3 @@ + + 1 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d new file mode 100644 index 00000000..f3379c98 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + /* + * Yes, this works. But is it useful? And is it useful to someone + * other than jwadams and/or dep? + */ + @[10, 100] = sum(1); + @[-10, 200] = sum(2); + + printa("-->%-*d<--\n", @); + printa("-->%*d<--\n", @); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d.out new file mode 100644 index 00000000..f6c53eb9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.dynwidth.d.out @@ -0,0 +1,5 @@ +-->100 <-- +-->200 <-- +--> 100<-- +-->200 <-- + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.fmt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.fmt.d new file mode 100644 index 00000000..8f8cd41b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.fmt.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the printa() format string in its simplest form. + * + * SECTION: Output Formatting/printa() + */ + +#pragma D option quiet + +BEGIN +{ + @a = count(); + printa("%@u", @a); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.fmt.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.fmt.d.out new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.fmt.d.out @@ -0,0 +1 @@ +1 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh new file mode 100644 index 00000000..ed375fdb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh @@ -0,0 +1,83 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.c <<EOF +void +thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog(void) +{ + while (1) + ; +} + +int +main(int argc, char *argv[]) +{ + thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog(); +} +EOF + +cc -o test test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi + +script() +{ + $dtrace -c ./test -qs /dev/stdin <<EOF + profile:::profile-1001hz + /pid == \$target/ + { + @[arg1] = count(); + } + + tick-1s + /n++ > 10/ + { + printa("%A %@d\n", @); + exit(0); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.many.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.many.d new file mode 100644 index 00000000..5bd3eae7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.many.d @@ -0,0 +1,76 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=32m +#pragma D option bufpolicy=fill +#pragma D option destructive +#pragma D option quiet + +BEGIN +/0 == 1/ +{ + @ = count(); +} + +BEGIN +{ + freopen("/dev/null"); +} + +profile-4000hz +{ + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); + printa(@); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.manyval.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.manyval.d new file mode 100644 index 00000000..c9fae843 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.manyval.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the use of many aggregation results in the same format string. + * + * SECTION: Output Formatting/printa() + * + */ + +#pragma D option quiet + +BEGIN +{ + @a = count(); + printa("%@u %@u %@u %@u %@u %@u %@u\n", @a); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.manyval.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.manyval.d.out new file mode 100644 index 00000000..f08b797e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.manyval.d.out @@ -0,0 +1,2 @@ +1 1 1 1 1 1 1 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.stack.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.stack.d new file mode 100644 index 00000000..88dbb1a7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.stack.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +BEGIN +{ + @[stack()] = count(); + @[ustack()] = count(); + @[jstack()] = count(); + + printa("%k\n", @); + printa("%-20k\n", @); + printa("%60k\n", @); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.tuple.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.tuple.d new file mode 100644 index 00000000..0eea887b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.tuple.d @@ -0,0 +1,55 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the use of tuple arguments in the printa() format. + * + * SECTION: Output Formatting/printa() + * + * NOTES: + * We confirm that we can consume fewer arguments than in the tuple, all + * the way up to the exact number. + */ + +#pragma D option quiet + +BEGIN +{ + @a[1, 2, 3, 4, 5] = count(); + printf("\n"); + + printa("%@u: -\n", @a); + printa("%@u: %d\n", @a); + printa("%@u: %d %d\n", @a); + printa("%@u: %d %d %d\n", @a); + printa("%@u: %d %d %d %d\n", @a); + printa("%@u: %d %d %d %d %d\n", @a); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.tuple.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.tuple.d.out new file mode 100644 index 00000000..928119c9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.tuple.d.out @@ -0,0 +1,8 @@ + +1: - +1: 1 +1: 1 2 +1: 1 2 3 +1: 1 2 3 4 +1: 1 2 3 4 5 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh new file mode 100644 index 00000000..bb0d5a0f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh @@ -0,0 +1,62 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +# The output files assumes the timezone is US/Pacific +TZ=US/Pacific + +$dtrace -s /dev/stdin <<EOF +#pragma D option quiet +#pragma D option destructive + +BEGIN +{ + @foo = min(1075064400 * (hrtime_t)1000000000); + @bar = max(walltimestamp); + printa("%@T\n", @foo); + printa("%@Y\n", @foo); + + freopen("/dev/null"); + printa("%@T\n", @bar); + printa("%@Y\n", @bar); + + exit(0); +} +EOF + +if [ $? -ne 0 ]; then + print -u2 "dtrace failed" + exit 1 +fi + +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out new file mode 100644 index 00000000..7462cf8e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out @@ -0,0 +1,2 @@ +Sun, 25 Jan 2004 13:00:00 PST +2004 Jan 25 13:00:00 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_AGG_CONV.aggfmt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_AGG_CONV.aggfmt.d new file mode 100644 index 00000000..9cac625d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_AGG_CONV.aggfmt.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with a bad aggregation format. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf("hello %@d", 123); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.toomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.toomany.d new file mode 100644 index 00000000..de87e8d7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.toomany.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with too many arguments. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf("x = %d y = %d\n", 123, 456, 789); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.widths.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.widths.d new file mode 100644 index 00000000..93812800 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_EXTRA.widths.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Negative test to test variety of fixed width formats. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("\n"); + x = 0; + + printf("%?d\n", x++, 1); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_FMT.badfmt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_FMT.badfmt.d new file mode 100644 index 00000000..bf4dc72c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_FMT.badfmt.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with a bad format string arg. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf(123); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_PROTO.novalue.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_PROTO.novalue.d new file mode 100644 index 00000000..68f8cf02 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_PROTO.novalue.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with a missing value argument. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf("%s"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.aggarg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.aggarg.d new file mode 100644 index 00000000..99bb0395 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.aggarg.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + + +/* + * ASSERTION: + * Test printf() with a bad aggregation arg. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + @a = count(); + printf("hello %d %d", 123, @a); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.recursive.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.recursive.d new file mode 100644 index 00000000..3b94ba73 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_ARG_TYPE.recursive.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invalid recursive printf test. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; + printf("%s\n", printf("test")); + + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.noprec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.noprec.d new file mode 100644 index 00000000..ba8a1a46 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.noprec.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with a missing dynamic precision argument. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf("%s %.*d\n", "foo"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.nowidth.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.nowidth.d new file mode 100644 index 00000000..4d72c819 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_PROTO.nowidth.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with a missing dynamic width argument. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf("%s %*d\n", "foo"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badprec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badprec.d new file mode 100644 index 00000000..64cf9125 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badprec.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test a dynamic precision argument of non-integer type. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf("%.*d\n", "foo", 1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badwidth.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badwidth.d new file mode 100644 index 00000000..badc95ee --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PRINTF_DYN_TYPE.badwidth.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Tet dynamic width argument of non-integer type. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf("%*d\n", "foo", 1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PROTO_LEN.toofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PROTO_LEN.toofew.d new file mode 100644 index 00000000..32c877ba --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_PROTO_LEN.toofew.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with too few arguments. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv1.d new file mode 100644 index 00000000..7add3319 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv1.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the unsupported %n$ conversion syntax. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf("%3$d", 123); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv2.d new file mode 100644 index 00000000..5cc32e27 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv2.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test an incomplete conversion. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf("%3", 123); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv3.d new file mode 100644 index 00000000..0dedea3d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/err.D_SYNTAX.badconv3.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test an undefined conversion. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + printf("%Z", 123); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.basics.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.basics.d new file mode 100644 index 00000000..8d4bb819 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.basics.d @@ -0,0 +1,73 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the basics of all the format conversions in the printf dictionary. + * + * SECTION: Output Formatting/printf() + * + * NOTES: + * floats and wchar_t strings missing + */ + +#pragma D option quiet + +BEGIN +{ + i = (int)'a'; + + printf("\n"); + + printf("%%a = %a\n", &`kmem_alloc); + printf("%%c = %c\n", i); + printf("%%d = %d\n", i); + printf("%%hd = %hd\n", (short)i); + printf("%%hi = %hi\n", (short)i); + printf("%%ho = %ho\n", (ushort_t)i); + printf("%%hu = %hu\n", (ushort_t)i); + printf("%%hx = %hx\n", (ushort_t)i); + printf("%%hX = %hX\n", (ushort_t)i); + printf("%%i = %i\n", i); + printf("%%lc = %lc\n", i); + printf("%%ld = %ld\n", (long)i); + printf("%%li = %li\n", (long)i); + printf("%%lo = %lo\n", (ulong_t)i); + printf("%%lu = %lu\n", (ulong_t)i); + printf("%%lx = %lx\n", (ulong_t)i); + printf("%%lX = %lX\n", (ulong_t)i); + printf("%%o = %o\n", (uint_t)i); + printf("%%p = %p\n", (void *)i); + printf("%%s = %s\n", "hello"); + printf("%%u = %u\n", (uint_t)i); + printf("%%wc = %wc\n", i); + printf("%%x = %x\n", (uint_t)i); + printf("%%X = %X\n", (uint_t)i); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.basics.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.basics.d.out new file mode 100644 index 00000000..55c12222 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.basics.d.out @@ -0,0 +1,26 @@ + +%a = genunix`kmem_alloc +%c = a +%d = 97 +%hd = 97 +%hi = 97 +%ho = 141 +%hu = 97 +%hx = 61 +%hX = 61 +%i = 97 +%lc = a +%ld = 97 +%li = 97 +%lo = 141 +%lu = 97 +%lx = 61 +%lX = 61 +%o = 141 +%p = 61 +%s = hello +%u = 97 +%wc = a +%x = 61 +%X = 61 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.flags.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.flags.d new file mode 100644 index 00000000..0b653151 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.flags.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test all of the various formatting flags (except %' because that + * requires locale support). + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("\n"); + printf("# %#8x\n", 0x123); + printf("0 %08x\n", 0x123); + printf("- %-8x\n", 0x123); + printf("+ %+8d\n", 123); + printf(" % 8d\n", 123); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.flags.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.flags.d.out new file mode 100644 index 00000000..4e5344ee --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.flags.d.out @@ -0,0 +1,7 @@ + +# 0x123 +0 00000123 +- 123 ++ +123 + 123 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.hello.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.hello.d new file mode 100644 index 00000000..d58f6cd7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.hello.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple printf() test. + * + * SECTION: Output Formatting/printf() + * + */ + + +#pragma D option quiet + +BEGIN +{ + printf("hello"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.hello.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.hello.d.out new file mode 100644 index 00000000..ce013625 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.hello.d.out @@ -0,0 +1 @@ +hello diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d new file mode 100644 index 00000000..d15236ba --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d @@ -0,0 +1,87 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with simple integer arguments, using a variety of + * sizes and thereby exercise the automatic size extension feature. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("\n%d\n", (char)0x1234567890abcdef); + printf("%d\n", (short)0x1234567890abcdef); + printf("%d\n", (int)0x1234567890abcdef); + printf("%d\n", (long long)0x1234567890abcdef); + + printf("\n%d\n", (unsigned char)0x1234567890abcdef); + printf("%d\n", (unsigned short)0x1234567890abcdef); + printf("%d\n", (unsigned int)0x1234567890abcdef); + printf("%d\n", (unsigned long long)0x1234567890abcdef); + + printf("\n%u\n", (char)0x1234567890abcdef); + printf("%u\n", (short)0x1234567890abcdef); + printf("%u\n", (int)0x1234567890abcdef); + printf("%u\n", (long long)0x1234567890abcdef); + + printf("\n%u\n", (unsigned char)0x1234567890abcdef); + printf("%u\n", (unsigned short)0x1234567890abcdef); + printf("%u\n", (unsigned int)0x1234567890abcdef); + printf("%u\n", (unsigned long long)0x1234567890abcdef); + + printf("\n%x\n", (unsigned char)0x1234567890abcdef); + printf("%x\n", (unsigned short)0x1234567890abcdef); + printf("%x\n", (unsigned int)0x1234567890abcdef); + printf("%x\n", (unsigned long long)0x1234567890abcdef); + + printf("\n%x\n", (char)0x1234567890abcdef); + printf("%x\n", (short)0x1234567890abcdef); + printf("%x\n", (int)0x1234567890abcdef); + printf("%x\n", (long long)0x1234567890abcdef); + + printf("\n%o\n", (unsigned char)0x1234567890abcdef); + printf("%o\n", (unsigned short)0x1234567890abcdef); + printf("%o\n", (unsigned int)0x1234567890abcdef); + printf("%o\n", (unsigned long long)0x1234567890abcdef); + + printf("\n%o\n", (char)0x1234567890abcdef); + printf("%o\n", (short)0x1234567890abcdef); + printf("%o\n", (int)0x1234567890abcdef); + printf("%o\n", (long long)0x1234567890abcdef); + + printf("\n%p\n", (void *)0x12345678); + printf("%p\n", (int *)0x90abcdef); + printf("%p\n", (uintptr_t)0x67890abc); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d.out new file mode 100644 index 00000000..4d2bb112 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.ints.d.out @@ -0,0 +1,45 @@ + +239 +52719 +-1867788817 +1311768467294899695 + +239 +52719 +2427178479 +1311768467294899695 + +239 +52719 +2427178479 +1311768467294899695 + +239 +52719 +2427178479 +1311768467294899695 + +ef +cdef +90abcdef +1234567890abcdef + +ef +cdef +90abcdef +1234567890abcdef + +357 +146757 +22052746757 +110642547422052746757 + +357 +146757 +22052746757 +110642547422052746757 + +12345678 +90abcdef +67890abc + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.precs.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.precs.d new file mode 100644 index 00000000..2bfff9ff --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.precs.d @@ -0,0 +1,58 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test a variety of fixed and dynamic format precisions. + * + * SECTION: Output Formatting/printf() + */ + +#pragma D option quiet + +BEGIN +{ + printf("\n"); + x = 0; + + printf("%.0s\n", "hello"); + printf("%.1s\n", "hello"); + printf("%.2s\n", "hello"); + printf("%.3s\n", "hello"); + printf("%.4s\n", "hello"); + printf("%.5s\n", "hello"); + + printf("%.*s\n", x++, "hello"); + printf("%.*s\n", x++, "hello"); + printf("%.*s\n", x++, "hello"); + printf("%.*s\n", x++, "hello"); + printf("%.*s\n", x++, "hello"); + printf("%.*s\n", x++, "hello"); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.precs.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.precs.d.out new file mode 100644 index 00000000..11a969de --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.precs.d.out @@ -0,0 +1,14 @@ + +hello +h +he +hel +hell +hello +hello +h +he +hel +hell +hello + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.print-f.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.print-f.d new file mode 100644 index 00000000..3fe0bac4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.print-f.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test %f format printing. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +float f; +double d; + +BEGIN +{ + printf("\n"); + + printf("%%f = %f\n", f); + printf("%%f = %f\n", d); + + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.print-f.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.print-f.d.out new file mode 100644 index 00000000..4d4b8641 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.print-f.d.out @@ -0,0 +1,4 @@ + +%f = 0.000000 +%f = 0.000000 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printT.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printT.ksh new file mode 100644 index 00000000..51625380 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printT.ksh @@ -0,0 +1,56 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +# The output files assumes the timezone is US/Pacific +TZ=US/Pacific + +$dtrace -s /dev/stdin <<EOF +#pragma D option quiet + +inline uint64_t NANOSEC = 1000000000; + +BEGIN +{ + printf("%T\n%T\n%T", (uint64_t)0, (uint64_t)1062609821 * NANOSEC, + (uint64_t)0x7fffffff * NANOSEC); + exit(0); +} +EOF + +if [ $? -ne 0 ]; then + print -u2 "dtrace failed" + exit 1 +fi + +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printT.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printT.ksh.out new file mode 100644 index 00000000..51c84373 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printT.ksh.out @@ -0,0 +1,3 @@ +Wed, 31 Dec 1970 16:00:00 PST +Wed, 03 Sep 2003 10:23:41 PDT +Mon, 18 Jan 2038 19:14:07 PST diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printY.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printY.ksh new file mode 100644 index 00000000..2dc3a4c3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printY.ksh @@ -0,0 +1,56 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +# The output files assumes the timezone is US/Pacific +TZ=US/Pacific + +$dtrace -s /dev/stdin <<EOF +#pragma D option quiet + +inline uint64_t NANOSEC = 1000000000; + +BEGIN +{ + printf("%Y\n%Y\n%Y", (uint64_t)0, (uint64_t)1062609821 * NANOSEC, + (uint64_t)0x7fffffff * NANOSEC); + exit(0); +} +EOF + +if [ $? -ne 0 ]; then + print -u2 "dtrace failed" + exit 1 +fi + +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printY.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printY.ksh.out new file mode 100644 index 00000000..ae8d82f9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printY.ksh.out @@ -0,0 +1,3 @@ +1969 Dec 31 16:00:00 +2003 Sep 3 10:23:41 +2038 Jan 18 19:14:07 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printcont.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printcont.d new file mode 100644 index 00000000..ca7e1a93 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printcont.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test 'uint' continously; like kinda stress. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +uint64_t ts; + +BEGIN +{ + ts = 53114233149441; + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + printf("%u\n", ts); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printcont.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printcont.d.out new file mode 100644 index 00000000..ce33b729 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printcont.d.out @@ -0,0 +1,16 @@ +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 +53114233149441 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printeE.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printeE.d new file mode 100644 index 00000000..7aaee2a4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printeE.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test %e, %E format printing. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +float f; +double d; + +BEGIN +{ + printf("\n"); + + printf("%%e = %e\n", f); + printf("%%E = %E\n", f); + + printf("%%e = %e\n", d); + printf("%%E = %E\n", d); + + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printeE.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printeE.d.out new file mode 100644 index 00000000..3fa96bc2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printeE.d.out @@ -0,0 +1,6 @@ + +%e = 0.000000e+00 +%E = 0.000000E+00 +%e = 0.000000e+00 +%E = 0.000000E+00 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printgG.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printgG.d new file mode 100644 index 00000000..9e7e019b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printgG.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test %g, %G format printing. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +float f; +double d; + +BEGIN +{ + printf("\n"); + + printf("%%g = %g\n", f); + printf("%%g = %g\n", d); + + printf("%%G = %G\n", f); + printf("%%G = %G\n", d); + + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printgG.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printgG.d.out new file mode 100644 index 00000000..e4175e64 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.printgG.d.out @@ -0,0 +1,6 @@ + +%g = 0 +%g = 0 +%G = 0 +%G = 0 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d new file mode 100644 index 00000000..deb4f817 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with a fixed string and no actual tracing arguments. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("hello world from BEGIN"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d.out new file mode 100644 index 00000000..cb7c7e94 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.rawfmt.d.out @@ -0,0 +1 @@ +hello world from BEGIN diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.str.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.str.d new file mode 100644 index 00000000..a7404139 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.str.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Test printf() with a simple string argument. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("sysname = %s", `utsname.sysname); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.str.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.str.d.out new file mode 100644 index 00000000..ba319817 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.str.d.out @@ -0,0 +1 @@ +sysname = SunOS diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.sym.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.sym.d new file mode 100644 index 00000000..55f89f99 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.sym.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with a simple string argument. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("symbol = %a", &`kmem_flags); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.sym.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.sym.d.out new file mode 100644 index 00000000..14f1e825 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.sym.d.out @@ -0,0 +1 @@ +symbol = genunix`kmem_flags diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.uints.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.uints.d new file mode 100644 index 00000000..caa326e8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.uints.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test printf() with simple unsigned integer arguments. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("\n"); + printf("%u\n", (uchar_t)123); + printf("%u\n", (ushort_t)123); + printf("%u\n", (ulong_t)123); + printf("%u\n", (u_longlong_t)123); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.uints.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.uints.d.out new file mode 100644 index 00000000..d800e916 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.uints.d.out @@ -0,0 +1,6 @@ + +123 +123 +123 +123 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths.d new file mode 100644 index 00000000..21595c02 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test a variety of fixed and dynamic format widths. + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("\n"); + x = 0; + + printf("%0d\n", 1); + printf("%1d\n", 1); + printf("%2d\n", 1); + printf("%3d\n", 1); + printf("%4d\n", 1); + printf("%5d\n", 1); + + printf("%*d\n", x++, 1); + printf("%*d\n", x++, 1); + printf("%*d\n", x++, 1); + printf("%*d\n", x++, 1); + printf("%*d\n", x++, 1); + printf("%*d\n", x++, 1); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths.d.out new file mode 100644 index 00000000..39fc7a8a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths.d.out @@ -0,0 +1,14 @@ + +1 +1 + 1 + 1 + 1 + 1 +1 +1 + 1 + 1 + 1 + 1 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths1.d new file mode 100644 index 00000000..b5410ab8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.widths1.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Try to print charecter wide width using '?' + * + * SECTION: Output Formatting/printf() + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("\n"); + x = 0; + + printf("%?d\n", x++); + printf("%?d\n", x++); + printf("%?d\n", x++); + printf("%?d\n", x++); + printf("%?d\n", x++); + printf("%?d\n", x++); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.wp.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.wp.d new file mode 100644 index 00000000..b6745e14 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.wp.d @@ -0,0 +1,66 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test a variety of fixed and dynamic format widths combined with precisions. + * + * SECTION: Output Formatting/printf() + */ + +#pragma D option quiet + +BEGIN +{ + printf("\n"); + x = 0; + + printf("%0.0s\n", "hello"); + printf("%1.1s\n", "hello"); + printf("%2.2s\n", "hello"); + printf("%3.3s\n", "hello"); + printf("%4.4s\n", "hello"); + printf("%5.5s\n", "hello"); + printf("%6.6s\n", "hello"); + printf("%7.7s\n", "hello"); + printf("%8.8s\n", "hello"); + printf("%9.9s\n", "hello"); + + printf("%*.*s\n", x, x++, "hello"); + printf("%*.*s\n", x, x++, "hello"); + printf("%*.*s\n", x, x++, "hello"); + printf("%*.*s\n", x, x++, "hello"); + printf("%*.*s\n", x, x++, "hello"); + printf("%*.*s\n", x, x++, "hello"); + printf("%*.*s\n", x, x++, "hello"); + printf("%*.*s\n", x, x++, "hello"); + printf("%*.*s\n", x, x++, "hello"); + printf("%*.*s\n", x, x++, "hello"); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.wp.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.wp.d.out new file mode 100644 index 00000000..2f1fd9de --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/printf/tst.wp.d.out @@ -0,0 +1,22 @@ + +hello +h +he +hel +hell +hello + hello + hello + hello + hello +hello +h +he +hel +hell +hello + hello + hello + hello + hello + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh new file mode 100644 index 00000000..ae4934cd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh @@ -0,0 +1,82 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +ppriv -s A=basic,dtrace_proc,dtrace_user $$ + +/usr/sbin/dtrace -q -s /dev/stdin <<"EOF" + +BEGIN { + errorcount = 0; + expected_errorcount = 23; +} + +BEGIN { trace(mutex_owned(&`pidlock)); } +BEGIN { trace(mutex_owner(&`pidlock)); } +BEGIN { trace(mutex_type_adaptive(&`pidlock)); } +BEGIN { trace(mutex_type_spin(&`pidlock)); } + +BEGIN { trace(rw_read_held(&`ksyms_lock)); } +BEGIN { trace(rw_write_held(&`ksyms_lock)); } +BEGIN { trace(rw_iswriter(&`ksyms_lock)); } + +BEGIN { x = alloca(10); bcopy(`initname, x, 10); trace(stringof(x)); } +/* We have no reliable way to test msgsize */ + +BEGIN { trace(strlen(`initname)); } +BEGIN { trace(strchr(`initname, 0x69)); } +BEGIN { trace(strrchr(`initname, 0x69)); } +BEGIN { trace(strstr("/sbin/init/foo", `initname)); } +BEGIN { trace(strstr(`initname, "in")); } +BEGIN { trace(strtok(`initname, "/")); } +BEGIN { trace(strtok(NULL, "/")); } +BEGIN { trace(strtok("foo/bar", `initname)); } +BEGIN { trace(strtok(NULL, `initname)); } +BEGIN { trace(substr(`initname, 2, 3)); } + +BEGIN { trace(ddi_pathname(`top_devinfo, 1)); } +BEGIN { trace(strjoin(`initname, "foo")); } +BEGIN { trace(strjoin("foo", `initname)); } +BEGIN { trace(dirname(`initname)); } +BEGIN { trace(cleanpath(`initname)); } + +ERROR { + errorcount++; +} + +BEGIN /errorcount == expected_errorcount/ { + trace("test passed"); + exit(0); +} + +BEGIN /errorcount != expected_errorcount/ { + printf("fail: expected %d. saw %d.", expected_errorcount, errorcount); + exit(1); +} +EOF + + +exit $? diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.op_access.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.op_access.ksh new file mode 100644 index 00000000..08964c49 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.op_access.ksh @@ -0,0 +1,70 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +ppriv -s A=basic,dtrace_proc,dtrace_user $$ + +/usr/sbin/dtrace -q -s /dev/stdin <<"EOF" +BEGIN { + errorcount = 0; + expected_errorcount = 7; +} + +/* BYREF */ +BEGIN { trace(`utsname); } +BEGIN { trace(`kmem_flags); } + +/* DIF_OP_SCMP */ +BEGIN /`initname == "/sbin/init"/ { trace("bad"); } + +/* DIF_OP_COPYS */ +BEGIN { p = `p0; trace(p); } + +/* DIF_OP_STTS */ +BEGIN { self->p = `p0; trace(self->p); } + +/* DIF_OP_STGAA */ +BEGIN { a[stringof(`initname)] = 42; trace(a["/sbin/init"]); } + +/* DIF_OP_STTAA */ +BEGIN { self->a[stringof(`initname)] = 42; trace(self->a["/sbin/init"]); } + +ERROR { + errorcount++; +} + +BEGIN /errorcount == expected_errorcount/ { + trace("pass"); + exit(0); +} + +BEGIN /errorcount != expected_errorcount/ { + printf("fail: expected %d. saw %d.", expected_errorcount, errorcount); + exit(1); +} +EOF + +exit $? diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.unpriv_funcs.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.unpriv_funcs.ksh new file mode 100644 index 00000000..c9da0ce6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/privs/tst.unpriv_funcs.ksh @@ -0,0 +1,79 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +# +# Affirmative test of less privileged user operation. We do so by running +# this test case as root, then as a less privileged user. The output should +# be exactly the same. +# + +script() +{ + cat <<"EOF" + + BEGIN { trace("trace\n"); } + BEGIN { printf("%s\n", "printf"); } + BEGIN { printf("strlen(\"strlen\") = %d\n", strlen("strlen")); } + BEGIN { x = alloca(10); + bcopy("alloca\n", x, 7); + trace(stringof(x)); } + + BEGIN { printf("index(\"index\", \"x\") = %d\n", + index("index", "x")); } + BEGIN { printf("strchr(\"strchr\", \'t\') = %s\n", + strchr("strchr", 't')); } + + BEGIN { printf("strtok(\"strtok\", \"t\") = %s\n", + strtok("strtok", "t")); } + BEGIN { printf("strtok(NULL, \"t\") = %s\n", + strtok(NULL, "t")); } + BEGIN { printf("strtok(NULL, \"t\") = %s\n", + strtok(NULL, "t")); } + BEGIN { printf("substr(\"substr\", 2, 2) = %s\n", + substr("substr", 2, 2)); } + BEGIN { trace(strjoin("str", "join\n")); } + BEGIN { trace(basename("dirname/basename")); trace("/"); } + BEGIN { trace(dirname("dirname/basename")); } + + BEGIN { exit(0); } + ERROR { exit(1); } +EOF +} + +privout=/tmp/$$.priv_output +unprivout=/tmp/$$.unpriv_output + +script | /usr/sbin/dtrace -q -s /dev/stdin > $privout +ppriv -s A=basic,dtrace_user $$ +script | /usr/sbin/dtrace -q -s /dev/stdin > $unprivout + +diff $privout $unprivout +res=$? + +/bin/rm -f $privout $unprivout + +exit $res diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probeqtn.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probeqtn.d new file mode 100644 index 00000000..35604278 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probeqtn.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call probes with mismatch "?" and make sure it results in compilation + * error + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +int i; +BEGIN +{ + i = 0; +} + +syscall::?lwp?:entry +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probestar.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probestar.d new file mode 100644 index 00000000..6103f486 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.probestar.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call an undefined probe with matching character "*" and make + * sure it results in compilation error. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +no_such_dtrace_probe* +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.tickstar.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.tickstar.d new file mode 100644 index 00000000..391b18c3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_PDESC_ZERO.tickstar.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call a probe with matching charecters "*" but does not have + * any matching probes. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +int i; +BEGIN +{ + i = 0; +} + +syscall::*tick*:entry +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.assign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.assign.d new file mode 100644 index 00000000..e4f7dcb6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.assign.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a predicate with no spaces and make sure it results in + * compilation error. + + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +int i = 0; + +profile-1 +/i == 0/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declare.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declare.d new file mode 100644 index 00000000..30aa2667 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declare.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare variables inside probe clause and make sure it results + * in compilation error. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +profile-1 +{ + int i = 0; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declarein.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declarein.d new file mode 100644 index 00000000..9ef8590a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.declarein.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a Variable in between definition and first brace, and make + * sure it results in compilation error. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +profile-1 +int i; +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.lbraces.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.lbraces.d new file mode 100644 index 00000000..b4a4315d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.lbraces.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a probe with one missing braces. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +profile-1 +{ + exit(0); diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.probespec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.probespec.d new file mode 100644 index 00000000..67c44872 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.probespec.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Try Declaring Datatypes and variables next to profile declaration and + * Make sure it results in compilation error. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +profile-1:int i +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.rbraces.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.rbraces.d new file mode 100644 index 00000000..4f889d57 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.rbraces.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a probe with one missing braces. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +profile-1 + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.recdec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.recdec.d new file mode 100644 index 00000000..5db21ea9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/err.D_SYNTAX.recdec.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a probe clause within another probe clause. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +profile-1 +{ + tick-10ms +{ +} +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.basic1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.basic1.d new file mode 100644 index 00000000..df2b1147 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.basic1.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple probe clause test; just a empty probe. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +tick-10ms +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.check.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.check.d new file mode 100644 index 00000000..d3f2535d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.check.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a Variable in BEGIN and use that in another probe. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +int i; +BEGIN +{ + i = 0; +} + +tick-10ms +/i == 0/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.declare.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.declare.d new file mode 100644 index 00000000..845b3fa4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.declare.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declaration of variable outside probe clause + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +int i; +tick-10ms +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.declareafter.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.declareafter.d new file mode 100644 index 00000000..1c1e2eae --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.declareafter.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declaration of a variable after probe clause definition. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +tick-10ms +{ + exit(0); +} +int i; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.emptyprobe.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.emptyprobe.d new file mode 100644 index 00000000..e23a8dbb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.emptyprobe.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Multiple probe clause declarations. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +tick-10ms +{ +} +tick-10ms +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragma.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragma.d new file mode 100644 index 00000000..035079d0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragma.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Test to Declare pragma in right place. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +tick-10ms +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmaaftertab.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmaaftertab.d new file mode 100644 index 00000000..be725f9d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmaaftertab.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare pragma after a tab and make sure it results in compilation error. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + + #pragma D option quiet + +tick-10ms +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmainside.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmainside.d new file mode 100644 index 00000000..e602a414 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmainside.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare pragma inside probe clause. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + + +tick-10ms +{ +#pragma D option quiet + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmaoutside.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmaoutside.d new file mode 100644 index 00000000..7d2ea61c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.pragmaoutside.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare pragma outside probe clause. + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + + +tick-10ms +{ + exit(0); +} +#pragma D option quiet diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.probestar.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.probestar.d new file mode 100644 index 00000000..3f54321d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/probes/tst.probestar.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call matching probe clauses with given name using "*" + * + * SECTION: Program Structure/Probe Clauses and Declarations + * + */ + + +#pragma D option quiet + +int i; +BEGIN +{ + i = 0; +} + +syscall::*lwp*:entry +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.create.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.create.ksh new file mode 100644 index 00000000..5b484cf0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.create.ksh @@ -0,0 +1,67 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that the proc:::create probe fires with the proper +# arguments. +# +# If this fails, the script will run indefinitely; it relies on the harness +# to time it out. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + proc:::create + /args[0]->pr_ppid == $child && pid == $child/ + { + exit(0); + } +EOF +} + +sleeper() +{ + while true; do + /usr/bin/sleep 1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +sleeper & +child=$! + +script +status=$? + +kill $child +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.discard.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.discard.ksh new file mode 100644 index 00000000..5595c24a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.discard.ksh @@ -0,0 +1,74 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that the proc:::signal-discard probe fires correctly +# and with the correct arguments. +# +# If this fails, the script will run indefinitely; it relies on the harness +# to time it out. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + proc:::signal-discard + /args[1]->pr_pid == $child && + args[1]->pr_psargs == "$longsleep" && args[2] == SIGHUP/ + { + exit(0); + } +EOF +} + +killer() +{ + while true; do + sleep 1 + /usr/bin/kill -HUP $child + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +longsleep="/usr/bin/sleep 10000" + +/usr/bin/nohup $longsleep & +child=$! + +killer & +killer=$! +script +status=$? + +kill $child +kill $killer + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exec.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exec.ksh new file mode 100644 index 00000000..0318ae6d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exec.ksh @@ -0,0 +1,73 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that the proc:::exec probe fires, followed by the +# proc:::exec-success probe (in a successful exec(2)). +# +# If this fails, the script will run indefinitely; it relies on the harness +# to time it out. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + proc:::exec + /curpsinfo->pr_ppid == $child && args[0] == "/usr/bin/sleep"/ + { + self->exec = 1; + } + + proc:::exec-success + /self->exec/ + { + exit(0); + } +EOF +} + +sleeper() +{ + while true; do + /usr/bin/sleep 1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +sleeper & +child=$! + +script +status=$? + +kill $child +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh new file mode 100644 index 00000000..fb1efc54 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh @@ -0,0 +1,84 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script is identical to tst.execfail.ksh -- but it additionally checks +# that errno is set to ENOENT in the case that an interpreter can't be +# found. +# +# If this fails, the script will run indefinitely; it relies on the harness +# to time it out. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + proc:::exec + /curpsinfo->pr_ppid == $child && args[0] == "$badexec"/ + { + self->exec = 1; + } + + proc:::exec-failure + /self->exec && args[0] == ENOENT/ + { + exit(0); + } +EOF +} + +sleeper() +{ + while true; do + /usr/bin/sleep 1 + $badexec + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +badexec=/tmp/execfail.ENOENT.ksh.$$ +dtrace=$1 + +cat > $badexec <<EOF +#!/this_is_a_bogus_interpreter +EOF + +chmod +x $badexec + +sleeper & +child=$! + +script +status=$? + +kill $child +rm $badexec + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh new file mode 100644 index 00000000..d2241e1e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh @@ -0,0 +1,86 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that -- if a exec(2) fails -- the proc:::exec probe fires, +# followed by the proc:::exec-success probe (in a successful exec(2)). To +# circumvent any potential shell cleverness, this script generates exec +# failure by generating a file with a bogus interpreter. (It seems unlikely +# that a shell -- regardless of how clever it claims to be -- would bother to +# validate the interpreter before exec'ing.) +# +# If this fails, the script will run indefinitely; it relies on the harness +# to time it out. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + proc:::exec + /curpsinfo->pr_ppid == $child && args[0] == "$badexec"/ + { + self->exec = 1; + } + + proc:::exec-failure + /self->exec/ + { + exit(0); + } +EOF +} + +sleeper() +{ + while true; do + /usr/bin/sleep 1 + $badexec + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +badexec=/tmp/execfail.ksh.$$ +dtrace=$1 + +cat > $badexec <<EOF +#!/this_is_a_bogus_interpreter +EOF + +chmod +x $badexec + +sleeper & +child=$! +script +status=$? + +kill $child +rm $badexec + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh new file mode 100644 index 00000000..df3fdb3d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh @@ -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. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that the proc:::exit probe fires with the correct argument +# when the process core dumps. The problematic bit here is making sure that +# a process _can_ dump core -- if core dumps are disabled on both a global +# and per-process basis, this test will fail. Rather than having this test +# muck with coreadm(1M) settings, it will fail explicitly in this case and +# provide a hint as to the problem. In general, machines should never be +# running with both per-process and global core dumps disabled -- so this +# should be a non-issue in practice. +# +# If this fails, the script will run indefinitely; it relies on the harness +# to time it out. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + proc:::exit + /curpsinfo->pr_ppid == $child && + curpsinfo->pr_psargs == "$longsleep" && args[0] == CLD_DUMPED/ + { + exit(0); + } + + proc:::exit + /curpsinfo->pr_ppid == $child && + curpsinfo->pr_psargs == "$longsleep" && args[0] != CLD_DUMPED/ + { + printf("Child process could not dump core. Check coreadm(1M)"); + printf(" settings; either per-process or global core dumps "); + printf("must be enabled for this test to work properly."); + exit(1); + } +EOF +} + +sleeper() +{ + /usr/bin/coreadm -p $corefile + while true; do + $longsleep & + /usr/bin/sleep 1 + kill -SEGV $! + done + /usr/bin/rm -f $corefile +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +longsleep="/usr/bin/sleep 10000" +corefile=/tmp/core.$$ + +sleeper & +child=$! + +script +status=$? + +pstop $child +pkill -P $child +kill $child +prun $child + +/usr/bin/rm -f $corefile +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitexit.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitexit.ksh new file mode 100644 index 00000000..13af911c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitexit.ksh @@ -0,0 +1,67 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that the proc:::exit probe fires with the correct argument +# when the process explicitly exits. +# +# If this fails, the script will run indefinitely; it relies on the harness +# to time it out. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + proc:::exit + /curpsinfo->pr_ppid == $child && args[0] == CLD_EXITED/ + { + exit(0); + } +EOF +} + +sleeper() +{ + while true; do + /usr/bin/sleep 1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +sleeper & +child=$! + +script +status=$? + +kill $child +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh new file mode 100644 index 00000000..8040ade6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh @@ -0,0 +1,75 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that the proc:::exit probe fires with the correct argument +# when the process is killed. +# +# If this fails, the script will run indefinitely; it relies on the harness +# to time it out. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + proc:::exit + /curpsinfo->pr_ppid == $child && + curpsinfo->pr_psargs == "$longsleep" && args[0] == CLD_KILLED/ + { + exit(0); + } +EOF +} + +sleeper() +{ + while true; do + $longsleep & + /usr/bin/sleep 1 + kill -9 $! + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +longsleep="/usr/bin/sleep 10000" + +sleeper & +child=$! + +script +status=$? + +pstop $child +pkill -P $child +kill $child +prun $child + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.signal.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.signal.ksh new file mode 100644 index 00000000..cd3c7918 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.signal.ksh @@ -0,0 +1,84 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that the proc:::signal-send and proc:::signal-handle +# probes fire correctly and with the correct arguments. +# +# If this fails, the script will run indefinitely; it relies on the harness +# to time it out. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + proc:::signal-send + /execname == "kill" && curpsinfo->pr_ppid == $child && + args[1]->pr_psargs == "$longsleep" && args[2] == SIGUSR1/ + { + /* + * This is guaranteed to not race with signal-handle. + */ + target = args[1]->pr_pid; + } + + proc:::signal-handle + /target == pid && args[0] == SIGUSR1/ + { + exit(0); + } +EOF +} + +sleeper() +{ + while true; do + $longsleep & + sleep 1 + /usr/bin/kill -USR1 $! + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +longsleep="/usr/bin/sleep 10000" + +sleeper & +child=$! + +script +status=$? + +pstop $child +pkill -P $child +kill $child +prun $child + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.sigwait.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.sigwait.c new file mode 100644 index 00000000..8f6231bd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.sigwait.c @@ -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" + +#include <signal.h> +#include <time.h> +#include <stdlib.h> +#include <stdio.h> +#include <errno.h> +#include <string.h> + +int +main(int argc, char **argv) +{ + struct sigevent ev; + struct itimerspec ts; + sigset_t set; + timer_t tid; + char *cmd = argv[0]; + + ev.sigev_notify = SIGEV_SIGNAL; + ev.sigev_signo = SIGUSR1; + + if (timer_create(CLOCK_REALTIME, &ev, &tid) == -1) { + (void) fprintf(stderr, "%s: cannot create CLOCK_HIGHRES " + "timer: %s\n", cmd, strerror(errno)); + exit(EXIT_FAILURE); + } + + (void) sigemptyset(&set); + (void) sigaddset(&set, SIGUSR1); + (void) sigprocmask(SIG_BLOCK, &set, NULL); + + ts.it_value.tv_sec = 1; + ts.it_value.tv_nsec = 0; + ts.it_interval.tv_sec = 0; + ts.it_interval.tv_nsec = NANOSEC / 2; + + if (timer_settime(tid, TIMER_RELTIME, &ts, NULL) == -1) { + (void) fprintf(stderr, "%s: timer_settime() failed: %s\n", + cmd, strerror(errno)); + exit(EXIT_FAILURE); + } + + for (;;) { + (void) sigwait(&set); + } + + /*NOTREACHED*/ + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.sigwait.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.sigwait.d new file mode 100644 index 00000000..851fa262 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.sigwait.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option destructive + +proc:::signal-send +/pid == 0 && args[1]->pr_pid == $1 && args[2] == SIGUSR1/ +{ + sent = 1; +} + +proc:::signal-clear +/pid == $1 && args[0] == SIGUSR1 && sent/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh new file mode 100644 index 00000000..42917380 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/proc/tst.startexit.ksh @@ -0,0 +1,89 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This script tests that the firing order of probes in a process is: +# +# 1. proc:::start +# 2. proc:::lwp-start +# 3. proc:::lwp-exit +# 4. proc:::exit +# +# If this fails, the script will run indefinitely; it relies on the harness +# to time it out. +# +script() +{ + $dtrace -s /dev/stdin <<EOF + proc:::start + /curpsinfo->pr_ppid == $child/ + { + self->start = 1; + } + + proc:::lwp-start + /self->start/ + { + self->lwp_start = 1; + } + + proc:::lwp-exit + /self->lwp_start/ + { + self->lwp_exit = 1; + } + + proc:::exit + /self->lwp_exit == 1/ + { + exit(0); + } +EOF +} + +sleeper() +{ + while true; do + /usr/bin/sleep 1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +sleeper & +child=$! + +script +status=$? + +kill $child +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZERO.profile.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZERO.profile.d new file mode 100644 index 00000000..e4e031ba --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZERO.profile.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * profile without valid value keyword just call with 'n'. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-n +{ + printf("This test should fail\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonens.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonens.d new file mode 100644 index 00000000..3ed28b1b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonens.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call profile-'ns' less than 200 micro seconds. + * + * SECTION: profile Provider/profile-n probes + * + */ + +#pragma D option quiet + +profile-1ns +{ + printf("Calls 'ns' less than 200 micro seconds\n"); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonensec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonensec.d new file mode 100644 index 00000000..7b4df199 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROonensec.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call profile-1nsec; less than 200 micro seconds. + * + * SECTION: profile Provider/profile-n probes + * + */ + +#pragma D option quiet + +profile-1nsec +{ + printf("Call profile-1nsec; less than 200 micro seconds\n"); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneus.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneus.d new file mode 100644 index 00000000..6a64a3a2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneus.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call profile-us; less than 200 micro seconds. + * + * SECTION: profile Provider/profile-n probes + * + */ + +#pragma D option quiet + +profile-1us +{ + printf(" Calling profile-us less than 200 micro seconds should fail\n"); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneusec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneusec.d new file mode 100644 index 00000000..b6b80bea --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/err.D_PDESC_ZEROoneusec.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * profile-usec; less than 200 micro seconds. + * + * SECTION: profile Provider/profile-n probes + * + */ + +#pragma D option quiet + +profile-1usec +{ + printf("profile-usec; less than 200 micro seconds \n"); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d new file mode 100644 index 00000000..26a40b41 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d @@ -0,0 +1,53 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Either one of arg0 (or) arg1 should be 0 and non-zero. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-1 +/(arg0 != 0 && arg1 == 0) || (arg0 == 0 && arg1 != 0)/ +{ + printf("Test passed; either arg0/arg1 is zero\n"); + exit(0); +} + +tick-1 +/(arg0 == 0 && arg1 == 0) || (arg0 != 0 && arg1 != 0)/ +{ + printf("Test failed; either arg0 (or) arg1 should be non zero\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d.out new file mode 100644 index 00000000..0bd33539 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.argtest.d.out @@ -0,0 +1,2 @@ +Test passed; either arg0/arg1 is zero + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.basic.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.basic.d new file mode 100644 index 00000000..df8bf988 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.basic.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * profile-n simple test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-1 +{ + printf("This test is a simple profile-n provider test\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.basic.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.basic.d.out new file mode 100644 index 00000000..09005bbb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.basic.d.out @@ -0,0 +1,2 @@ +This test is a simple profile-n provider test + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh new file mode 100644 index 00000000..358d3625 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh @@ -0,0 +1,74 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +script() +{ + $dtrace -qs /dev/stdin <<EOF + profile-1234hz + /arg0 != 0/ + { + @[func(arg0)] = count(); + } + + tick-100ms + /i++ == 50/ + { + exit(0); + } +EOF +} + +spinny() +{ + while true; do + /usr/bin/date > /dev/null + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +spinny & +child=$! + +# +# This is gutsy -- we're assuming that mutex_enter(9F) will show up in the +# output. This is most likely _not_ to show up in the output if the +# platform does not support arbitrary resolution interval timers -- but +# the above script was stress-tested down to 100 hertz and still ran +# successfully on all platforms, so one is hopeful that this test will pass +# even in that case. +# +script | tee /dev/fd/2 | grep mutex_enter > /dev/null +status=$? + +kill $child +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh new file mode 100644 index 00000000..4652ff32 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh @@ -0,0 +1,70 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +script() +{ + $dtrace -qs /dev/stdin <<EOF + profile-1234hz + /arg0 != 0/ + { + @[mod(arg0)] = count(); + } + + tick-100ms + /i++ == 20/ + { + exit(0); + } +EOF +} + +spinny() +{ + while true; do + /usr/bin/date > /dev/null + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +spinny & +child=$! + +# +# The only thing we can be sure of is that some module named "unix" (or +# "genunix") did some work -- so that's all we'll check. +# +script | tee /dev/fd/2 | grep unix > /dev/null +status=$? + +kill $child +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d new file mode 100644 index 00000000..ba69def5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple profile-hz test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-100hz +{ + printf("This test is a simple profile-hz provider test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d.out new file mode 100644 index 00000000..711f635b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilehz.d.out @@ -0,0 +1 @@ +This test is a simple profile-hz provider test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d new file mode 100644 index 00000000..7ec573e3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple profile-ms simple test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-1ms +{ + printf("This test is a simple profile-ms provider test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d.out new file mode 100644 index 00000000..1fe17e7c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilems.d.out @@ -0,0 +1 @@ +This test is a simple profile-ms provider test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d new file mode 100644 index 00000000..80451e85 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple profile-msec simple test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-1msec +{ + printf("This test is a simple profile-msec provider test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d.out new file mode 100644 index 00000000..c3fb4a3b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilemsec.d.out @@ -0,0 +1 @@ +This test is a simple profile-msec provider test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d new file mode 100644 index 00000000..37b20907 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * profile-<number> simple test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-100 +{ + printf("This test is a simple profile implicit hz test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d.out new file mode 100644 index 00000000..c9409ce5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilenhz.d.out @@ -0,0 +1 @@ +This test is a simple profile implicit hz test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d new file mode 100644 index 00000000..72f95ad3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple profile-2000000000ns simple test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-2000000000ns +{ + printf("This test is a simple profile-ns provider test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d.out new file mode 100644 index 00000000..86251d01 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilens.d.out @@ -0,0 +1 @@ +This test is a simple profile-ns provider test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d new file mode 100644 index 00000000..d0236e9a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple profile-nsec simple test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-2000000000nsec +{ + printf("This test is a simple profile-nsec provider test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d.out new file mode 100644 index 00000000..890b769d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilensec.d.out @@ -0,0 +1 @@ +This test is a simple profile-nsec provider test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d new file mode 100644 index 00000000..65201fc8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple profile-s simple test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-1s +{ + printf("This test is a simple profile-s provider test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d.out new file mode 100644 index 00000000..03a0cf22 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profiles.d.out @@ -0,0 +1 @@ +This test is a simple profile-s provider test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d new file mode 100644 index 00000000..3e52ac5c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple profile-sec simple test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-1sec +{ + printf("This test is a simple profile-sec provider test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d.out new file mode 100644 index 00000000..9091592d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profilesec.d.out @@ -0,0 +1 @@ +This test is a simple profile-sec provider test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d new file mode 100644 index 00000000..32ab4155 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple profile-us simple test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-200us +{ + printf("This test is a simple profile-us provider test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d.out new file mode 100644 index 00000000..aa270642 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileus.d.out @@ -0,0 +1 @@ +This test is a simple profile-us provider test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d new file mode 100644 index 00000000..78df000b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple profile-usec simple test. + * + * SECTION: profile Provider/profile-n probes + * + */ + + +#pragma D option quiet + +profile-200usec +{ + printf("This test is a simple profile-usec provider test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d.out new file mode 100644 index 00000000..96dfef1c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.profileusec.d.out @@ -0,0 +1 @@ +This test is a simple profile-usec provider test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh new file mode 100644 index 00000000..218a651c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh @@ -0,0 +1,70 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +script() +{ + $dtrace -qs /dev/stdin <<EOF + profile-1234hz + /arg0 != 0/ + { + @[sym(arg0)] = count(); + } + + tick-100ms + /i++ == 50/ + { + exit(0); + } +EOF +} + +spinny() +{ + while true; do + /usr/bin/date > /dev/null + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +spinny & +child=$! + +# +# This is the same gutsy test as that found in the func() test; see that +# test for the rationale. +# +script | tee /dev/fd/2 | grep mutex_enter > /dev/null +status=$? + +kill $child +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh new file mode 100644 index 00000000..69c0f84a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufunc.ksh @@ -0,0 +1,71 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +script() +{ + $dtrace -qs /dev/stdin <<EOF + profile-1234hz + /arg1 != 0/ + { + @[ufunc(arg1)] = count(); + } + + tick-100ms + /i++ == 20/ + { + exit(0); + } +EOF +} + +spinny() +{ + while true; do + let i=i+1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +spinny & +child=$! + +# +# The only thing we can be sure of here is that we caught some function in +# ksh doing work. (This actually goes one step further and assumes that we +# catch some non-static function in ksh.) +# +script | tee /dev/fd/2 | grep 'ksh`[a-zA-Z_]' > /dev/null +status=$? + +kill $child +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c new file mode 100644 index 00000000..96d78a43 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +typedef void f(int x); + +static void +f_a(int i) +{ +} + +static void +f_b(int i) +{ +} + +static void +f_c(int i) +{ +} + +static void +f_d(int i) +{ +} + +static void +f_e(int i) +{ +} + +static void +fN(f func, int i) +{ + func(i); +} + +int +main() +{ + fN(f_a, 1); + fN(f_b, 2); + fN(f_c, 3); + fN(f_d, 4); + fN(f_e, 5); + fN(f_a, 11); + fN(f_c, 13); + fN(f_d, 14); + fN(f_a, 101); + fN(f_c, 103); + fN(f_c, 1003); + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh new file mode 100755 index 00000000..4689355a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh @@ -0,0 +1,66 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# ufunc() values sort as expected +# +# SECTION: Aggregations, Printing Aggregations +# +# NOTES: Assumes that the order of user function addresses will follow +# the function declaration order. +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -c ./tst.ufuncsort.exe -s /dev/stdin <<EOF + + + #pragma D option quiet + #pragma D option aggsortkey + + pid\$target::fN:entry + { + @[ufunc(arg0)] = count(); + } +EOF + +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed + exit $status +fi + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh.out new file mode 100644 index 00000000..a364322b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.ksh.out @@ -0,0 +1,6 @@ + + tst.ufuncsort.exe`f_a 3 + tst.ufuncsort.exe`f_b 1 + tst.ufuncsort.exe`f_c 4 + tst.ufuncsort.exe`f_d 2 + tst.ufuncsort.exe`f_e 1 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh new file mode 100644 index 00000000..6ca823f5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.umod.ksh @@ -0,0 +1,69 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +script() +{ + $dtrace -qs /dev/stdin <<EOF + profile-1234hz + /arg1 != 0/ + { + @[umod(arg1)] = count(); + } + + tick-100ms + /i++ == 20/ + { + exit(0); + } +EOF +} + +spinny() +{ + while true; do + let i=i+1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +spinny & +child=$! + +# +# The only thing we can be sure of here is that ksh is doing some work. +# +script | tee /dev/fd/2 | grep -w ksh > /dev/null +status=$? + +kill $child +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh new file mode 100644 index 00000000..b1a3ab9d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/profile-n/tst.usym.ksh @@ -0,0 +1,70 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +script() +{ + $dtrace -qs /dev/stdin <<EOF + profile-1234hz + /arg1 != 0/ + { + @[usym(arg1)] = count(); + } + + tick-100ms + /i++ == 20/ + { + exit(0); + } +EOF +} + +spinny() +{ + while true; do + let i=i+1 + done +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +spinny & +child=$! + +# +# This test is essentially the same as that in the ufunc test; see that +# test for the rationale. +# +script | tee /dev/fd/2 | grep 'ksh`[a-zA-Z_]' > /dev/null +status=$? + +kill $child +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_INVAL.wrongdec4.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_INVAL.wrongdec4.d new file mode 100644 index 00000000..0a7aa14a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_INVAL.wrongdec4.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * call profile<provider name>; called with no "::::". + * should fail with compilation error. + * + * + * SECTION: profile Provider/tick-n probes + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile::::tick-1sec +{ + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.nonprofile.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.nonprofile.d new file mode 100644 index 00000000..1356a896 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.nonprofile.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test; + * Call user created provider. Make sure it gives compilation error. + * + * SECTION: profile Provider/profile-n probes + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::test +/i < 3/ +{ + i++; + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec1.d new file mode 100644 index 00000000..e06edee5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec1.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * call profile::<provider name>; called with two "::". + * should fail with compilation error. + * + * SECTION: profile Provider/tick-n probes + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile::tick-1sec +{ + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec2.d new file mode 100644 index 00000000..ea8909ca --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec2.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * call profile:<provider name>; called with one ":". + * should fail with compilation error. + * + * SECTION: profile Provider/tick-n probes + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:tick-1sec +{ + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec3.d new file mode 100644 index 00000000..edea0b92 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/err.D_PDESC_ZERO.wrongdec3.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * call profile<provider name>; called with no ":". + * should fail with compilation error. + * + * SECTION: profile Provider/tick-n probes + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profiletick-1sec +{ + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.basics.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.basics.d new file mode 100644 index 00000000..6b6e5269 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.basics.d @@ -0,0 +1,57 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test; + * Call same profile provider two times + * Match expected output in tst.basics.d.out + * + * SECTION: profile Provider/tick-n probes + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 3/ +{ + i++; + trace(i); +} + +profile:::tick-1sec +/i == 3/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.basics.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.basics.d.out new file mode 100644 index 00000000..190a1803 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.basics.d.out @@ -0,0 +1 @@ +123 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginexit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginexit.d new file mode 100644 index 00000000..202abe67 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginexit.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +BEGIN +{ + exit(0); +} + +BEGIN +{ + printf("shouldn't be here..."); + here++; +} + +END +{ + exit(here); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginprof.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginprof.d new file mode 100644 index 00000000..99989d94 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginprof.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * print the 'probeprov, probemod, probefunc, probename' from + * BEGIN + * Match the output from tst.beginprof.d.out + * + * SECTION: profile Provider/profile-n probes; + * Variables/Built-in Variables + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("%s %s %s %s", probeprov, probemod, probefunc, probename); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginprof.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginprof.d.out new file mode 100644 index 00000000..d28a0572 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.beginprof.d.out @@ -0,0 +1 @@ +dtrace BEGIN diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probattrs.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probattrs.d new file mode 100644 index 00000000..bd24ca01 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probattrs.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * print the 'probeprov, probemod, probefunc, probename' at once. + * Match expected output in tst.probattrs.d.out + * + * + * SECTION: profile Provider/tick-n probes; + * Variables/Built-in Variables + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +{ + printf("%s %s %s %s", probeprov, probemod, probefunc, probename); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probattrs.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probattrs.d.out new file mode 100644 index 00000000..2a13979c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probattrs.d.out @@ -0,0 +1 @@ +profile tick-1sec diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probefunc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probefunc.d new file mode 100644 index 00000000..fa7c47c5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probefunc.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * print the 'probefunc' field i.e. Current probe description's function + * field. + * Match expected output in tst.probefunc.d.out + * + * SECTION: profile Provider/tick-n probes; + * Variables/Built-in Variables + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +{ + printf("probe funct = %s", probefunc); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probefunc.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probefunc.d.out new file mode 100644 index 00000000..de191dd6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probefunc.d.out @@ -0,0 +1 @@ +probe funct = diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probemod.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probemod.d new file mode 100644 index 00000000..89fd8b2a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probemod.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * print the 'probemod' field i.e. Current probe description's module + * field. + * Match expected output in tst.probemod.d.out + * + * SECTION: profile Provider/tick-n probes; + * Variables/Built-in Variables + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +{ + printf("probe description module field = %s", probemod); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probemod.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probemod.d.out new file mode 100644 index 00000000..1c95a770 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probemod.d.out @@ -0,0 +1 @@ +probe description module field = diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probename.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probename.d new file mode 100644 index 00000000..c58097f9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probename.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * print the 'probename' field i.e. Current probe description's name + * field. + * Match expected output in tst.probename.d.out + * + * SECTION: profile Provider/tick-n probes; + * Variables/Built-in Variables + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +{ + printf("probe name = %s", probename); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probename.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probename.d.out new file mode 100644 index 00000000..e5ff3e04 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probename.d.out @@ -0,0 +1 @@ +probe name = tick-1sec diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probprov.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probprov.d new file mode 100644 index 00000000..3c3ccef8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probprov.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * print the 'probeprov' field i.e. Current probe description's provider + * field. + * Match expected output in tst.probeprov.d.out + * + * SECTION: profile Provider/tick-n probes; + * Variables/Built-in Variables + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +{ + printf("probe description provider = %s", probeprov); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probprov.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probprov.d.out new file mode 100644 index 00000000..d8ca594f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.probprov.d.out @@ -0,0 +1 @@ +probe description provider = profile diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profend.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profend.d new file mode 100644 index 00000000..9ab438a4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profend.d @@ -0,0 +1,57 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * Call simple profile with END profile. + * Match expected output in tst.profend.d.out + * + * + * SECTION: profile Provider/tick-n probes + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +{ + i++; + trace(i); + exit(0); +} + +dtrace:::END +{ + printf("\nI'm at END"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profend.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profend.d.out new file mode 100644 index 00000000..42e30052 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profend.d.out @@ -0,0 +1,2 @@ +1 +I'm at END diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profexit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profexit.d new file mode 100644 index 00000000..884053f1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profexit.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test; + * Call simple profile + * Match expected output in tst.profexit.d.out + * + * + * SECTION: profile Provider/tick-n probes + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +{ + i++; + trace(i); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profexit.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profexit.d.out new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.profexit.d.out @@ -0,0 +1 @@ +1 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.trace.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.trace.d new file mode 100644 index 00000000..ec7053d3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.trace.d @@ -0,0 +1,56 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * Call simple profile with trace() in END profile + * Match expected output in tst.trace.d.out + * + * + * SECTION: profile Provider/tick-n probes + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +{ + i++; + exit(0); +} + +dtrace:::END +{ + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.trace.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.trace.d.out new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.trace.d.out @@ -0,0 +1 @@ +1 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.twoprof.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.twoprof.d new file mode 100644 index 00000000..352ed0b8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.twoprof.d @@ -0,0 +1,58 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple profile provider test. + * Call two different profile provider + * Match expected output in tst.twoprof.d.out + * + * + * SECTION: profile Provider/tick-n probes + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 3/ +{ + i++; + trace(i); +} + +profile:::tick-100msec +/i == 3/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.twoprof.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.twoprof.d.out new file mode 100644 index 00000000..190a1803 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/providers/tst.twoprof.d.out @@ -0,0 +1 @@ +123 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise1.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise1.c new file mode 100644 index 00000000..e3910836 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise1.c @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> +#include <signal.h> + +int +main(int argc, char **argv) +{ + sigset_t ss; + + (void) sigemptyset(&ss); + (void) sigaddset(&ss, SIGINT); + (void) sigprocmask(SIG_BLOCK, &ss, NULL); + + do { + (void) getpid(); + (void) sigpending(&ss); + } while (!sigismember(&ss, SIGINT)); + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise1.d new file mode 100644 index 00000000..b3b70f24 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise1.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Positive test for raise + * + * SECTION: Actions and Subroutines/raise() + */ + +#pragma D option destructive + +BEGIN +{ + /* + * Wait no more than a second for the process to call getpid(). + */ + timeout = timestamp + 1000000000; +} + +syscall::getpid:entry +/pid == $1/ +{ + trace("raised"); + raise(SIGINT); + /* + * Wait no more than half a second for the process to die. + */ + timeout = timestamp + 500000000; +} + +syscall::rexit:entry +{ + exit(0); +} + +profile:::tick-4 +/timestamp > timeout/ +{ + trace("timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise2.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise2.c new file mode 100644 index 00000000..be0d9820 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise2.c @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> +#include <signal.h> + +static void +handle(int sig) +{ + exit(0); +} + +int +main(int argc, char **argv) +{ + struct sigaction sa; + + sa.sa_handler = handle; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + + (void) sigaction(SIGINT, &sa, NULL); + + for (;;) { + (void) getpid(); + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise2.d new file mode 100644 index 00000000..1f967a3d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise2.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Positive test for raise + * + * SECTION: Actions and Subroutines/raise() + */ + +#pragma D option destructive + +BEGIN +{ + /* + * Wait no more than a second for the process to call getpid(). + */ + timeout = timestamp + 1000000000; +} + +syscall::getpid:return +/pid == $1/ +{ + trace("raised"); + raise(SIGINT); + /* + * Wait no more than half a second for the process to die. + */ + timeout = timestamp + 500000000; +} + +syscall::rexit:entry +{ + exit(0); +} + +profile:::tick-4 +/timestamp > timeout/ +{ + trace("timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise3.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise3.c new file mode 100644 index 00000000..be0d9820 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise3.c @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> +#include <signal.h> + +static void +handle(int sig) +{ + exit(0); +} + +int +main(int argc, char **argv) +{ + struct sigaction sa; + + sa.sa_handler = handle; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + + (void) sigaction(SIGINT, &sa, NULL); + + for (;;) { + (void) getpid(); + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise3.d new file mode 100644 index 00000000..b3b70f24 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/raise/tst.raise3.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Positive test for raise + * + * SECTION: Actions and Subroutines/raise() + */ + +#pragma D option destructive + +BEGIN +{ + /* + * Wait no more than a second for the process to call getpid(). + */ + timeout = timestamp + 1000000000; +} + +syscall::getpid:entry +/pid == $1/ +{ + trace("raised"); + raise(SIGINT); + /* + * Wait no more than half a second for the process to die. + */ + timeout = timestamp + 500000000; +} + +syscall::rexit:entry +{ + exit(0); +} + +profile:::tick-4 +/timestamp > timeout/ +{ + trace("timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.aggrate.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.aggrate.d new file mode 100644 index 00000000..513cd312 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.aggrate.d @@ -0,0 +1,68 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * If the aggregation rate is set properly, there should be no aggregation + * drops. + * + * SECTION: Aggregations/Minimizing drops; + * Options and Tunables/aggrate; + * Options and Tunables/aggsize + */ + +/* + * We rely on the fact that at least 30 bytes must be stored per aggregation + * iteration, but that no more than 300 bytes are stored per iteration. + * We are going to let this run for ten seconds. If the aggregation rate + * is being set properly, there should be no aggregation drops. Note that + * this test (regrettably) may be scheduling sensitive -- but it should only + * fail on the most pathological systems. + */ +#pragma D option aggsize=300 +#pragma D option aggrate=10msec +#pragma D option quiet + +int n; + +tick-100msec +/n < 100/ +{ + @a[n++] = sum(n); +} + +tick-100msec +/n == 100/ +{ + exit(0); +} + +END +{ + printa("%10d\n", @a); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.aggrate.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.aggrate.d.out new file mode 100644 index 00000000..c45f9296 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.aggrate.d.out @@ -0,0 +1,101 @@ + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.statusrate.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.statusrate.d new file mode 100644 index 00000000..43c23bfd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.statusrate.d @@ -0,0 +1,72 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Positive test of statusrate option. + * + * SECTION: Options and Tunables/statusrate + */ + +/* + * Tests the statusrate option, by checking that the time delta between + * exit() and END is at least as long as mandated by the statusrate. + */ + +#pragma D option statusrate=10sec + +inline uint64_t NANOSEC = 1000000000; + +tick-1sec +/n++ > 5/ +{ + exit(2); + ts = timestamp; +} + +END +/(this->delta = timestamp - ts) > 2 * NANOSEC/ +{ + exit(0); +} + +END +/this->delta <= 2 * NANOSEC/ +{ + printf("delta between exit() and END (%u nanos) too small", + this->delta); + exit(1); +} + +END +/this->delta > 20 * NANOSEC/ +{ + printf("delta between exit() and END (%u nanos) too large", + this->delta); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.switchrate.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.switchrate.d new file mode 100644 index 00000000..691b31cd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.switchrate.d @@ -0,0 +1,62 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * If the switch rate is set properly, there should be no drops. + * + * SECTION: Buffers and Buffering/switch Policy; + * Options and Tunables/bufsize; + * Options and Tunables/switchrate + */ + +/* + * We rely on the fact that at least 8 bytes must be stored per iteration + * (EPID plus data), but that no more than 40 bytes are stored per iteration. + * We are going to let this run for ten seconds. If the switch rate + * is being set properly, there should be no drops. Note that this test + * (regrettably) may be scheduling sensitive -- but it should only fail on + * the most pathological systems. + */ +#pragma D option bufsize=40 +#pragma D option switchrate=10msec +#pragma D option quiet + +int n; + +tick-100msec +/n < 100/ +{ + printf("%10d\n", n++); +} + +tick-100msec +/n == 100/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.switchrate.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.switchrate.d.out new file mode 100644 index 00000000..c45f9296 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/rates/tst.switchrate.d.out @@ -0,0 +1,101 @@ + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.basename.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.basename.d new file mode 100644 index 00000000..3def9649 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.basename.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt:::entry +/on/ +{ + trace(basename((char *)rand())); +} + +fbt:::entry +/on/ +{ + trace(basename((char *)arg1)); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.caller.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.caller.d new file mode 100644 index 00000000..b9777c1d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.caller.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + + +/* + * ASSERTION: + * Make sure that the caller variable is safe to use at every fbt probe + * point. + * + * SECTION: Variables/Built-in Variables; + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + trace(caller); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.cleanpath.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.cleanpath.d new file mode 100644 index 00000000..729f320b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.cleanpath.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(cleanpath((char *)rand())); +} + +fbt:::entry +/on/ +{ + trace(cleanpath((char *)arg1)); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.copyin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.copyin.d new file mode 100644 index 00000000..7426d19e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.copyin.d @@ -0,0 +1,83 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * We set our buffer size absurdly low to prevent a flood of errors that we + * don't care about. We set our statusrate to be infinitely short to cause + * lots of activity by the DTrace process. + * + * SECTION: Actions and Subroutines/copyin(); + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + + +#pragma D option bufsize=16 +#pragma D option bufpolicy=ring +#pragma D option statusrate=1nsec + +syscall:::entry +{ + n++; + trace(copyin(rand(), 1)); +} + +syscall:::entry +{ + trace(copyin(rand() | 1, 1)); +} + +syscall:::entry +{ + trace(copyin(NULL, 1)); +} + +dtrace:::ERROR +{ + err++; +} + +tick-1sec +/sec++ == 10/ +{ + exit(2); +} + +END +/n == 0 || err == 0/ +{ + exit(1); +} + +END +/n != 0 && err != 0/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.copyin2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.copyin2.d new file mode 100644 index 00000000..aef09440 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.copyin2.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * Test that there is no value of 'size' which can be passed to copyin + * to cause mischief. The somewhat odd order of operations ensures + * that we test both size = 0 and size = 0xfff...fff + */ +#include <sys/types.h> + + +#if defined(_LP64) +#define MAX_BITS 63 +size_t size; +#else +#define MAX_BITS 31 +size_t size; +#endif + +syscall::: +/pid == $pid/ +{ + printf("size = 0x%lx\n", (ulong_t)size); +} + +syscall::: +/pid == $pid/ +{ + tracemem(copyin(curthread->t_procp->p_user.u_envp, size), 10); +} + +syscall::: +/pid == $pid && size > (1 << MAX_BITS)/ +{ + exit(0); +} + +syscall::: +/pid == $pid/ +{ + size = (size << 1ULL) | 1ULL; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ddi_pathname.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ddi_pathname.d new file mode 100644 index 00000000..74275685 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ddi_pathname.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(ddi_pathname((struct dev_info *)rand(), rand())); +} + +fbt:::entry +/on/ +{ + trace(ddi_pathname((struct dev_info *)arg1, rand())); +} + +tick-1sec +/n++ == 20/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.dirname.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.dirname.d new file mode 100644 index 00000000..791d9b5f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.dirname.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(dirname((char *)rand())); +} + +fbt:::entry +/on/ +{ + trace(dirname((char *)arg1)); +} + +tick-1sec +/n++ == 20/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.errno.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.errno.d new file mode 100644 index 00000000..d3f238b7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.errno.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect errno at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[errno] = count(); +} + +profile-4999hz +{ + @a[errno] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.execname.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.execname.d new file mode 100644 index 00000000..cd9ca211 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.execname.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect execname at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[execname] = count(); +} + +profile-4999hz +{ + @a[execname] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.gid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.gid.d new file mode 100644 index 00000000..f8f90e73 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.gid.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect gid at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[gid] = count(); +} + +profile-4999hz +{ + @a[gid] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.hton.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.hton.d new file mode 100644 index 00000000..d573bfd1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.hton.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(htons(0x1122)); +} + +fbt::: +/on/ +{ + trace(htonl(0x11223344)); +} + +fbt::: +/on/ +{ + trace(htonll(0x1122334455667788)); +} + +fbt::: +/on/ +{ + trace(ntohs(0x1122)); +} + +fbt::: +/on/ +{ + trace(ntohl(0x11223344)); +} + +fbt::: +/on/ +{ + trace(ntohll(0x1122334455667788)); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.index.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.index.d new file mode 100644 index 00000000..22b0b5bc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.index.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(index((char *)rand(), (char *)(rand() ^ vtimestamp))); +} + +fbt::: +/on/ +{ + trace(rindex((char *)rand(), (char *)(rand() ^ vtimestamp, + timestamp))); +} + +fbt:::entry +/on/ +{ + trace(index((char *)arg0, (char *)arg1, rand())); +} + +fbt:::entry +/on/ +{ + trace(rindex((char *)arg0, (char *)arg1)); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.msgdsize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.msgdsize.d new file mode 100644 index 00000000..c4e7c348 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.msgdsize.d @@ -0,0 +1,64 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Make sure that the msgdsize safe to use at every fbt probe + * + * SECTION: Actions and Subroutines/msgdsize(); + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(msgdsize((mblk_t *)rand())); +} + +fbt:::entry +/on/ +{ + trace(msgdsize((mblk_t *)arg1)); +} + +tick-1sec +/n++ == 20/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.msgsize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.msgsize.d new file mode 100644 index 00000000..42aebe4c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.msgsize.d @@ -0,0 +1,64 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Make sure that the msgsize safe to use at every fbt probe + * + * SECTION: Actions and Subroutines/msgsize(); + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(msgsize((mblk_t *)rand())); +} + +fbt::: +/on/ +{ + trace(msgdsize((mblk_t *)rand())); +} + +tick-1sec +/n++ == 20/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.null.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.null.d new file mode 100644 index 00000000..cafa3af7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.null.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * trace with NULL argument - generate a bunch of errors + * + * SECTION: Options and Tunables/bufsize; + * Options and Tunables/bufpolicy + */ + +/* + * We set our buffer size absurdly low to prevent a flood of errors that we + * don't care about. + */ + +#pragma D option bufsize=16 +#pragma D option bufpolicy=ring + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + n++; + trace(*(int *)NULL); +} + +dtrace:::ERROR +{ + err++; +} + +tick-1sec +/sec++ == 10/ +{ + exit(2); +} + +END +/n == 0 || err == 0/ +{ + exit(1); +} + +END +/n != 0 && err != 0/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.pid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.pid.d new file mode 100644 index 00000000..2b7a92e1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.pid.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect pid at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[pid] = count(); +} + +profile-4999hz +{ + @a[pid] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ppid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ppid.d new file mode 100644 index 00000000..faf07dc4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ppid.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect ppid at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[ppid] = count(); +} + +profile-4999hz +{ + @a[ppid] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.progenyof.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.progenyof.d new file mode 100644 index 00000000..d488fe2e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.progenyof.d @@ -0,0 +1,57 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * trace progenyof() at every fbt probe point. + * + * SECTION: Actions and Subroutines/progenyof(); + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + trace(progenyof(rand())); +} + +profile-4999hz +{ + trace(progenyof(rand())); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.random.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.random.d new file mode 100644 index 00000000..8d157efd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.random.d @@ -0,0 +1,73 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * trace rand() at every fbt probe point. + * + * SECTION: Actions and Subroutines/rand(); + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy + */ + +/* + * We set our buffer size absurdly low to prevent a flood of errors that we + * don't care about. + */ + +#pragma D option bufsize=16 +#pragma D option bufpolicy=ring + +fbt::: +{ + n++; + trace(*(int *)rand()); +} + +dtrace:::ERROR +{ + err++; +} + +tick-1sec +/sec++ == 10/ +{ + exit(2); +} + +END +/n == 0 || err == 0/ +{ + exit(1); +} + +END +/n != 0 && err != 0/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.rw.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.rw.d new file mode 100644 index 00000000..0df97877 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.rw.d @@ -0,0 +1,64 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + @[rw_read_held((krwlock_t *)&`clock)] = count(); + @[rw_read_held((krwlock_t *)rand())] = count(); +} + +fbt::: +/on/ +{ + @[rw_write_held((krwlock_t *)&`clock)] = count(); + @[rw_write_held((krwlock_t *)rand())] = count(); +} + +fbt::: +/on/ +{ + @[rw_iswriter((krwlock_t *)&`clock)] = count(); + @[rw_iswriter((krwlock_t *)rand())] = count(); +} + +tick-1sec +/n++ == 20/ +{ + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.shortstr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.shortstr.d new file mode 100644 index 00000000..188f705c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.shortstr.d @@ -0,0 +1,77 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet +#pragma D option strsize=16 + +BEGIN +{ + this->str = ",,,Carrots,,Barley,Oatmeal,,,,,,,,,,,,,,,,,,Beans,"; +} + +BEGIN +{ + strtok(this->str, ","); +} + +BEGIN +{ + this->str = ",,,,,,,,,,,,,,,,,,,,,,Carrots,"; + strtok(this->str, ","); +} + +BEGIN +{ + strtok(this->str, "a"); +} + +BEGIN +{ + printf("%s\n", substr(this->str, 1, 40)); +} + +BEGIN +{ + printf("%s\n", strjoin(this->str, this->str)); +} + +BEGIN +{ + this->str1 = "........................................."; + printf("%d\n", index(this->str, this->str1)); +} + +BEGIN +{ + printf("%d\n", rindex(this->str, this->str1)); +} + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stack.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stack.d new file mode 100644 index 00000000..57588b4d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stack.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Call stack() at every fbt probe point. + * + * SECTION: Actions and Subroutines/stack(); + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + stack(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stackdepth.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stackdepth.d new file mode 100644 index 00000000..a39387fd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stackdepth.d @@ -0,0 +1,53 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test that the stackdepth variable is safe to use at every fbt probe + * point. + * + * SECTION: Variables/Built-in Variables; + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + trace(stackdepth); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stddev.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stddev.d new file mode 100644 index 00000000..927930d0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.stddev.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Call stddev() at every fbt probe point. + * + * SECTION: Actions and Subroutines/stddev(); + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + @a = stddev(1); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strchr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strchr.d new file mode 100644 index 00000000..bc95c486 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strchr.d @@ -0,0 +1,66 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(strchr((char *)(rand() ^ timestamp), rand())); +} + +fbt::: +/on/ +{ + trace(strrchr((char *)(rand() ^ timestamp), rand())); +} + +fbt:::entry +/on/ +{ + trace(strchr((char *)arg0, '!')); +} + +fbt:::entry +/on/ +{ + trace(strrchr((char *)arg0, '!')); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strjoin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strjoin.d new file mode 100644 index 00000000..5ed2935d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strjoin.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(strjoin((char *)rand(), (char *)(rand() ^ vtimestamp))); +} + +fbt:::entry +/on/ +{ + trace(strjoin((char *)arg0, (char *)arg1)); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strstr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strstr.d new file mode 100644 index 00000000..025e5472 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strstr.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(strstr((char *)rand(), (char *)(rand() ^ vtimestamp))); +} + +fbt:::entry +/on/ +{ + trace(strstr((char *)arg0, (char *)arg1)); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strtok.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strtok.d new file mode 100644 index 00000000..1027d2ed --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.strtok.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(strtok((char *)rand(), (char *)(rand() ^ vtimestamp))); +} + +fbt:::entry +/on/ +{ + trace(strtok((char *)arg0, (char *)arg1)); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.substr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.substr.d new file mode 100644 index 00000000..d5ed9a48 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.substr.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + on = (timestamp / 1000000000) & 1; +} + +fbt::: +/on/ +{ + trace(substr((char *)rand(), rand() ^ vtimestamp)); +} + +fbt::: +/on/ +{ + trace(substr((char *)rand(), -rand() ^ vtimestamp)); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ucaller.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ucaller.d new file mode 100644 index 00000000..524c88b7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ucaller.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect ucaller at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[ucaller] = count(); +} + +profile-4999hz +{ + @a[ucaller] = count(); +} + +tick-1sec +/n++ == 30/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.uid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.uid.d new file mode 100644 index 00000000..b546457e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.uid.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect uid at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[uid] = count(); +} + +profile-4999hz +{ + @a[uid] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.unalign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.unalign.d new file mode 100644 index 00000000..e996cbd8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.unalign.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * We set our buffer size absurdly low to prevent a flood of errors that we + * don't care about. Note that this test (unlike some other safety tests) + * doesn't check the error count -- some architectures have no notion of + * alignment. + */ +#pragma D option bufsize=16 +#pragma D option bufpolicy=ring + +fbt::: +{ + n++; + trace(*(int *)(rand() | 1)); +} + +tick-1sec +/sec++ == 10/ +{ + exit(2); +} + +END +/n == 0/ +{ + exit(1); +} + +END +/n != 0/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.uregs.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.uregs.d new file mode 100644 index 00000000..b13434db --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.uregs.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Trace uregs[0] at every fbt probe point. + * SECTION: Variables/Built-in Variables; + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + trace(uregs[0]); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ustack.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ustack.d new file mode 100644 index 00000000..a286382a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ustack.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Call ustack() at every fbt probe point. + * + * SECTION: Actions and Subroutines/ustack(); + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + ustack(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ustackdepth.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ustackdepth.d new file mode 100644 index 00000000..942913c3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.ustackdepth.d @@ -0,0 +1,53 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test that the ustackdepth variable is safe to use at every fbt probe + * point. + * + * SECTION: Variables/Built-in Variables; + * Options and Tunables/bufsize; + * Options and Tunables/bufpolicy; + * Options and Tunables/statusrate + */ + +#pragma D option bufsize=1000 +#pragma D option bufpolicy=ring +#pragma D option statusrate=10ms + +fbt::: +{ + trace(ustackdepth); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.vahole.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.vahole.d new file mode 100755 index 00000000..2ef40a5a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.vahole.d @@ -0,0 +1,69 @@ +#!/usr/sbin/dtrace -Cs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * We set our buffer size absurdly low to prevent a flood of errors that we + * don't care about. + */ +#pragma D option bufsize=16 +#pragma D option bufpolicy=ring + +fbt::: +{ + n++; +#ifdef __sparc + trace(*(int *)0x8000000000000000 ^ rand()); +#else + trace(*(int *)(`kernelbase - 1)); +#endif +} + +dtrace:::ERROR +{ + err++; +} + +tick-1sec +/sec++ == 10/ +{ + exit(2); +} + +END +/n == 0 || err == 0/ +{ + exit(1); +} + +END +/n != 0 && err != 0/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh new file mode 100644 index 00000000..879774a4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.violentdeath.ksh @@ -0,0 +1,51 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +script() +{ + $dtrace -x bufpolicy=ring -x bufsize=1k -s /dev/stdin <<EOF + fbt::: + {} +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +let i=0 + +while [ "$i" -lt 10 ]; do + script & + child=$! + sleep 1 + kill -9 $child + let i=i+1 +done diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.zonename.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.zonename.d new file mode 100644 index 00000000..5fc025f9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/safety/tst.zonename.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * collect zonename at every fbt probe and at every firing of a + * high-frequency profile probe + */ + +fbt::: +{ + @a[zonename] = count(); +} + +profile-4999hz +{ + @a[zonename] = count(); +} + +tick-1sec +/n++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_ARR_LOCAL.thisarray.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_ARR_LOCAL.thisarray.d new file mode 100644 index 00000000..289d164d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_ARR_LOCAL.thisarray.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Use 'this' variables in associative array. + * + * SECTION: Variables/Scalar Variables + * + */ + +this int y; +this int z; +this int res; + +BEGIN +{ + this->x[this->y, this->z] = 123; + this->res = this->x[this->y, this->z]++; + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.selfthis.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.selfthis.d new file mode 100644 index 00000000..eda1151b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.selfthis.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Declare a variable and assign inappropriate value. + * + * SECTION: Variables/Scalar Variables + * + */ +self this int x; + +BEGIN +{ + x = "dummy"; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.thisself.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.thisself.d new file mode 100644 index 00000000..f9c596b6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_CLASS.thisself.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Multiple storage declarations. + * + * SECTION: Variables/Scalar Variables + * + */ +this self int x; + +BEGIN +{ + x = "dummy"; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_IDRED.errval.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_IDRED.errval.d new file mode 100644 index 00000000..3130fbfe --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_DECL_IDRED.errval.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Declare a variable with different data types. + * + * SECTION: Variables/Scalar Variables + * + */ +int x; +char x; +double x; +long x; + +BEGIN +{ + x = 123; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dec.err.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dec.err.d new file mode 100644 index 00000000..4261e072 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dec.err.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a variable and assign inappropriate value. + * + * SECTION: Variables/Scalar Variables + * + */ +int x; + +BEGIN +{ + x = "dummy"; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d new file mode 100644 index 00000000..71f9c0b4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test assigning a variable two different incompatible types. + * + * SECTION: Variables/Scalar Variables + * + */ + +BEGIN +{ + x = `kmem_flags; + x = *`rootvp; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d new file mode 100644 index 00000000..c316441e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test assigning a variable two different incompatible types. + * + * SECTION: Variables/Clause-Local Variables + * + */ + +BEGIN +{ + this->x = `kmem_flags; + this->x = *`rootvp; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d new file mode 100644 index 00000000..23f26f7f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test assigning a variable two different incompatible types. + * Test assigning a variable two different incompatible types. + * + * SECTION: Variables/Thread-Local Variables + * + */ + +BEGIN +{ + self->x = `kmem_flags; + self->x = *`rootvp; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_SYNTAX.declare.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_SYNTAX.declare.d new file mode 100644 index 00000000..246236a9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/err.D_SYNTAX.declare.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a variable Inside Begin and make sure compilation fails. + * + * SECTION: Variables/Scalar Variables + * + */ + +BEGIN +{ + int x = 123; +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d new file mode 100644 index 00000000..55616314 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d @@ -0,0 +1,57 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Global variables defined once, is visible in every clause of + * D program + * + * SECTION: Variables/Scalar Variables + * + */ + +#pragma D option quiet + +int x; + +BEGIN +{ + x = 123; +} + +profile:::tick-1sec +{ + printf("The value of x is %d\n", x); +} + +profile:::tick-100msec +{ + printf("The value of x is %d\n", x); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d.out new file mode 100644 index 00000000..2b8999e4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.basicvar.d.out @@ -0,0 +1,2 @@ +The value of x is 123 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.localvar.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.localvar.d new file mode 100644 index 00000000..9a89a048 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.localvar.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Assign a value to a variable in a local clause. + * + * SECTION: Variables/Scalar Variables + * + */ + +#pragma D option quiet + +BEGIN +{ +} +int i; + +profile:::tick-1sec +{ + i = 0; +} + +profile:::tick-100msec +{ + printf("The value of int i is %d\n", i); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.misc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.misc.d new file mode 100644 index 00000000..3b6eb7a7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.misc.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the different kinds of integer scalar references. In particular, we + * test accessing a kernel executable scalar, kernel scoped scalar, DTrace + * scalar first ref that forces creation (both global and TLS), and DTrace + * scalar subsequent reference (both global and TLS). + * + * SECTION: Variables/External Variables + * + */ + +BEGIN +{ + printf("\nkmem_flags = 0x%x\n", `kmem_flags); + printf("ufs`ufs_allow_shared_writes = %d\n", + ufs`ufs_allow_shared_writes); + x = 123; + printf("x = %u\n", x); + self->x = 456; + printf("self->x = %u\n", self->x); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.self.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.self.d new file mode 100644 index 00000000..514f3859 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.self.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Declare self a variable and assign appropriate value. + * + * SECTION: Variables/Scalar Variables + * + */ +self x; + +BEGIN +{ + x = "dummy"; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfarray.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfarray.d new file mode 100644 index 00000000..410e8def --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfarray.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a self variable and assign appropriate value. + * + * SECTION: Variables/Scalar Variables + * + */ + +self int y; +self int z; +self int res; + +BEGIN +{ + self->x[self->y, self->z] = 123; + self->res = self->x[self->y, self->z]++; + printf("The result = %d\n", self->res); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfarray2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfarray2.d new file mode 100644 index 00000000..2fd69c69 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfarray2.d @@ -0,0 +1,64 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet +#pragma D option destructive +#pragma D option dynvarsize=1m + +struct bar { + int pid; + kthread_t *curthread; +}; + +self struct bar foo[int]; + +syscall:::entry +/!self->foo[0].pid/ +{ + self->foo[0].pid = pid; + self->foo[0].curthread = curthread; +} + +syscall:::entry +/self->foo[0].pid != pid/ +{ + printf("expected %d, found %d (found curthread %p, curthread is %p)\n", + pid, self->foo[0].pid, self->foo[0].curthread, curthread); + exit(1); +} + +tick-100hz +{ + system("date > /dev/null") +} + +tick-1sec +/i++ == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfthis.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfthis.d new file mode 100644 index 00000000..7bbfaf76 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.selfthis.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Declare a this variable and assign value of self variable to it. + * + * SECTION: Variables/Scalar Variables + * + */ +self int x; +this int y; + +BEGIN +{ + this->x = 123; + self->y = this->x; + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.this.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.this.d new file mode 100644 index 00000000..01ea89f4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.this.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple 'this' declaration. + * + * SECTION: Variables/Scalar Variables + * + */ +this x; + +BEGIN +{ + x = "dummy"; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.thisself.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.thisself.d new file mode 100644 index 00000000..925dff2b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scalars/tst.thisself.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Declare a self value and assign value of 'this' variable to that. + * + * SECTION: Variables/Scalar Variables + * + */ +self int x; +this int y; + +BEGIN +{ + self->x = 123; + this->y = self->x; + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.enqueue.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.enqueue.d new file mode 100644 index 00000000..77105c1e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.enqueue.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option switchrate=100hz +#pragma D option destructive + +sched:::enqueue +/pid == 0 && args[1]->pr_pid == $pid/ +{ + self->one = 1; +} + +sched:::enqueue +/self->one && args[2]->cpu_id >= 0 && args[2]->cpu_id <= `max_cpuid/ +{ + self->two = 1; +} + +sched:::enqueue +/self->two && args[0]->pr_lwpid > 0/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.oncpu.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.oncpu.d new file mode 100644 index 00000000..25717671 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.oncpu.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option switchrate=100hz +#pragma D option destructive + +sched:::on-cpu +/pid == $pid/ +{ + self->on++; +} + +sched:::off-cpu +/pid == $pid && self->on/ +{ + self->off++; +} + +sched:::off-cpu +/self->on > 50 && self->off > 50/ +{ + exit(0); +} + +profile:::tick-1sec +/n++ > 10/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.stackdepth.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.stackdepth.d new file mode 100644 index 00000000..b4251270 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sched/tst.stackdepth.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option switchrate=100hz + +sched:::on-cpu +/stackdepth > 0/ +{ + exit(0); +} + +tick-1s +/i++ == 3/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_MACRO_UNDEF.invalidargs.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_MACRO_UNDEF.invalidargs.d new file mode 100644 index 00000000..27d969e7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_MACRO_UNDEF.invalidargs.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Try to print arguments not provided. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + print("The arguments are %d %d\n", $1, $2); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_OP_LVAL.rdonly.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_OP_LVAL.rdonly.d new file mode 100644 index 00000000..5bf46751 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_OP_LVAL.rdonly.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Try to update a read-only macro. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + $pid++; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_OP_WRITE.usepidmacro.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_OP_WRITE.usepidmacro.d new file mode 100644 index 00000000..649cbdbc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_OP_WRITE.usepidmacro.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Try to assign value to Macro. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + pid = 1; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.concat.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.concat.d new file mode 100755 index 00000000..00a29969 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.concat.d @@ -0,0 +1,45 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Try to concat macro with user variables in provider description + * section. + * + * SECTION: Scripting + * + */ + +BEGIN +/i = 123$pid/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.desc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.desc.d new file mode 100755 index 00000000..3dfa2b26 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.desc.d @@ -0,0 +1,49 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Try to call providers using macro variables. + * + * SECTION: Scripting + * + */ + +BEGIN +/i = 123$pid/ +{ + exit(0); +} + +pid$pid +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.inval.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.inval.d new file mode 100644 index 00000000..28b251cd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.inval.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Attempt to print invalid arguments. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + print("The arguments are %d %d\n", $-1); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.pid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.pid.d new file mode 100644 index 00000000..d9711d2a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/err.D_SYNTAX.pid.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Attempt to concat and assign a macro to a variable + * + * SECTION: Scripting + * + */ + +BEGIN +{ + i = 123$pid; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh new file mode 100755 index 00000000..0f4e1455 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh @@ -0,0 +1,80 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Attempt to pass some arguments and try not to print it. +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +bname=`/bin/basename $0` +dfilename=/var/tmp/$bname.$$.d + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + +BEGIN +{ + exit(0); +} +EOF +########################################################################## + + +#Call dtrace -C -s <.d> + +$dtrace -x errtags -s $dfilename "this is test" 1>/dev/null \ + 2>/var/tmp/err.$$.txt + +if [ $? -ne 1 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +grep "D_MACRO_UNUSED" /var/tmp/err.$$.txt >/dev/null 2>&1 +if [ $? -ne 0 ]; then + print -u2 "Expected error D_MACRO_UNUSED not returned" + /usr/bin/rm -f /var/tmp/err.$$.txt + exit 1 +fi + +/usr/bin/rm -f $dfilename +/usr/bin/rm -f /var/tmp/err.$$.txt + +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.arg0.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.arg0.d new file mode 100644 index 00000000..999dbc32 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.arg0.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * print argument 0 I mean "$0" + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The arg0 is %s\n", $0); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh new file mode 100755 index 00000000..deb644a5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh @@ -0,0 +1,90 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Pass 10 arguments and try to print them. +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +bname=`/bin/basename $0` + +dfilename=/var/tmp/$bname.$$ + + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + + +BEGIN +{ + printf("%d %d %d %d %d %d %d %d %d %d", \$1, \$2, \$3, \$4, \$5, \$6, + \$7, \$8, \$9, \$10); + exit(0); +} +EOF +########################################################################## + + +#Call dtrace -C -s <.d> + +chmod 555 $dfilename + + +output=`$dfilename 1 2 3 4 5 6 7 8 9 10 2>/dev/null` + +if [ $? -ne 0 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +set -A outarray $output + +if [[ ${outarray[0]} != 1 || ${outarray[1]} != 2 || ${outarray[2]} != 3 || \ + ${outarray[3]} != 4 || ${outarray[4]} != 5 || ${outarray[5]} != 6 || \ + ${outarray[6]} != 7 || ${outarray[7]} != 8 || ${outarray[8]} != 9 || \ + ${outarray[9]} != 10 ]]; then + print -u2 "Error in output by $dfilename" + exit 1 +fi + +/usr/bin/rm -f $dfilename +exit 0 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.assign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.assign.d new file mode 100644 index 00000000..5dd17407 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.assign.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Assign macros to variables + * + * SECTION: Scripting + * + */ + +BEGIN +{ + processid = $pid; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.basic.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.basic.d new file mode 100644 index 00000000..a407f839 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.basic.d @@ -0,0 +1,42 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Basic script which uses exit(0) to exit. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.egid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.egid.d new file mode 100644 index 00000000..3899d2ad --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.egid.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Script which prints effective group id. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The egid is %d\n", $egid); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh new file mode 100755 index 00000000..9e1955f2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh @@ -0,0 +1,97 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# +# To verify egid of current process +# +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +bname=`/bin/basename $0` +dfilename=/var/tmp/$bname.$$.d + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + + +BEGIN +/\$egid != \$1/ +{ + exit(1); +} + +BEGIN +/\$egid == \$1/ +{ + exit(0); +} +EOF +########################################################################## + + +#chmod 555 the .d file + +chmod 555 $dfilename >/dev/null 2>&1 +if [ &? -ne 0 ]; then + print -u2 "chmod $dfilename failed" + exit 1 +fi + +#Get the groupid of the calling process using ps + +groupid=`ps -o pid,gid | grep "$$ " | awk '{print $2}' 2>/dev/null` +if [ $? -ne 0 ]; then + print -u2 "unable to get uid of the current process with pid = $$" + exit 1 +fi + +#Pass groupid as argument to .d file +$dfilename $groupid >/dev/null 2>&1 + +if [ $? -ne 0 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +#Cleanup leftovers + +/usr/bin/rm -f $dfilename +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.euid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.euid.d new file mode 100644 index 00000000..e4cdaa6b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.euid.d @@ -0,0 +1,44 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Script which prints effective user id. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The euid is %d\n", $euid); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh new file mode 100755 index 00000000..7112b257 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh @@ -0,0 +1,86 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# To verify euid of current process +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +bname=`/bin/basename $0` +dfilename=/var/tmp/$bname.$$ + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + + +BEGIN +/\$euid != \$1/ +{ + exit(1); +} + +BEGIN +/\$euid == \$1/ +{ + exit(0); +} +EOF +########################################################################## + + +#Call dtrace -C -s <.d> + +chmod 555 $dfilename + +userid=`ps -o pid,uid | grep "$$ " | awk '{print $2}' 2>/dev/null` +if [ $? -ne 0 ]; then + print -u2 "unable to get uid of the current process with pid = $$" + exit 1 +fi + +$dfilename $userid >/dev/null 2>&1 + +if [ $? -ne 0 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +#/usr/bin/rm -f $dfilename +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.gid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.gid.d new file mode 100644 index 00000000..c3329ce1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.gid.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Script which prints group id. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The gid is %d\n", $gid); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh new file mode 100755 index 00000000..83955db1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh @@ -0,0 +1,86 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# To verify gid of the child process. +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +bname=`/bin/basename $0` +dfilename=/var/tmp/$bname.$$ + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + + +BEGIN +/\$gid != \$1/ +{ + exit(1); +} + +BEGIN +/\$gid == \$1/ +{ + exit(0); +} +EOF +########################################################################## + + +#Call dtrace -C -s <.d> + +chmod 555 $dfilename + +groupid=`ps -o pid,gid | grep "$$ " | awk '{print $2}' 2>/dev/null` +if [ $? -ne 0 ]; then + print -u2 "unable to get uid of the current process with pid = $$" + exit 1 +fi + +$dfilename $groupid >/dev/null 2>&1 + +if [ $? -ne 0 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +#/usr/bin/rm -f $dfilename +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.pgid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.pgid.d new file mode 100644 index 00000000..e01b9968 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.pgid.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Script which prints effective process group id. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The pgid is %d\n", $pgid); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.pid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.pid.d new file mode 100644 index 00000000..1364366c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.pid.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Script which prints pid. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The pid is %d\n", $pid); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.ppid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.ppid.d new file mode 100644 index 00000000..8712cd96 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.ppid.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Script which prints parent processid + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The ppid is %d\n", $ppid); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh new file mode 100755 index 00000000..4a74ee42 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh @@ -0,0 +1,86 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# To verify ppid of child process. +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +bname=`/bin/basename $0` +dfilename=/var/tmp/$bname.$$.d + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + + +BEGIN +/\$ppid != \$1/ +{ + exit(1); +} + +BEGIN +/\$ppid == \$1/ +{ + exit(0); +} +EOF +########################################################################## + + +#chmod the .d file to 555 + +chmod 555 $dfilename >/dev/null 2>&1 +if [ $? -ne 0 ]; then + print -u2 "chmod 555 $dfilename failed" + exit 1 +fi + +#Pass current pid (I mean parent pid for .d script). + +$dfilename $$ >/dev/null 2>&1 + +if [ $? -ne 0 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +#/usr/bin/rm -f $dfilename +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.projid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.projid.d new file mode 100644 index 00000000..a81ab8ee --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.projid.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Script which prints current project id. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The projid is %d\n", $projid); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh new file mode 100755 index 00000000..da60ea1d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh @@ -0,0 +1,86 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# To verify projid of child process. +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +bname=`/bin/basename $0` +dfilename=/var/tmp/$bname.$$ + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + + +BEGIN +/\$projid != \$1/ +{ + exit(1); +} + +BEGIN +/\$projid == \$1/ +{ + exit(0); +} +EOF +########################################################################## + + +#Call dtrace -C -s <.d> + +chmod 555 $dfilename + +projectid=`ps -o pid,projid | grep "$$ " | awk '{print $2}' 2>/dev/null` +if [ $? -ne 0 ]; then + print -u2 "unable to get uid of the current process with pid = $$" + exit 1 +fi + +$dfilename $projectid >/dev/null 2>&1 + +if [ $? -ne 0 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +#/usr/bin/rm -f $dfilename +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.quite.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.quite.d new file mode 100644 index 00000000..c61debed --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.quite.d @@ -0,0 +1,42 @@ +#!/usr/sbin/dtrace -qs + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Script which uses -qs in scripting line + * + * SECTION: Scripting + * + */ + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.sid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.sid.d new file mode 100644 index 00000000..87bab536 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.sid.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Script which prints session id. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The sid is %d\n", $sid); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh new file mode 100755 index 00000000..d1e122c1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh @@ -0,0 +1,86 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# To verify sid of current process. +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +bname=`/bin/basename $0` +dfilename=/var/tmp/$bname.$$ + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + + +BEGIN +/\$sid != \$1/ +{ + exit(1); +} + +BEGIN +/\$sid == \$1/ +{ + exit(0); +} +EOF +########################################################################## + + +#Call dtrace -C -s <.d> + +chmod 555 $dfilename + +sessionid=`ps -o pid,sid | grep "$$ " | awk '{print $2}' 2>/dev/null` +if [ $? -ne 0 ]; then + print -u2 "unable to get sid of the current process with pid = $$" + exit 1 +fi + +$dfilename $sessionid >/dev/null 2>&1 + +if [ $? -ne 0 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +#/usr/bin/rm -f $dfilename +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh new file mode 100755 index 00000000..6903cb1c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh @@ -0,0 +1,78 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# Pass a bunch of strings as a sentence and print them +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +bname=`/bin/basename $0` +dfilename=/var/tmp/$bname.$$.d + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + +BEGIN +{ + printf("%s", \$\$1); + exit(0); +} +EOF +########################################################################## + + +#Call dtrace -C -s <.d> + +chmod 555 $dfilename + +output=`$dfilename 'this is test' 2>/dev/null` + +if [ $? -ne 0 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +if [ "$output" != "this is test" ]; then + print -u2 "Expected output not returned" + exit 1 +fi + +/usr/bin/rm -f $dfilename +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.taskid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.taskid.d new file mode 100644 index 00000000..617827c8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.taskid.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Script which prints taskid. + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The taskid is %d\n", $taskid); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh new file mode 100755 index 00000000..54392d23 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh @@ -0,0 +1,86 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# To verify taskid of current process. +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +bname=`/bin/basename $0` +dfilename=/var/tmp/$bname.$$ + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + + +BEGIN +/\$taskid != \$1/ +{ + exit(1); +} + +BEGIN +/\$taskid == \$1/ +{ + exit(0); +} +EOF +########################################################################## + + +#Call dtrace -C -s <.d> + +chmod 555 $dfilename + +taskidval=`ps -o pid,taskid | grep "$$ " | awk '{print $2}' 2>/dev/null` +if [ $? -ne 0 ]; then + print -u2 "unable to get uid of the current process with pid = $$" + exit 1 +fi + +$dfilename $taskidval >/dev/null 2>&1 + +if [ $? -ne 0 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +#/usr/bin/rm -f $dfilename +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.trace.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.trace.d new file mode 100644 index 00000000..34ba243e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.trace.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * To use trace in a script + * + * SECTION: Scripting + * + */ + +BEGIN +{ + trace("hello"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.uid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.uid.d new file mode 100644 index 00000000..f3ebca61 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.uid.d @@ -0,0 +1,43 @@ +#!/usr/sbin/dtrace -s + +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * print uid in a script + * + * SECTION: Scripting + * + */ + +BEGIN +{ + printf("The uid is %d\n", $uid); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh new file mode 100755 index 00000000..2630f2f9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh @@ -0,0 +1,86 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +#ident "%Z%%M% %I% %E% SMI" + +############################################################################ +# ASSERTION: +# To verify uid of current process. +# +# SECTION: Scripting +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +bname=`/bin/basename $0` +dfilename=/var/tmp/$bname.$$ + +## Create .d file +########################################################################## +cat > $dfilename <<-EOF +#!$dtrace -qs + + +BEGIN +/\$uid != \$1/ +{ + exit(1); +} + +BEGIN +/\$uid == \$1/ +{ + exit(0); +} +EOF +########################################################################## + + +#Call dtrace -C -s <.d> + +chmod 555 $dfilename + +userid=`ps -o pid,uid | grep "$$ " | awk '{print $2}' 2>/dev/null` +if [ $? -ne 0 ]; then + print -u2 "unable to get uid of the current process with pid = $$" + exit 1 +fi + +$dfilename $userid >/dev/null 2>&1 + +if [ $? -ne 0 ]; then + print -u2 "Error in executing $dfilename" + exit 1 +fi + +#/usr/bin/rm -f $dfilename +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c new file mode 100644 index 00000000..07635502 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> +#include <sys/uadmin.h> + +int +main(int argc, char **argv) +{ + while (1) { + if (uadmin(A_SDTTEST, 0, 0) < 0) { + perror("uadmin"); + return (1); + } + + sleep(1); + } + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d new file mode 100644 index 00000000..0523de09 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Verify that argN (1..7) variables are properly remapped. + */ + +BEGIN +{ + /* Timeout after 5 seconds */ + timeout = timestamp + 5000000000; + ignore = $1; +} + +ERROR +{ + printf("sdt:::test failed.\n"); + exit(1); +} + +sdt:::test +/arg0 != 1 || arg1 != 2 || arg2 != 3 || arg3 != 4 || arg4 != 5 || arg5 != 6 || + arg6 != 7/ +{ + printf("sdt arg mismatch\n\n"); + printf("args are : %d, %d, %d, %d, %d, %d, %d\n", arg0, arg1, arg2, + arg3, arg4, arg5, arg6); + printf("should be : 1, 2, 3, 4, 5, 6, 7\n"); + exit(1); +} + +sdt:::test +{ + exit(0); +} + +profile:::tick-1 +/timestamp > timeout/ +{ + trace("test timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_BADREF.SizeofAssoc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_BADREF.SizeofAssoc.d new file mode 100644 index 00000000..9ace4197 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_BADREF.SizeofAssoc.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: sizeof returns the size in bytes of any D expression or data + * type. For an associative array, the D compiler should throw an error since + * an associative array does not have a fixed size. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + */ +#pragma D option quiet + +BEGIN +{ + assoc_array[0] = 010; + assoc_array[1] = 100; + assoc_array[2] = 210; + + printf("sizeof (assoc_array): %d\n", sizeof (assoc_array)); + printf("sizeof (assoc_array[0]): %d\n", sizeof (assoc_array[0])); + printf("sizeof (assoc_array[1]): %d\n", sizeof (assoc_array[1])); + printf("sizeof (assoc_array[2]): %d\n", sizeof (assoc_array[2])); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d new file mode 100644 index 00000000..f2dcdfab --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_IDENT_UNDEF.UnknownSymbol.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: The D compiler throws a D_IDENT_UNDEF error when sizeof is passed + * an unknown symbol. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + */ +#pragma D option quiet + +BEGIN +{ + printf("sizeof (`): %d\n", sizeof (`)); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.d new file mode 100644 index 00000000..43c493a5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * sizeof() should handle invalid types + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + */ + +BEGIN +{ + trace(sizeof (void)); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_SYNTAX.SizeofBadType.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_SYNTAX.SizeofBadType.d new file mode 100644 index 00000000..85519e6d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/err.D_SYNTAX.SizeofBadType.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: sizeof returns the size in bytes of any D expression or data + * type. When an operator or non-symbol is passed as an argument to sizeof + * operator, the D_SYNTAX error is thrown by the compiler. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + */ +#pragma D option quiet + +BEGIN +{ + printf("sizeof (*): %d\n", sizeof (*)); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofArray.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofArray.d new file mode 100644 index 00000000..8843728c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofArray.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: sizeof returns the size in bytes of any D expression or data + * type. For a simpler array, the sizeof on the array variable itself gives + * the sum total of memory allocated to the array in bytes. With individual + * members of the array it gives their respective sizes. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + */ +#pragma D option quiet + +int array[5]; + +BEGIN +{ + array[0] = 010; + array[1] = 100; + array[2] = 210; + + printf("sizeof (array): %d\n", sizeof (array)); + printf("sizeof (array[0]): %d\n", sizeof (array[0])); + printf("sizeof (array[1]): %d\n", sizeof (array[1])); + printf("sizeof (array[2]): %d\n", sizeof (array[2])); + + exit(0); +} + +END +/(20 != sizeof (array)) || (4 != sizeof (array[0])) || (4 != sizeof (array[1])) + || (4 != sizeof (array[2]))/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofDataTypes.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofDataTypes.d new file mode 100644 index 00000000..fe558e8e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofDataTypes.d @@ -0,0 +1,122 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: sizeof returns the size in bytes of any D expression or data + * type. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + */ +#pragma D option quiet + +char new_char; +short new_short; +int new_int; +long new_long; +long long new_long_long; +int8_t new_int8; +int16_t new_int16; +int32_t new_int32; +int64_t new_int64; +intptr_t new_intptr; +uint8_t new_uint8; +uint16_t new_uint16; +uint32_t new_uint32; +uint64_t new_uint64; +uintptr_t new_uintptr; + +/* +float new_float; +double new_double; +long double new_long_double; + +string new_string; +*/ + +struct record { + char ch; + int in; +} new_struct; + +struct { + char ch; + int in; +} anon_struct; + +union record { + char ch; + int in; +} new_union; + +union { + char ch; + int in; +} anon_union; + +enum colors { + RED, + GREEN, + BLUE +} new_enum; + + +int *pointer; + +BEGIN +{ + printf("sizeof (new_char): %d\n", sizeof (new_char)); + printf("sizeof (new_short): %d\n", sizeof (new_short)); + printf("sizeof (new_int): %d\n", sizeof (new_int)); + printf("sizeof (new_long): %d\n", sizeof (new_long)); + printf("sizeof (new_long_long): %d\n", sizeof (new_long_long)); + printf("sizeof (new_int8): %d\n", sizeof (new_int8)); + printf("sizeof (new_int16): %d\n", sizeof (new_int16)); + printf("sizeof (new_int32): %d\n", sizeof (new_int32)); + printf("sizeof (new_int64): %d\n", sizeof (new_int64)); + printf("sizeof (pointer): %d\n", sizeof (pointer)); + printf("sizeof (intptr_t): %d\n", sizeof (intptr_t)); + printf("sizeof (new_struct): %d\n", sizeof (new_struct)); + printf("sizeof (anon_struct): %d\n", sizeof (anon_struct)); + printf("sizeof (new_union): %d\n", sizeof (new_union)); + printf("sizeof (anon_union): %d\n", sizeof (anon_union)); + printf("sizeof (new_enum): %d\n", sizeof (new_enum)); + exit(0); +} + +END +/(1 != sizeof (new_char)) || (2 != sizeof (new_short)) || + (4 != sizeof (new_int)) || + ((4 != sizeof (new_long)) && (8 != sizeof (new_long))) || + (8 != sizeof (new_long_long)) || + (1 != sizeof (new_int8)) || (2 != sizeof (new_int16)) || + (4 != sizeof (new_int32)) || (8 != sizeof (new_int64)) || + (sizeof (pointer) != sizeof (new_intptr)) || (8 != sizeof (new_struct)) || + (4 != sizeof (new_union)) || (4 != sizeof (new_enum))/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofExpression.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofExpression.d new file mode 100644 index 00000000..0bb7f686 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofExpression.d @@ -0,0 +1,64 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the use of sizeof with expressions. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + */ + +#pragma D option quiet + +BEGIN +{ + printf("sizeof ('c') : %d\n", sizeof ('c')); + printf("sizeof (10 * 'c') : %d\n", sizeof (10 * 'c')); + printf("sizeof (100 + 12345) : %d\n", sizeof (100 + 12345)); + printf("sizeof (1234567890) : %d\n", sizeof (1234567890)); + + printf("sizeof (1234512345 * 1234512345 * 12345678 * 1ULL) : %d\n", + sizeof (1234512345 * 1234512345 * 12345678 * 1ULL)); + printf("sizeof (-129) : %d\n", sizeof (-129)); + printf("sizeof (0x67890/0x77000) : %d\n", sizeof (0x67890/0x77000)); + + printf("sizeof (3 > 2 ? 3 : 2) : %d\n", sizeof (3 > 2 ? 3 : 2)); + + exit(0); +} + +END +/(4 != sizeof ('c')) || (4 != sizeof (10 * 'c')) || + (4 != sizeof (100 + 12345)) || (4 != sizeof (1234567890)) || + (8 != sizeof (1234512345 * 1234512345 * 12345678 * 1ULL)) || + (4 != sizeof (-129)) || (4 != sizeof (0x67890/0x77000)) || + (4 != sizeof (3 > 2 ? 3 : 2))/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofNULL.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofNULL.d new file mode 100644 index 00000000..4bd8a484 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofNULL.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: The size of the inbuilt variable NULL is the same as that of an + * integer. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + */ +#pragma D option quiet + +BEGIN +{ + printf("sizeof (NULL): %d\n", sizeof (NULL)); + exit(0); +} + +END +/4 != sizeof (NULL)/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d new file mode 100644 index 00000000..51f72505 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: sizeof returns the size in bytes of any D expression or data + * type. When a raw string is passed to the sizeof operator, the compiler + * throws a D_SYNTAX error. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + */ +#pragma D option quiet + +BEGIN +{ + printf("sizeof \"hi\": %d\n", sizeof ("hi")); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d.out new file mode 100644 index 00000000..3fe02aaf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofStrConst.d.out @@ -0,0 +1,2 @@ +sizeof "hi": 3 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d new file mode 100644 index 00000000..0be9e457 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: sizeof returns the size in bytes of any D expression or data + * type. For sizeof strings the D compiler throws D_SIZEOF_TYPE. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + */ +#pragma D option quiet +#pragma D option strsize=256 + +BEGIN +{ + assoc_array["hello"] = "hello"; + assoc_array["hi"] = "hi"; + assoc_array["hello"] = "hello, world"; + + printf("sizeof (assoc_array[\"hello\"]): %d\n", + sizeof (assoc_array["hello"])); + printf("sizeof (assoc_array[\"hi\"]): %d\n", + sizeof (assoc_array["hi"])); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d.out new file mode 100644 index 00000000..9c43b1e3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString1.d.out @@ -0,0 +1,3 @@ +sizeof (assoc_array["hello"]): 256 +sizeof (assoc_array["hi"]): 256 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d new file mode 100644 index 00000000..f12a6003 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: sizeof returns the size in bytes of any D expression or data + * type. For a string variable, the D compiler throws a D_SIZEOF_TYPE. + * + * SECTION: Structs and Unions/Member Sizes and Offsets + * + */ +#pragma D option quiet +#pragma D option strsize=256 + +BEGIN +{ + var = "hello"; + printf("sizeof (var): %d\n", sizeof (var)); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d.out new file mode 100644 index 00000000..fdeca699 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sizeof/tst.SizeofString2.d.out @@ -0,0 +1,2 @@ +sizeof (var): 256 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/bug.1001148.SpecSizeVariations.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/bug.1001148.SpecSizeVariations.d new file mode 100644 index 00000000..318a2d05 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/bug.1001148.SpecSizeVariations.d @@ -0,0 +1,87 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify the behavior of variations in specsize. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/specsize + * + * BUG: 1001148 + * + * NOTES: This code has four different behaviors. + * 1. 0 < specsize < 8 + * 2. 8 <= specsize <= 39 || 0 == specsize + * 3. 40 <= specsize + * 4. 0 > specsize + * + */ + +#pragma D option quiet +#pragma D option specsize=10 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + printf("Lots of data\n"); + printf("Has to be crammed into this buffer\n"); + printf("Until it overflows\n"); + printf("And causes flops\n"); + self->speculateFlag++; + +} + +BEGIN +/1 <= self->speculateFlag/ +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/1 <= self->commitFlag/ +{ + printf("Statement was executed\n"); + exit(0); +} + +BEGIN +/1 > self->commitFlag/ +{ + printf("Statement wasn't executed\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d new file mode 100644 index 00000000..e97506e1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d @@ -0,0 +1,88 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify the behavior of variations in bufsize. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/bufsize + * + * NOTES: This test behaves differently depending on the values + * assigned to bufsize. + * 1. 0 > bufsize. + * 2. 0 == bufsize. + * 3. 0 < bufsize <= 7 + * 4. 8 <= bufsize <= 31 + * 5. 32 <= bufsize <= 47 + * 6. 48 <= bufsize <= 71 + * 7. 72 <= bufsize + */ + +#pragma D option quiet +#pragma D option bufsize=41 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + printf("Lots of data\n"); + printf("Has to be crammed into this buffer\n"); + printf("Until it overflows\n"); + printf("And causes flops\n"); + self->speculateFlag++; + +} + +BEGIN +/1 <= self->speculateFlag/ +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/1 <= self->commitFlag/ +{ + printf("Statement was executed\n"); + exit(0); +} + +BEGIN +/1 > self->commitFlag/ +{ + printf("Statement wasn't executed\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d new file mode 100644 index 00000000..f660e9a8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d @@ -0,0 +1,88 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify the behavior of variations in bufsize. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/bufsize + * + * NOTES: This test behaves differently depending on the values + * assigned to bufsize. + * 1. 0 > bufsize. + * 2. 0 == bufsize. + * 3. 0 < bufsize <= 7 + * 4. 8 <= bufsize <= 31 + * 5. 32 <= bufsize <= 47 + * 6. 48 <= bufsize <= 71 + * 7. 72 <= bufsize + */ + +#pragma D option quiet +#pragma D option bufsize=4 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + printf("Lots of data\n"); + printf("Has to be crammed into this buffer\n"); + printf("Until it overflows\n"); + printf("And causes flops\n"); + self->speculateFlag++; + +} + +BEGIN +/1 <= self->speculateFlag/ +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/1 <= self->commitFlag/ +{ + printf("Statement was executed\n"); + exit(0); +} + +BEGIN +/1 > self->commitFlag/ +{ + printf("Statement wasn't executed\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d new file mode 100644 index 00000000..958ce686 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d @@ -0,0 +1,69 @@ +#!/usr/sbin/dtrace -ws +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Destructive actions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * SECTION: dtrace(1M) Utility/ -w option + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +syscall::: +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + breakpoint(); + i++; +} + +syscall::: +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d new file mode 100644 index 00000000..ebb3b016 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d @@ -0,0 +1,69 @@ +#!/usr/sbin/dtrace -ws +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Destructive actions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * SECTION: dtrace (1M) Utility/ -w option + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + chill(10); + i++; +} + +profile:::tick-1sec +/1 == 1/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d new file mode 100644 index 00000000..9c14bb5a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d @@ -0,0 +1,69 @@ +#!/usr/sbin/dtrace -ws +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Destructive actions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * SECTION: dtrace(1M) Utility/ -w option + * + */ +#pragma D option quiet + +char a[2]; +void *buf; +uintptr_t addr; +size_t nbytes; +BEGIN +{ + self->i = 0; + addr = (uintptr_t) &a[0]; + nbytes = 10; + var = speculation(); +} + +BEGIN +{ + speculate(var); + printf("Speculation ID: %d", var); + self->i++; + copyout(buf, addr, nbytes); +} + +BEGIN +{ + printf("This test should not have compiled\n"); + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d new file mode 100644 index 00000000..695eb8c8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d @@ -0,0 +1,68 @@ +#!/usr/sbin/dtrace -ws +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Destructive actions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * SECTION: dtrace(1M) Utility/ -w option + */ +#pragma D option quiet + +string str; +char a[2]; +uintptr_t addr; +size_t maxlen; +BEGIN +{ + self->i = 0; + addr = (uintptr_t) &a[0]; + maxlen = 10; + var = speculation(); +} + +BEGIN +{ + speculate(var); + printf("Speculation ID: %d", var); + self->i++; + copyoutstr(str, addr, maxlen); +} + +BEGIN +{ + printf("This test should not have compiled\n"); + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d new file mode 100644 index 00000000..dcba0801 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d @@ -0,0 +1,69 @@ +#!/usr/sbin/dtrace -ws +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Destructive actions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * SECTION: dtrace(1M) Utility/ -w option + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + panic(); + i++; +} + +profile:::tick-1sec +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d new file mode 100644 index 00000000..e4fe06b6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d @@ -0,0 +1,68 @@ +#!/usr/sbin/dtrace -ws +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Destructive actions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * SECTION: dtrace(1M) Utility/ -w option + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + raise(9); + i++; +} + +profile:::tick-1sec +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d new file mode 100644 index 00000000..468e8f20 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d @@ -0,0 +1,68 @@ +#!/usr/sbin/dtrace -ws +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Destructive actions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * SECTION: dtrace(1M) Utility/ -w option + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + stop(); + i++; +} + +profile:::tick-1sec +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_COMM.AggAftCommit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_COMM.AggAftCommit.d new file mode 100644 index 00000000..89a15c03 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_COMM.AggAftCommit.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * A clause cannot contain a commit() followed by an aggregating action. + * + * SECTION: Speculative Tracing/Committing a Speculation; + */ + +BEGIN +{ + commit(1); + @a["foo"] = count(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithAvg.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithAvg.d new file mode 100644 index 00000000..a7635434 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithAvg.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Aggregating actions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + @avrg["speculate"] = avg(i); + i++; +} + +profile:::tick-1sec +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithCount.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithCount.d new file mode 100644 index 00000000..57d0d03c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithCount.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Aggregating functions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + @counts["speculate"] = count(); + i++; +} + +profile:::tick-1sec +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithLquant.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithLquant.d new file mode 100644 index 00000000..90a899d2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithLquant.d @@ -0,0 +1,72 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Aggregating functions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +syscall:::entry +{ + self->ts = timestamp; +} + +syscall:::return +/self->ts/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + @Lqauntus[execname] = lquantize(timestamp - self->ts, 0, 100, 1); + i++; +} + +syscall::: +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMax.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMax.d new file mode 100644 index 00000000..a10fff1b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMax.d @@ -0,0 +1,62 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Aggregating functions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + @Maximus["speculate"] = max(i); + i++; +} + +profile:::tick-1sec +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMin.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMin.d new file mode 100644 index 00000000..4ad8dee3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMin.d @@ -0,0 +1,62 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Aggregating functions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + @Minimus["speculate"] = min(i); + i++; +} + +profile:::tick-1sec +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d new file mode 100644 index 00000000..38e816ec --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Aggregating functions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +syscall:::entry +{ + self->ts = timestamp; +} + +syscall:::return +/self->ts/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + @Qauntus[execname] = quantize(timestamp - self->ts); + i++; +} + +syscall::: +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d new file mode 100644 index 00000000..22953c2a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d @@ -0,0 +1,65 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Aggregating actions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + @sdev["speculate"] = stddev(i); + i++; +} + +profile:::tick-1sec +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithSum.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithSum.d new file mode 100644 index 00000000..620a0768 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithSum.d @@ -0,0 +1,62 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Aggregating functions may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile:::tick-1sec +/i < 1/ +{ + var = speculation(); + speculate(var); + printf("Speculation ID: %d", var); + @sums["speculate"] = sum(i); + i++; +} + +profile:::tick-1sec +/1 == i/ +{ + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.CommitAftCommit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.CommitAftCommit.d new file mode 100644 index 00000000..ebc316a9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.CommitAftCommit.d @@ -0,0 +1,82 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * A clause cannot contain multiple commit() calls to same buffer. + * + * SECTION: Speculative Tracing/Committing a Speculation; + * Options and Tunables/cleanrate + */ +#pragma D option quiet +#pragma D option cleanrate=3000hz + +BEGIN +{ + self->i = 0; + var1 = 0; +} + +profile:::tick-1sec +/!var1/ +{ + var1 = speculation(); + printf("Speculation ID: %d\n", var1); +} + +profile:::tick-1sec +/var1/ +{ + speculate(var1); + printf("Speculating on id: %d\n", var1); + self->i++; +} + +profile:::tick-1sec +/(!self->i)/ +{ +} + +profile:::tick-1sec +/(self->i)/ +{ + commit(var1); + commit(var1); + exit(0); +} + +END +{ + printf("Succesfully commited both buffers"); + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.DisjointCommit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.DisjointCommit.d new file mode 100644 index 00000000..e482d07e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.DisjointCommit.d @@ -0,0 +1,102 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * A clause cannot contain multiple commit() calls to disjoint buffers. + * + * SECTION: Speculative Tracing/Committing a Speculation; + * Options and Tunables/cleanrate + */ +#pragma D option quiet +#pragma D option cleanrate=3000hz + +BEGIN +{ + self->i = 0; + self->j = 0; + self->commit = 0; + var1 = 0; + var2 = 0; +} + +BEGIN +{ + var1 = speculation(); + printf("Speculation ID: %d\n", var1); +} + +BEGIN +{ + var2 = speculation(); + printf("Speculation ID: %d\n", var2); +} + +BEGIN +/var1/ +{ + speculate(var1); + printf("Speculating on id: %d\n", var1); + self->i++; +} + +BEGIN +/var2/ +{ + speculate(var2); + printf("Speculating on id: %d", var2); + self->j++; + +} + +BEGIN +/(self->i) && (self->j)/ +{ + commit(var1); + commit(var2); + self->commit++; +} + +BEGIN +/self->commit/ +{ + printf("Succesfully commited both buffers"); + exit(0); +} + +BEGIN +/!self->commit/ +{ + printf("Couldnt commit both buffers"); + exit(1); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_DREC.CommitAftDataRec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_DREC.CommitAftDataRec.d new file mode 100644 index 00000000..268b68fb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_DREC.CommitAftDataRec.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Commit may not follow data recording actions. + * + * SECTION: Speculative Tracing/Committing a Speculation + */ + +#pragma D option quiet + +BEGIN +{ + self->speculateFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); + exit(0); +} + +END +{ + printf("This test shouldnt have compiled\n"); + commit(self->spec); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.DataRecAftCommit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.DataRecAftCommit.d new file mode 100644 index 00000000..75560d83 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.DataRecAftCommit.d @@ -0,0 +1,73 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Data recording actions may not follow commit. + * + * SECTION: Speculative Tracing/Committing a Speculation; + * Options and Tunables/cleanrate + * + */ +#pragma D option quiet +#pragma D option cleanrate=2000hz + +BEGIN +{ + self->speculateFlag = 0; +} + +syscall:::entry +{ + self->spec = speculation(); +} + +syscall::: +/self->spec/ +{ + speculate(self->spec); + printf("Called speculate with id: %d\n", self->spec); + self->speculateFlag++; +} + +syscall::: +/(self->spec) && (self->speculateFlag)/ +{ + commit(self->spec); + printf("Data recording after commit\n"); +} + +END +{ + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.ExitAfterCommit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.ExitAfterCommit.d new file mode 100644 index 00000000..c190740b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.ExitAfterCommit.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Exit after commit should throw a D_DREC_COMM. + * + * SECTION: Speculative Tracing/Committing a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + self->i = 0; + self->spec = speculation(); +} + +BEGIN +/self->spec/ +{ + speculate(self->spec); + self->i++; + printf("self->i: %d\n", self->i); +} + +BEGIN +/self->i/ +{ + commit(self->spec); + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_EXIT_SPEC.ExitAftSpec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_EXIT_SPEC.ExitAftSpec.d new file mode 100644 index 00000000..70964f91 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_EXIT_SPEC.ExitAftSpec.d @@ -0,0 +1,70 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Exit action may never be speculative. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet +BEGIN +{ + i = 0; +} + +syscall:::entry +{ + self->spec = speculation(); +} + +syscall::: +/self->spec/ +{ + speculate(self->spec); + i++; + printf("i: %d\n", i); + exit(0); +} + +syscall::: +/1 == i/ +{ + exit(0); +} + +END +{ + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_MALFORM.NspecExpr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_MALFORM.NspecExpr.d new file mode 100644 index 00000000..91168e30 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_MALFORM.NspecExpr.d @@ -0,0 +1,77 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Using an expression in the pragma for nspec throws a D_PRAGMA_MALFORM + * error. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/nspec + * + */ + +#pragma D option quiet +#pragma D option cleanrate=3000hz +#pragma D option nspec=24 * 44 + +BEGIN +{ + var1 = 0; + var2 = 0; + var3 = 0; +} + +BEGIN +{ + var1 = speculation(); + printf("Speculation ID: %d\n", var1); + var2 = speculation(); + printf("Speculation ID: %d\n", var2); + var3 = speculation(); + printf("Speculation ID: %d\n", var3); +} + +BEGIN +/var1 && var2 && (!var3)/ +{ + printf("Succesfully got two speculative buffers"); + exit(0); +} + +BEGIN +/(!var1) || (!var2) || var3/ +{ + printf("Test failed"); + exit(1); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.HugeNspecValue.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.HugeNspecValue.d new file mode 100644 index 00000000..d13132ef --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.HugeNspecValue.d @@ -0,0 +1,76 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Setting the nspec option to a huge integer throws a D_PRAGMA_OPTSET error. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/nspec + * + */ + +#pragma D option quiet +#pragma D option cleanrate=3000hz +#pragma D option nspec=245566729809009887663 + +BEGIN +{ + var1 = 0; + var2 = 0; + var3 = 0; +} + +BEGIN +{ + var1 = speculation(); + printf("Speculation ID: %d\n", var1); + var2 = speculation(); + printf("Speculation ID: %d\n", var2); + var3 = speculation(); + printf("Speculation ID: %d\n", var3); +} + +BEGIN +/var1 && var2 && (!var3)/ +{ + printf("Succesfully got two speculative buffers"); + exit(0); +} + +BEGIN +/(!var1) || (!var2) || var3/ +{ + printf("Test failed"); + exit(1); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.InvalidSpecSize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.InvalidSpecSize.d new file mode 100644 index 00000000..d957f678 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.InvalidSpecSize.d @@ -0,0 +1,53 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Setting the specsize option to an illegal value throws the compiler error + * D_PRAGMA_OPTSET. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/specsize + */ + +#pragma D option quiet +#pragma D option specsize=1b + +BEGIN +{ + self->speculateFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); + exit(0); +} + +END +{ + printf("This shouldnt have compiled\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d new file mode 100644 index 00000000..c5fa9f50 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" +/* + * ASSERTION: + * Verify the behavior of speculations with changes in specsize. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/specsize + * + */ + +#pragma D option quiet +#pragma D option specsize=-40 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + printf("Lots of data\n"); + printf("Has to be crammed into this buffer\n"); + printf("Until it overflows\n"); + printf("And causes flops\n"); + self->speculateFlag++; + +} + +BEGIN +/1 <= self->speculateFlag/ +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/1 <= self->commitFlag/ +{ + printf("Statement was executed\n"); + exit(0); +} + +BEGIN +/1 > self->commitFlag/ +{ + printf("Statement wasn't executed\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PROTO_LEN.SpecNoId.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PROTO_LEN.SpecNoId.d new file mode 100644 index 00000000..65d53ba6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PROTO_LEN.SpecNoId.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * An identifier returned from speculation must be passed to the speculate() + * function. + * + * SECTION: Speculative Tracing/Creating a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + var = speculation(); + printf("Speculation ID: %d", var); + self->i = 0; +} + +profile:::tick-1sec +{ + speculate(); + self->i++; +} + +profile:::tick-1sec +/1 <= self->i/ +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_COMM.SpecAftCommit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_COMM.SpecAftCommit.d new file mode 100644 index 00000000..ec4b22b8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_COMM.SpecAftCommit.d @@ -0,0 +1,72 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * A clause cannot contain a speculate after a commit. + * + * SECTION: Speculative Tracing/Committing a Speculation; + * Options and Tunables/cleanrate + * + */ +#pragma D option quiet +#pragma D option cleanrate=3000hz + +BEGIN +{ + self->i = 0; + var1 = 0; + var1 = speculation(); + printf("Speculation ID: %d\n", var1); +} + +profile:::tick-1sec +/var1/ +{ + speculate(var1); + printf("Speculating on id: %d\n", var1); + self->i++; +} + +profile:::tick-1sec +/(!self->i)/ +{ +} + +profile:::tick-1sec +/(self->i)/ +{ + commit(var1); + speculate(var1); + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_DREC.SpecAftDataRec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_DREC.SpecAftDataRec.d new file mode 100644 index 00000000..80f1fdd2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_DREC.SpecAftDataRec.d @@ -0,0 +1,70 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * speculate() may not follow data recording actions. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet +BEGIN +{ + i = 0; +} + +syscall:::entry +{ + self->spec = speculation(); +} + +syscall::: +/self->spec/ +{ + printf("Entering syscall clause\n"); + speculate(self->spec); + i++; + printf("i: %d\n", i); +} + +syscall::: +/1 == i/ +{ + exit(0); +} + +END +{ + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_SPEC.SpecAftSpec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_SPEC.SpecAftSpec.d new file mode 100644 index 00000000..67af53b9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_SPEC.SpecAftSpec.d @@ -0,0 +1,66 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * A clause can contain only one speculate() call. + * + * SECTION: Speculative Tracing/Using a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + self->i = 0; + var1 = speculation(); + printf("Speculation ID: %d\n", var1); + var2 = speculation(); + printf("Speculation ID: %d\n", var2); +} + +profile:::tick-1sec +{ + speculate(var1); + printf("Speculating on id: %d\n", var1); + speculate(var2); + printf("Speculating on id: %d", var2); + self->i++; + +} + +profile:::tick-1sec +/1 > self->i/ +{ + exit(0); +} + +END +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeBufSize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeBufSize.d new file mode 100644 index 00000000..7d2f4b36 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeBufSize.d @@ -0,0 +1,88 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify the behavior of variations in bufsize. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/bufsize + * + * NOTES: This test behaves differently depending on the values + * assigned to bufsize. + * 1. 0 > bufsize. + * 2. 0 == bufsize. + * 3. 0 < bufsize <= 7 + * 4. 8 <= bufsize <= 31 + * 5. 32 <= bufsize <= 47 + * 6. 48 <= bufsize <= 71 + * 7. 72 <= bufsize + */ + +#pragma D option quiet +#pragma D option bufsize=-72 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + printf("Lots of data\n"); + printf("Has to be crammed into this buffer\n"); + printf("Until it overflows\n"); + printf("And causes flops\n"); + self->speculateFlag++; + +} + +BEGIN +/1 <= self->speculateFlag/ +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/1 <= self->commitFlag/ +{ + printf("Statement was executed\n"); + exit(0); +} + +BEGIN +/1 > self->commitFlag/ +{ + printf("Statement wasn't executed\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeNspec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeNspec.d new file mode 100644 index 00000000..9e1d063d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeNspec.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Using a negative value for nspec throws a compiler error. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/nspec + */ + +#pragma D option quiet +#pragma D option nspec=-72 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); + printf("This test shouldnt have compiled\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeSpecSize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeSpecSize.d new file mode 100644 index 00000000..233257a4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeSpecSize.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Setting the specsize to a negative number should throw a compiler error. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/specsize + * + * NOTES: Why dont we have an error tag for this error? + */ + +#pragma D option quiet +#pragma D option specsize=-10 + +BEGIN +{ + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations1.d new file mode 100644 index 00000000..c42029c3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations1.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" +/* + * ASSERTION: + * Verify the behavior of variations in specsize. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/specsize + * + */ + +#pragma D option quiet +#pragma D option specsize=2 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + printf("Lots of data\n"); + printf("Has to be crammed into this buffer\n"); + printf("Until it overflows\n"); + printf("And causes flops\n"); + self->speculateFlag++; + +} + +BEGIN +/1 <= self->speculateFlag/ +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/1 <= self->commitFlag/ +{ + printf("Statement was executed\n"); + exit(0); +} + +BEGIN +/1 > self->commitFlag/ +{ + printf("Statement wasn't executed\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations2.d new file mode 100644 index 00000000..8a572807 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations2.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" +/* + * ASSERTION: + * Verify the behavior of variations in specsize. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/specsize + * + */ + +#pragma D option quiet +#pragma D option specsize=0 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + printf("Lots of data\n"); + printf("Has to be crammed into this buffer\n"); + printf("Until it overflows\n"); + printf("And causes flops\n"); + self->speculateFlag++; + +} + +BEGIN +/1 <= self->speculateFlag/ +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/1 <= self->commitFlag/ +{ + printf("Statement was executed\n"); + exit(0); +} + +BEGIN +/1 > self->commitFlag/ +{ + printf("Statement wasn't executed\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.CommitAfterDiscard.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.CommitAfterDiscard.d new file mode 100644 index 00000000..a874ab5b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.CommitAfterDiscard.d @@ -0,0 +1,86 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Call to commit() on a buffer after it has been discarded is silently + * ignored. + * + * SECTION: Speculative Tracing/Committing a Speculation; + * Options and Tunables/cleanrate + * + */ +#pragma D option quiet +#pragma D option cleanrate=3000hz + +BEGIN +{ + self->i = 0; + self->commit = 0; + self->discard = 0; + var1 = speculation(); + printf("Speculation ID: %d\n", var1); +} + +BEGIN +/var1/ +{ + speculate(var1); + printf("This statement and the following are speculative!!\n"); + printf("Speculating on id: %d\n", var1); + self->i++; +} + +BEGIN +/(self->i)/ +{ + discard(var1); + self->discard++; + commit(var1); + self->commit++; +} + +BEGIN +/self->commit/ +{ + printf("Commited a discarded buffer\n"); + exit(0); +} + + +BEGIN +/!self->commit/ +{ + printf("Couldnt commit a discarded buffer\n"); + exit(1); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.CommitWithZero.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.CommitWithZero.d new file mode 100644 index 00000000..647552fb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.CommitWithZero.d @@ -0,0 +1,66 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: An Id of zero though invalid may be passed to speculate(), + * commit() and discard() without any ill effects. + * + * SECTION: Speculative Tracing/Creating a Speculation; + * Options and Tunables/cleanrate + */ +#pragma D option quiet +#pragma D option cleanrate=4000hz + +BEGIN +{ + self->commitFlag = 0; + self->var1 = speculation(); + printf("Speculative buffer ID: %d\n", self->var1); + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/0 < self->commitFlag/ +{ + printf("commit(), self->commitFlag = %d\n", self->commitFlag); + exit(0); +} + +BEGIN +/0 == self->commitFlag/ +{ + printf("commit(), self->commitFlag = %d\n", self->commitFlag); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DataRecAftDiscard.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DataRecAftDiscard.d new file mode 100644 index 00000000..03ae1b5f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DataRecAftDiscard.d @@ -0,0 +1,77 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Data recording actions may follow discard. + * + * SECTION: Speculative Tracing/Discarding a Speculation; + * Options and Tunables/cleanrate + */ +#pragma D option quiet +#pragma D option cleanrate=2000hz + +BEGIN +{ + self->speculateFlag = 0; + self->discardFlag = 0; + self->spec = speculation(); +} + +BEGIN +/self->spec/ +{ + speculate(self->spec); + printf("Called speculate with id: %d\n", self->spec); + self->speculateFlag++; +} + +BEGIN +/(self->spec) && (self->speculateFlag)/ +{ + discard(self->spec); + self->discardFlag++; + printf("Data recording after discard\n"); +} + +BEGIN +/self->discardFlag/ +{ + exit(0); +} + +BEGIN +/!self->discardFlag/ +{ + exit(1); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftCommit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftCommit.d new file mode 100644 index 00000000..25fcfc54 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftCommit.d @@ -0,0 +1,85 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Can call discard() on a buffer after it has been commited. + * + * SECTION: Speculative Tracing/Discarding a Speculation; + * Options and Tunables/cleanrate + * + */ +#pragma D option quiet +#pragma D option cleanrate=3000hz + +BEGIN +{ + self->i = 0; + self->commit = 0; + self->discard = 0; + var1 = speculation(); + printf("Speculation ID: %d\n", var1); +} + +BEGIN +/var1/ +{ + speculate(var1); + printf("This statement and the following are speculative!!\n"); + printf("Speculating on id: %d\n", var1); + self->i++; +} + +BEGIN +/(self->i)/ +{ + commit(var1); + self->commit++; + discard(var1); + self->discard++; +} + +BEGIN +/self->discard/ +{ + printf("Discarded a commited buffer\n"); + exit(0); +} + + +BEGIN +/!self->discard/ +{ + printf("Couldnt discard a commited buffer\n"); + exit(1); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDataRec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDataRec.d new file mode 100644 index 00000000..d5c573f9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDataRec.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Discard may not follow data recording actions. + * + * SECTION: Speculative Tracing/Discarding a Speculation + * + */ + +#pragma D option quiet + +BEGIN +{ + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + printf("Can have data recording before discarding\n"); + discard(self->spec); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDiscard.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDiscard.d new file mode 100644 index 00000000..8c95cee7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDiscard.d @@ -0,0 +1,85 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Can call discard on an already discarded buffer. + * + * SECTION: Speculative Tracing/Discarding a Speculation; + * Options and Tunables/cleanrate + * + */ +#pragma D option quiet +#pragma D option cleanrate=3000hz + +BEGIN +{ + self->i = 0; + self->discard1 = 0; + self->discard2 = 0; + var1 = speculation(); + printf("Speculation ID: %d\n", var1); +} + +BEGIN +/var1/ +{ + speculate(var1); + printf("This statement and the following are speculative!!\n"); + printf("Speculating on id: %d\n", var1); + self->i++; +} + +BEGIN +/(self->i)/ +{ + discard(var1); + self->discard1++; + discard(var1); + self->discard2++; +} + +BEGIN +/(self->discard2) && (self->discard1)/ +{ + printf("Discarded a discarded buffer\n"); + exit(0); +} + + +BEGIN +/(!self->discard2) || (!self->discard1)/ +{ + printf("Couldnt discard a discarded buffer\n"); + exit(1); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardWithZero.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardWithZero.d new file mode 100644 index 00000000..1a785613 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardWithZero.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: An Id of zero though invalid may be passed to speculate(), + * commit() and discard() without any ill effects. + * + * SECTION: Speculative Tracing/Creating a Speculation; + * Options and Tunables/cleanrate + */ +#pragma D option quiet +#pragma D option cleanrate=4000hz + +BEGIN +{ + self->discardFlag = 0; + self->var1 = speculation(); + printf("Speculative buffer ID: %d\n", self->var1); + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +/0 == self->spec/ +{ + discard(self->spec); + self->discardFlag++; +} + +BEGIN +/0 < self->discardFlag/ +{ + printf("discard(), self->discardFlag = %d\n", self->discardFlag); + exit(0); +} + +BEGIN +/0 == self->discardFlag/ +{ + printf("discard(), self->discardFlag = %d\n", self->discardFlag); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.ExitAftDiscard.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.ExitAftDiscard.d new file mode 100644 index 00000000..f5bcd662 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.ExitAftDiscard.d @@ -0,0 +1,56 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Using exit after discard should work fine. + * + * SECTION: Speculative Tracing/Discarding a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + self->i = 0; + self->spec = speculation(); +} + +BEGIN +/self->spec/ +{ + speculate(self->spec); + self->i++; + printf("self->i: %d\n", self->i); +} + +BEGIN +/self->i/ +{ + discard(self->spec); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d new file mode 100644 index 00000000..8fe3a19d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d @@ -0,0 +1,64 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * The number of speculative buffers defaults to one. If no speculative buffer + * is available when speculation is called, an ID of zero is returned. + * + * SECTION: Speculative Tracing/Creating a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +syscall::open:entry +/i < 2/ +{ + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); + i++; +} + +syscall::: +/(2 == i) && (0 == self->spec)/ +{ + printf("i: %d\tself->spec: %d", i, self->spec); + exit(0); +} + +syscall::: +/(2 == i) && (0 != self->spec)/ +{ + printf("i: %d\tself->spec: %d", i, self->spec); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations1.d new file mode 100644 index 00000000..17df6b54 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations1.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" +/* + * ASSERTION: + * Verify the behavior of speculations with changes in specsize. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/specsize + * + */ + +#pragma D option quiet +#pragma D option specsize=8 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + printf("Lots of data\n"); + printf("Has to be crammed into this buffer\n"); + printf("Until it overflows\n"); + printf("And causes flops\n"); + self->speculateFlag++; + +} + +BEGIN +/1 <= self->speculateFlag/ +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/1 <= self->commitFlag/ +{ + printf("Statement was executed\n"); + exit(1); +} + +BEGIN +/1 > self->commitFlag/ +{ + printf("Statement wasn't executed\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations2.d new file mode 100644 index 00000000..bcd2f2ea --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations2.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" +/* + * ASSERTION: + * Verify the behavior of speculations with changes in specsize. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/specsize + * + */ + +#pragma D option quiet +#pragma D option specsize=10 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + printf("Lots of data\n"); + printf("Has to be crammed into this buffer\n"); + printf("Until it overflows\n"); + printf("And causes flops\n"); + self->speculateFlag++; + +} + +BEGIN +/1 <= self->speculateFlag/ +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/1 <= self->commitFlag/ +{ + printf("Statement was executed\n"); + exit(1); +} + +BEGIN +/1 > self->commitFlag/ +{ + printf("Statement wasn't executed\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d new file mode 100644 index 00000000..6b91efd9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" +/* + * ASSERTION: + * Verify the behavior of speculations with changes in specsize. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/specsize + * + */ + +#pragma D option quiet +#pragma D option specsize=40 + +BEGIN +{ + self->speculateFlag = 0; + self->commitFlag = 0; + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + printf("Lots of data\n"); + printf("Has to be crammed into this buffer\n"); + printf("Until it overflows\n"); + printf("And causes flops\n"); + self->speculateFlag++; + +} + +BEGIN +/1 <= self->speculateFlag/ +{ + commit(self->spec); + self->commitFlag++; +} + +BEGIN +/1 <= self->commitFlag/ +{ + printf("Statement was executed\n"); + exit(0); +} + +BEGIN +/1 > self->commitFlag/ +{ + printf("Statement wasn't executed\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculateWithRandom.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculateWithRandom.d new file mode 100644 index 00000000..24f1ff4b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculateWithRandom.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * When speculate() is called with an inactive buffer number, it is + * ignored. + * + * SECTION: Speculative Tracing/Creating a Speculation + * + */ +#pragma D option quiet +BEGIN +{ + self->i = 0; +} + +BEGIN +{ + speculate(3456710); + self->i++; + printf("self->i: %d\n", self->i); + +} + +BEGIN +{ + exit(0); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationCommit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationCommit.d new file mode 100644 index 00000000..744ba676 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationCommit.d @@ -0,0 +1,75 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Test the normal behavior of speculate() and commit(). + * + * SECTION: Speculative Tracing/Committing a Speculation; + * Actions and Subroutines/speculation(); + * Options and Tunables/cleanrate + * + */ +#pragma D option quiet +#pragma D option cleanrate=2000hz + +BEGIN +{ + self->var = speculation(); + printf("Speculation ID: %d\n", self->var); + self->speculate = 0; + self->commit = 0; +} + +BEGIN +/1 > self->speculate/ +{ + speculate(self->var); + self->speculate++; + printf("Called speculate on id: %d\n", self->var); +} + +BEGIN +/1 <= self->speculate/ +{ + commit(self->var); + self->commit++; +} + +BEGIN +/(1 == self->commit)/ +{ + printf("Succesfully tested buffer commit\n"); + exit(0); +} + +BEGIN +/(0 == self->commit)/ +{ + printf("Failed to commit buffer\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationDiscard.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationDiscard.d new file mode 100644 index 00000000..4ac0e236 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationDiscard.d @@ -0,0 +1,74 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Test the normal behavior of speculate() and discard(). + * + * SECTION: Speculative Tracing/Discarding a Speculation; + * Options and Tunables/cleanrate + * + */ +#pragma D option quiet +#pragma D option cleanrate=2000hz + +BEGIN +{ + self->var = speculation(); + printf("Speculation ID: %d\n", self->var); + self->speculate = 0; + self->discard = 0; +} + +BEGIN +/1 > self->speculate/ +{ + speculate(self->var); + self->speculate++; + printf("Called speculate on id: %d\n", self->var); +} + +BEGIN +/1 <= self->speculate/ +{ + discard(self->var); + self->discard++; +} + +BEGIN +/(1 == self->discard)/ +{ + printf("Succesfully tested buffer discard\n"); + exit(0); +} + +BEGIN +/(0 == self->discard)/ +{ + printf("Failed to discard buffer\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationID.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationID.d new file mode 100644 index 00000000..b2e3678a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationID.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * The speculation() function returns a speculative identifier when a + * speculative buffer is available. + * + * SECTION: Speculative Tracing/Creating a Speculation + * + */ +#pragma D option quiet + +BEGIN +{ + var = speculation(); + printf("Speculation ID: %d", var); + exit(0); +} + +END +/0 == var/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationWithZero.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationWithZero.d new file mode 100644 index 00000000..76600dba --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationWithZero.d @@ -0,0 +1,65 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Calling speculate() with zero does not have any ill effects. + * Statement after speculate does not execute. + * + * SECTION: Speculative Tracing/Creating a Speculation + */ + +#pragma D option quiet + +BEGIN +{ + self->speculateFlag = 0; + self->spec = speculation(); + self->spec = speculation(); + printf("Speculative buffer ID: %d\n", self->spec); +} + +BEGIN +{ + speculate(self->spec); + self->speculateFlag++; +} + +BEGIN +/1 == self->speculateFlag/ +{ + printf("Statement was executed\n"); + exit(1); +} + +BEGIN +/1 != self->speculateFlag/ +{ + printf("Statement wasn't executed\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.TwoSpecBuffers.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.TwoSpecBuffers.d new file mode 100644 index 00000000..8016b200 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.TwoSpecBuffers.d @@ -0,0 +1,77 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Increasing the value of nspec to two should will increase the number of + * speculative buffers to two. + * + * SECTION: Speculative Tracing/Options and Tuning; + * Options and Tunables/nspec + * + */ + +#pragma D option quiet +#pragma D option cleanrate=3000hz +#pragma D option nspec=2 + +BEGIN +{ + var1 = 0; + var2 = 0; + var3 = 0; +} + +BEGIN +{ + var1 = speculation(); + printf("Speculation ID: %d\n", var1); + var2 = speculation(); + printf("Speculation ID: %d\n", var2); + var3 = speculation(); + printf("Speculation ID: %d\n", var3); +} + +BEGIN +/var1 && var2 && (!var3)/ +{ + printf("Succesfully got two speculative buffers"); + exit(0); +} + +BEGIN +/(!var1) || (!var2) || var3/ +{ + printf("Test failed"); + exit(1); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.negcommit.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.negcommit.d new file mode 100644 index 00000000..cf17c71e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.negcommit.d @@ -0,0 +1,37 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +BEGIN +{ + commit(-1); +} + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.negspec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.negspec.d new file mode 100644 index 00000000..72965c7d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.negspec.d @@ -0,0 +1,37 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +BEGIN +{ + speculate(-1); +} + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.zerosize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.zerosize.d new file mode 100644 index 00000000..a4b40014 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.zerosize.d @@ -0,0 +1,53 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option destructive + +BEGIN +{ + self->spec = speculation(); + speculate(self->spec); +} + +BEGIN +{ + this->one = 1; + this->two = 2; + chill(1); + speculate(self->spec); +} + +BEGIN +{ + speculate(self->spec); +} + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stability/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stability/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stability/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stability/err.D_ATTR_MIN.MinAttributes.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stability/err.D_ATTR_MIN.MinAttributes.d new file mode 100644 index 00000000..99fcede7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stability/err.D_ATTR_MIN.MinAttributes.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: If a program has a set of attributes less than the predefined + * minimum a D_ATTR_MIN is thrown + * + * SECTION: Stability/Stability Enforcement + * SECTION: Errtags/D_ATTR_MIN + * + */ + +#pragma D option quiet +#pragma D option amin=Evolving/Evolving/Common + +BEGIN +{ + trace(curthread->t_procp); + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_STACK_PROTO.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_STACK_PROTO.bad.d new file mode 100644 index 00000000..0af06e6c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_STACK_PROTO.bad.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * stack() accepts one argument + * + * SECTION: Actions and Subroutines/stack() + * + */ + + +BEGIN +{ + stack(1, 2); + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_STACK_SIZE.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_STACK_SIZE.d new file mode 100644 index 00000000..8344e5c2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_STACK_SIZE.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test stack() with an invalid argument. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + stack("i'm not an integer constant"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_FRAMES.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_FRAMES.bad.d new file mode 100644 index 00000000..bfd73763 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_FRAMES.bad.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * ustack() first argument must be a non-zero positive integer constant + * + * SECTION: User Process Tracing/ustack(); + * Actions and Subroutines/ustack() + * + */ + + +BEGIN +{ + ustack(0, 200); + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_PROTO.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_PROTO.bad.d new file mode 100644 index 00000000..5360d982 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_PROTO.bad.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * ustack() accepts two arguments + * + * SECTION: User Process Tracing/ustack(); + * Actions and Subroutines/ustack() + * + */ + + +BEGIN +{ + ustack(1, 10, "badarg"); + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_STRSIZE.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_STRSIZE.bad.d new file mode 100644 index 00000000..4c89ed5d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/err.D_USTACK_STRSIZE.bad.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * ustack() second argument must be a positive integer constant. + * + * SECTION: User Process Tracing/ustack(); + * Actions and Subroutines/ustack() + * + */ + + +BEGIN +{ + ustack(1, "badarg"); + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/tst.default.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/tst.default.d new file mode 100644 index 00000000..f7a4f06b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stack/tst.default.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the stack action with the default stack depth. + * + * SECTION: Output Formatting/printf() + * + */ + +BEGIN +{ + stack(); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stackdepth/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stackdepth/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stackdepth/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stackdepth/tst.default.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stackdepth/tst.default.d new file mode 100644 index 00000000..c37380d5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stackdepth/tst.default.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the stackdepth variable. + * + * SECTION: Variables/Built-in Variables + * + */ + +BEGIN +{ + trace(stackdepth); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop1.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop1.c new file mode 100644 index 00000000..28ce1b87 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop1.c @@ -0,0 +1,37 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> + +int +main(int argc, char **argv) +{ + for (;;) { + getpid(); + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop1.d new file mode 100644 index 00000000..dd5a4b99 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop1.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Positive test for stop + * + * SECTION: Actions and Subroutines/stop() + */ + +#pragma D option destructive + +BEGIN +{ + /* + * Wait no more than a second for the process to call getpid(). + */ + timeout = timestamp + 1000000000; + stopped = 0; +} + +syscall::getpid:entry +/pid == $1 && stopped == 1/ +{ + trace("looks like it's still going"); + exit(1); +} + +syscall::getpid:entry +/pid == $1 && stopped == 0/ +{ + stop(); + trace("stopped"); + stopped = 1; + /* + * Wait for a quarter second before declaring victory. + */ + timeout = timestamp + 1000000000 / 4; +} + +profile:::tick-8 +/timestamp > timeout && stopped == 1/ +{ + trace("looks like it really stopped"); + exit(0); +} + +profile:::tick-8 +/timestamp > timeout/ +{ + trace("timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop2.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop2.c new file mode 100644 index 00000000..28ce1b87 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop2.c @@ -0,0 +1,37 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> + +int +main(int argc, char **argv) +{ + for (;;) { + getpid(); + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop2.d new file mode 100644 index 00000000..4c79cd84 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/stop/tst.stop2.d @@ -0,0 +1,78 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Positive test for stop + * + * SECTION: Actions and Subroutines/stop() + */ + +#pragma D option destructive + +BEGIN +{ + /* + * Wait no more than a second for the process to call getpid(). + */ + timeout = timestamp + 1000000000; + stopped = 0; +} + +syscall::getpid:entry +/pid == $1 && stopped == 1/ +{ + trace("looks like it's still going"); + exit(1); +} + +syscall::getpid:return +/pid == $1 && stopped == 0/ +{ + stop(); + trace("stopped"); + stopped = 1; + /* + * Wait for a quarter second before declaring victory. + */ + timeout = timestamp + 1000000000 / 4; +} + +profile:::tick-8 +/timestamp > timeout && stopped == 1/ +{ + trace("looks like it really stopped"); + exit(0); +} + +profile:::tick-8 +/timestamp > timeout/ +{ + trace("timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/strlen/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/strlen/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/strlen/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/strlen/tst.strlen1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/strlen/tst.strlen1.d new file mode 100644 index 00000000..7775395b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/strlen/tst.strlen1.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the strlen() subroutine. + * + * SECTION: Actions and Subroutines/strlen() + * + */ + +BEGIN +/strlen("I like DTrace") == 13/ +{ + correct = 1; +} + +BEGIN +{ + exit(correct ? 0 : 1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_ADDROF_VAR.StructPointer.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_ADDROF_VAR.StructPointer.d new file mode 100644 index 00000000..85e49fa0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_ADDROF_VAR.StructPointer.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Trying to access the members of a user defined struct by means of + * a pointer to it should throw a D_ADDROF_VAR compiler error. + * + * SECTION: Structs and Unions/Pointers to Structs + * + */ + +#pragma D option quiet + +struct record { + int position; + int content; + +}; + +struct record var; +struct record *ptr; +BEGIN +{ + + var.position = 1; + var.content = 'a'; + + ptr = &var; + + printf("ptr->position: %d\tptr->content: %c\n", + ptr->position, ptr->content); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon.d new file mode 100644 index 00000000..004e9019 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon.d @@ -0,0 +1,74 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Combining multiple struct definitions in a single line should throw a + * compiler error. + * + * SECTION: Structs and Unions/Structs + * + */ + + +#pragma ident "%Z%%M% %I% %E% SMI" +#pragma D option quiet + +struct superStruct { + int position; + char content; +} + +struct record { + int position; + char content; +} + + +struct pirate { + int position; + char content; +}; + +struct superStruct super; +struct record rec; +struct pirate pir; + +BEGIN +{ + rec.content = 'a'; + rec.position = 1; + + pir.content = 'b'; + pir.position = 2; + + printf( + "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d", + rec.content, rec.position, pir.content, pir.position); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon1.d new file mode 100644 index 00000000..1c403b67 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_COMBO.StructWithoutColon1.d @@ -0,0 +1,68 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Combining multiple struct definitions in a single line should throw a + * compiler error. + * + * SECTION: Structs and Unions/Structs + * + */ + +#pragma D option quiet + +struct record { + int position; + char content; +}; + + +struct pirate { + int position; + char content; +} + +struct record rec; +struct pirate pir; + +BEGIN +{ + rec.content = 'a'; + rec.position = 1; + + pir.content = 'b'; + pir.position = 2; + + printf( + "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d", + rec.content, rec.position, pir.content, pir.position); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.circular.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.circular.d new file mode 100644 index 00000000..dcbc8ee2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.circular.d @@ -0,0 +1,66 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * A circular definition of structs (two structs defining each other as + * members) should throw an error at compile time. + * + * SECTION: Structs and Unions/Structs + * + */ + + +#pragma ident "%Z%%M% %I% %E% SMI" +#pragma D option quiet + + +struct record { + struct pirate p; + int position; + char content; +}; + + +struct pirate { + struct record r; + int position; + char content; +}; + +struct record rec; +struct pirate pir; + +BEGIN +{ + rec.position = 0; + rec.content = 'a'; + printf("rec.position: %d\nrec.content: %c\n", + rec.position, rec.content); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order.d new file mode 100644 index 00000000..932f4dc9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order.d @@ -0,0 +1,69 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * When two struct are defined such that one of them contains the other, the + * inner struct has to be defined first. + * + * SECTION: Structs and Unions/Structs + * + */ + +#pragma D option quiet + + +struct record { + struct pirate p; + int position; + char content; +}; + +struct pirate { + int position; + char content; +}; + +struct record rec; +struct pirate pir; + +BEGIN +{ + rec.content = 'y'; + rec.position = 2; + + pir.content = 'z'; + pir.position = 26; + + printf( + "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d", + rec.content, rec.position, pir.content, pir.position); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order2.d new file mode 100644 index 00000000..807b6186 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.order2.d @@ -0,0 +1,108 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * When struct definitions are nested inside one another, the inner struct + * should be defined before the outer one can declare it as a variable. + * + * SECTION: Structs and Unions/Structs + * + */ + +#pragma D option quiet + +struct InnerMore { + struct InnerMost IMost; + int dummy_More; +}; + +struct InnerMost { + int position; + char content; +}; + +struct Inner { + struct InnerMore IMore; + int dummy_More; +}; + +struct Outer { + struct Inner I; + int dummy_More; +}; + +struct OuterMore { + struct Outer O; + int dummy_More; +}; + +struct OuterMost { + struct OuterMore OMore; + int dummy_More; +} OMost; + + +BEGIN +{ + + OMost.dummy_More = 0; + OMost.OMore.dummy_More = 1; + OMost.OMore.O.dummy_More = 2; + OMost.OMore.O.I.dummy_More = 3; + OMost.OMore.O.I.IMore.dummy_More = 4; + OMost.OMore.O.I.IMore.IMost.position = 5; + OMost.OMore.O.I.IMore.IMost.content = 'e'; + + printf("OMost.dummy_More: %d\nOMost.OMore.dummy_More: %d\n", + OMost.dummy_More, OMost.OMore.dummy_More); + + printf("OMost.OMore.O.dummy_More: %d\nOMost.OMore.O.I.dummy_More: %d\n", + OMost.OMore.O.dummy_More, OMost.OMore.O.I.dummy_More); + + printf("OMost.OMore.O.I.IMore.dummy_More:%d\n", + OMost.OMore.O.I.IMore.dummy_More); + + printf("OMost.OMore.O.I.IMore.IMost.position: %d\n", + OMost.OMore.O.I.IMore.IMost.position); + + printf("OMost.OMore.O.I.IMore.IMost.content: %c\n", + OMost.OMore.O.I.IMore.IMost.content); + + exit(0); +} + +END +/(0 != OMost.dummy_More) || (1 != OMost.OMore.dummy_More) + (2 != OMost.OMore.O.dummy_More) || (3 != OMost.OMore.O.I.dummy_More) + (4 != OMost.OMore.O.I.IMore.dummy_More) + (5 != OMost.OMore.O.I.IMore.IMost.position) + ('e' != OMost.OMore.O.I.IMore.IMost.content)/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.recursive.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.recursive.d new file mode 100644 index 00000000..011fbdd3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.recursive.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: Recursive naming of structures should produce compiler error. + * + * SECTION: Structs and Unions/Structs + * + */ + + +#pragma ident "%Z%%M% %I% %E% SMI" +#pragma D option quiet + +struct record { + struct record rec; + int position; + char content; +}; + +struct record r1; +struct record r2; + +BEGIN +{ + r1.position = 1; + r1.content = 'a'; + + r2.position = 2; + r2.content = 'b'; + + printf("r1.position: %d\nr1.content: %c\n", r1.position, r1.content); + printf("r2.position: %d\nr2.content: %c\n", r2.position, r2.content); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.simple.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.simple.d new file mode 100644 index 00000000..7fc54ff0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_INCOMPLETE.simple.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Declaring an inner struct within another struct and not defining it should + * throw a compiler error. + * + * SECTION: Structs and Unions/Structs + * + */ + + +#pragma ident "%Z%%M% %I% %E% SMI" +#pragma D option quiet + + +struct record { + struct pirate p; + int position; + char content; +}; + + +struct record rec; + +BEGIN +{ + rec.position = 0; + rec.content = 'a'; + printf("rec.position: %d\nrec.content: %c\n", + rec.position, rec.content); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_VOIDOBJ.baddec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_VOIDOBJ.baddec.d new file mode 100644 index 00000000..bba126fe --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_DECL_VOIDOBJ.baddec.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Declaring void objects will result in a D_DECL_VOIDOBJ error + * + * SECTION: Structs and Unions/Structs + * + */ + +#pragma D option quiet + +struct { + int trace(); +}; + +BEGIN +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_PROTO_ARG.DupStructAssoc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_PROTO_ARG.DupStructAssoc.d new file mode 100644 index 00000000..0eea2d8d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/err.D_PROTO_ARG.DupStructAssoc.d @@ -0,0 +1,80 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Declaring an associative array with a struct to be its key type and trying to + * index with another struct having the same composition throws an error. + * + * SECTION: Structs and Unions/Structs + * + */ + +#pragma D option quiet + +struct record { + int position; + char content; +}; + +struct pirate { + int position; + char content; +}; + +struct record r1; +struct record r2; +struct pirate p1; +struct pirate p2; + +BEGIN +{ + r1.position = 1; + r1.content = 'a'; + + r2.position = 2; + r2.content = 'b'; + + p1.position = 1; + p1.content = 'a'; + + p2.position = 2; + p2.content = 'b'; + + assoc_array[r1] = 1000; + assoc_array[r2] = 2000; + assoc_array[p1] = 3333; + assoc_array[p2] = 4444; + + printf("assoc_array[r1]: %d\n", assoc_array[r1]); + printf("assoc_array[r2]: %d\n", assoc_array[r2]); + printf("assoc_array[p1]: %d\n", assoc_array[p1]); + printf("assoc_array[p2]: %d\n", assoc_array[p2]); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructAssoc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructAssoc.d new file mode 100644 index 00000000..ead235da --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructAssoc.d @@ -0,0 +1,71 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * When a struct is used as a key for an associative array, the key is formed + * by using the values of the members of the struct variable and not the + * address of the struct variable. + * + * SECTION: Structs and Unions/Structs + * + */ + +#pragma D option quiet + +struct record { + int position; + char content; +}; + +struct record r1; +struct record r2; + +BEGIN +{ + r1.position = 1; + r1.content = 'a'; + + r2.position = 1; + r2.content = 'a'; + + assoc_array[r1] = 1000; + assoc_array[r2] = 2000; + + printf("assoc_array[r1]: %d\n", assoc_array[r1]); + printf("assoc_array[r2]: %d\n", assoc_array[r2]); + + exit(0); +} + +END +/assoc_array[r1] != assoc_array[r2]/ +{ + printf("Error"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructDataTypes.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructDataTypes.d new file mode 100644 index 00000000..5cfdc325 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructDataTypes.d @@ -0,0 +1,133 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Declaration of the different data types within a struct and + * their definitions in a later clause should work fine. + * + * SECTION: Structs and Unions/Structs + * + * NOTES: The floats, doubles and strings have not been implemented yet. + * When they do, appropriate lines in the code below should be uncommented. + * Similarly, the lines with the kmem_flags pointer assignment should be + * uncommented when the issues pertaining to it are clarified. + * + */ +#pragma D option quiet + +struct record { + char new_char; + short new_short; + int new_int; + long new_long; + long long new_long_long; + int8_t new_int8; + int16_t new_int16; + int32_t new_int32; + int64_t new_int64; + intptr_t new_intptr; + uint8_t new_uint8; + uint16_t new_uint16; + uint32_t new_uint32; + uint64_t new_uint64; + uintptr_t new_uintptr; + + /* + float new_float; + double new_double; + long double new_long_double; + + string new_string; + */ + + struct { + char ch; + int in; + long lg; + } new_struct; + + union { + char ch; + int in; + long lg; + } new_union; + +enum colors { + RED, + GREEN, + BLUE +} new_enum; + + + int *pointer; +} var; + +/* + var.pointer = &`kmem_flags; +*/ +BEGIN +{ + var.new_char = 'c'; + var.new_short = 10; + var.new_int = 100; + var.new_long = 1234567890; + var.new_long_long = 1234512345; + var.new_int8 = 'p'; + var.new_int16 = 20; + var.new_int32 = 200; + var.new_int64 = 2000000; + var.new_intptr = 0x12345; + var.new_uint8 = 'q'; + var.new_uint16 = 30; + var.new_uint32 = 300; + var.new_uint64 = 3000000; + var.new_uintptr = 0x67890; + +/* var.new_float = 1.23456; + var.new_double = 2.34567890; + var.new_long_double = 3.567890123; + + var.new_string = "hello"; +*/ + +/* + var.pointer = &`kmem_flags; +*/ + + var.new_struct.ch = 'c'; + var.new_struct.in = 4; + var.new_struct.lg = 4; + + var.new_union.ch = 'd'; + var.new_union.in = 5; + var.new_union.lg = 5; + + this->var = var; + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructInside.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructInside.d new file mode 100644 index 00000000..159accc4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.StructInside.d @@ -0,0 +1,124 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify the nested behavior of structs. + * + * SECTION: Structs and Unions/Structs + * + */ + +#pragma D option quiet + +struct InnerMost { + int position; + char content; +}; + +struct InnerMore { + struct InnerMost IMost; + int dummy_More; +}; + +struct Inner { + struct InnerMore IMore; + int dummy_More; +}; + +struct Outer { + struct Inner I; + int dummy_More; +}; + +struct OuterMore { + struct Outer O; + int dummy_More; +}; + +struct OuterMost { + struct OuterMore OMore; + int dummy_More; +} OMost; + +struct OuterMost OMostCopy; + +BEGIN +{ + + OMost.dummy_More = 0; + OMost.OMore.dummy_More = 1; + OMost.OMore.O.dummy_More = 2; + OMost.OMore.O.I.dummy_More = 3; + OMost.OMore.O.I.IMore.dummy_More = 4; + OMost.OMore.O.I.IMore.IMost.position = 5; + OMost.OMore.O.I.IMore.IMost.content = 'e'; + + printf("OMost.dummy_More: %d\nOMost.OMore.dummy_More: %d\n", + OMost.dummy_More, OMost.OMore.dummy_More); + + printf("OMost.OMore.O.dummy_More: %d\n", + OMost.OMore.O.dummy_More); + + printf("OMost.OMore.O.I.dummy_More: %d\n", + OMost.OMore.O.I.dummy_More); + + printf("OMost.OMore.O.I.IMore.dummy_More:%d\n", + OMost.OMore.O.I.IMore.dummy_More); + + printf("OMost.OMore.O.I.IMore.IMost.position: %d\n", + OMost.OMore.O.I.IMore.IMost.position); + + printf("OMost.OMore.O.I.IMore.IMost.content: %c\n", + OMost.OMore.O.I.IMore.IMost.content); + + OMostCopy = OMost; + + exit(0); +} + +END +/(0 != OMost.dummy_More) || (1 != OMost.OMore.dummy_More) || + (2 != OMost.OMore.O.dummy_More) || (3 != OMost.OMore.O.I.dummy_More) || + (4 != OMost.OMore.O.I.IMore.dummy_More) || + (5 != OMost.OMore.O.I.IMore.IMost.position) || + ('e' != OMost.OMore.O.I.IMore.IMost.content)/ +{ + exit(1); +} + +END +/(0 != OMostCopy.dummy_More) || (1 != OMostCopy.OMore.dummy_More) || + (2 != OMostCopy.OMore.O.dummy_More) || + (3 != OMostCopy.OMore.O.I.dummy_More) || + (4 != OMostCopy.OMore.O.I.IMore.dummy_More) || + (5 != OMostCopy.OMore.O.I.IMore.IMost.position) || + ('e' != OMostCopy.OMore.O.I.IMore.IMost.content)/ +{ + exit(2); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d new file mode 100644 index 00000000..0a7e80e4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +struct foo { + int x; + char y; + short z; +}; + +this struct foo bar; +long bignum; + +BEGIN +{ + this->bar.x = 1; + this->bar.y = ','; + this->bar.z = 1234; +} + +BEGIN +{ + printf("Die %s%c %s.\n", this->bar.x == 1 ? "SystemTap" : "DTrace", + this->bar.y, this->bar.z == 1234 ? "Die" : "The"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d.out new file mode 100644 index 00000000..c3fbf224 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/struct/tst.clauselocal.d.out @@ -0,0 +1,2 @@ +Die SystemTap, Die. + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.args.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.args.c new file mode 100644 index 00000000..209160bd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.args.c @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <stdio.h> +#include <sys/syscall.h> + +/*ARGSUSED*/ +int +main(int argc, char **argv) +{ + for (;;) { + (void) syscall(SYS_mmap, NULL, 1, 2, 3, -1, 0x12345678); + } + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.args.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.args.d new file mode 100644 index 00000000..8e473b46 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.args.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Make sure we're correctly reporting arguments to syscall probes. + */ + +#pragma D option quiet + +syscall::mmap*:entry +/pid == $1 && arg0 == 0 && arg1 == 1 && arg2 == 2 && arg3 == 3 && + (int)arg4 == -1 && arg5 == 0x12345678/ +{ + exit(0); +} + +tick-1s +/i++ == 3/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.openret.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.openret.ksh new file mode 100755 index 00000000..6469db77 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/syscall/tst.openret.ksh @@ -0,0 +1,75 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +script() { + $dtrace -c 'cat shajirosan' -qs /dev/stdin <<EOF + syscall::open*:entry + /pid == \$target/ + { + self->p = arg0; + } + + syscall::open*:return + /self->p && copyinstr(self->p) == "shajirosan"/ + { + self->err = 1; + self->p = 0; + } + + syscall::open*:return + /self->err && (int)arg0 == -1 && (int)arg1 == -1/ + { + exit(0); + } + + syscall::open*:return + /self->err/ + { + printf("a failed open(2) returned %d\n", (int)arg0); + exit(1); + } + + syscall::open*:return + /self->p/ + { + self->p = 0; + } +EOF +} + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +script +status=$? + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post.c new file mode 100644 index 00000000..1e7f957f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post.c @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <libsysevent.h> +#include <stdio.h> + +int +main(int argc, char **argv) +{ + sysevent_id_t id; + + for (;;) { + if (sysevent_post_event("class_dtest", "subclass_dtest", + "vendor_dtest", "publisher_dtest", NULL, &id) != 0) { + (void) fprintf(stderr, "failed to post sysevent\n"); + return (1); + } + + sleep(1); + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post.d new file mode 100644 index 00000000..e547a261 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post.d @@ -0,0 +1,88 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + $1 + 0; /* make sure pid is referenced */ + + /* + * Wait no more than a five seconds for the sysevent to be posted + */ + timeout = timestamp + 5000000000; +} + +sysevent:::post +/args[0]->ec_name != NULL/ +{ + printf("channel name is non-NULL (%s)\n", + args[0]->ec_name); + exit(1); +} + +sysevent:::post +/strstr(args[1]->se_publisher, "vendor_dtest") == NULL/ +{ + printf("missing vendor name from publisher (%s)\n", + args[1]->se_publisher); + exit(1); +} + +sysevent:::post +/strstr(args[1]->se_publisher, "publisher_dtest") == NULL/ +{ + printf("missing publisher name from publisher (%s)\n", + args[1]->se_publisher); + exit(1); +} + +sysevent:::post +/args[1]->se_class != "class_dtest"/ +{ + printf("unexpected class name (%s)\n", args[1]->se_class); + exit(1); +} + +sysevent:::post +/args[1]->se_subclass != "subclass_dtest"/ +{ + printf("unexpected subclass name (%s)\n", args[1]->se_subclass); + exit(1); +} + +sysevent:::post +{ + exit(0); +} + +profile:::tick-8 +/timestamp > timeout/ +{ + printf("timed out\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.c new file mode 100644 index 00000000..4a452a7a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.c @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include <libsysevent.h> +#include <stdio.h> + +int +main(int argc, char **argv) +{ + evchan_t *ch; + + if (sysevent_evc_bind("channel_dtest", &ch, + EVCH_CREAT | EVCH_HOLD_PEND) != 0) { + (void) fprintf(stderr, "failed to bind to sysevent channel\n"); + return (1); + } + + for (;;) { + if (sysevent_evc_publish(ch, "class_dtest", "subclass_dtest", + "vendor_dtest", "publisher_dtest", NULL, EVCH_SLEEP) != 0) { + (void) sysevent_evc_unbind(ch); + (void) fprintf(stderr, "failed to publisth sysevent\n"); + return (1); + } + sleep(1); + } +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.d new file mode 100644 index 00000000..9d12e1ec --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.d @@ -0,0 +1,87 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + $1 + 0; /* make sure pid is referenced */ + + /* + * Wait no more than five seconds for the sysevent to be posted + */ + timeout = timestamp + 5000000000; +} + +sysevent:::post +/args[0]->ec_name != "channel_dtest"/ +{ + printf("unexpected channel name (%s)\n", args[0]->ec_name); + exit(1); +} + +sysevent:::post +/strstr(args[1]->se_publisher, "vendor_dtest") == NULL/ +{ + printf("missing vendor name from publisher (%s)\n", + args[1]->se_publisher); + exit(1); +} + +sysevent:::post +/strstr(args[1]->se_publisher, "publisher_dtest") == NULL/ +{ + printf("missing publisher name from publisher (%s)\n", + args[1]->se_publisher); + exit(1); +} + +sysevent:::post +/args[1]->se_class != "class_dtest"/ +{ + printf("unexpected class name (%s)\n", args[1]->se_class); + exit(1); +} + +sysevent:::post +/args[1]->se_subclass != "subclass_dtest"/ +{ + printf("unexpected subclass name (%s)\n", args[1]->se_subclass); + exit(1); +} + +sysevent:::post +{ + exit(0); +} + +profile:::tick-8 +/timestamp > timeout/ +{ + printf("timed out\n"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZERO.tick.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZERO.tick.d new file mode 100644 index 00000000..015ae2b0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZERO.tick.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Negative test; calls tick without valid value. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-n +{ + printf("This test is a simple tick-n negative test\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonens.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonens.d new file mode 100644 index 00000000..3ed28b1b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonens.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call profile-'ns' less than 200 micro seconds. + * + * SECTION: profile Provider/profile-n probes + * + */ + +#pragma D option quiet + +profile-1ns +{ + printf("Calls 'ns' less than 200 micro seconds\n"); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonensec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonensec.d new file mode 100644 index 00000000..7b4df199 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROonensec.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call profile-1nsec; less than 200 micro seconds. + * + * SECTION: profile Provider/profile-n probes + * + */ + +#pragma D option quiet + +profile-1nsec +{ + printf("Call profile-1nsec; less than 200 micro seconds\n"); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneus.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneus.d new file mode 100644 index 00000000..6a64a3a2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneus.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Call profile-us; less than 200 micro seconds. + * + * SECTION: profile Provider/profile-n probes + * + */ + +#pragma D option quiet + +profile-1us +{ + printf(" Calling profile-us less than 200 micro seconds should fail\n"); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneusec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneusec.d new file mode 100644 index 00000000..b6b80bea --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/err.D_PDESC_ZEROoneusec.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * profile-usec; less than 200 micro seconds. + * + * SECTION: profile Provider/profile-n probes + * + */ + +#pragma D option quiet + +profile-1usec +{ + printf("profile-usec; less than 200 micro seconds \n"); + exit (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickarg0.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickarg0.d new file mode 100644 index 00000000..4dda358c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickarg0.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * Simple tick-n 'arg0' test. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-1 +{ + printf("The arg0 is %d\n", (int)arg0); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d new file mode 100644 index 00000000..602f3a91 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * tick-ms simple test. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-1ms +{ + printf("This test is a simple tick-ms provider test\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d.out new file mode 100644 index 00000000..1e267598 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickms.d.out @@ -0,0 +1,2 @@ +This test is a simple tick-ms provider test + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d new file mode 100644 index 00000000..1cf3b742 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * tick-msec simple test. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-1msec +{ + printf("This test is a simple tick-msec provider test\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d.out new file mode 100644 index 00000000..286bb14b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickmsec.d.out @@ -0,0 +1,2 @@ +This test is a simple tick-msec provider test + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d new file mode 100644 index 00000000..917139ca --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * tick-ns simple test. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-20000000ns +{ + printf("This test is a simple tick-ns provider test\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d.out new file mode 100644 index 00000000..26adddeb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickns.d.out @@ -0,0 +1,2 @@ +This test is a simple tick-ns provider test + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d new file mode 100644 index 00000000..3eedead2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * tick-nsec simple test. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-20000000nsec +{ + printf("This test is a simple tick-nsec provider test\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d.out new file mode 100644 index 00000000..4ad77b58 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticknsec.d.out @@ -0,0 +1,2 @@ +This test is a simple tick-nsec provider test + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d new file mode 100644 index 00000000..05f2657d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * tick-1s simple test. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-1s +{ + printf("This test is a simple tick-s provider test\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d.out new file mode 100644 index 00000000..b0631218 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticks.d.out @@ -0,0 +1,2 @@ +This test is a simple tick-s provider test + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d new file mode 100644 index 00000000..703af4d5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * tick-1sec simple test. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-1sec +{ + printf("This test is a simple tick-sec provider test\n"); +} +tick-1sec +{ + printf("This test is a simple tick-sec provider test"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d.out new file mode 100644 index 00000000..d9d4f45a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.ticksec.d.out @@ -0,0 +1,2 @@ +This test is a simple tick-sec provider test +This test is a simple tick-sec provider test diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d new file mode 100644 index 00000000..aa10cbb5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * tick-2000us simple test. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-2000us +{ + printf("This test is a simple tick-us provider test\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d.out new file mode 100644 index 00000000..00baa3dc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickus.d.out @@ -0,0 +1,2 @@ +This test is a simple tick-us provider test + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d new file mode 100644 index 00000000..9deb8f4c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * tick-2000usec simple test. + * + * SECTION: profile Provider/tick-n probes + * + */ + + +#pragma D option quiet + +tick-2000usec +{ + printf("This test is a simple tick-usec provider test\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d.out new file mode 100644 index 00000000..40987e32 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tick-n/tst.tickusec.d.out @@ -0,0 +1,2 @@ +This test is a simple tick-usec provider test + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d new file mode 100644 index 00000000..a1ec95cc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.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 trace() with no arguments. + * + * SECTION: Actions and Subroutines/trace() + */ + +BEGIN +{ + + trace(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d new file mode 100644 index 00000000..eb9f194a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.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 an invalid specification of trace() with a void argument. + * + * SECTION: Actions and Subroutines/trace() + */ + +BEGIN +{ + trace((void)`kmem_flags); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.misc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.misc.d new file mode 100644 index 00000000..179d7602 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.misc.d @@ -0,0 +1,63 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test a variety of trace() action invocations. + * + * SECTION: Actions and Subroutines/trace(); + * Output Formatting/trace() + * + * NOTES: + * We test things that exercise different kinds of DIFO return types + * to ensure each one can be traced. + */ + +BEGIN +{ + i = 1; +} + + +tick-1 +/i != 5/ +{ + trace("test trace"); /* DT_TYPE_STRING */ + trace(12345); /* DT_TYPE_INT (constant) */ + trace(x++); /* DT_TYPE_INT (derived) */ + trace(timestamp); /* DT_TYPE_INT (variable) */ + trace(`kmem_flags); /* CTF type (by value) */ + trace(*`rootvp); /* CTF type (by ref) */ + i++; +} + +tick-1 +/i == 5/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.qstring.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.qstring.d new file mode 100644 index 00000000..a81d147b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.qstring.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +/* + * ASSERTION: + * Positive trace tests - trace with strings, using quiet option + * + * SECTION: Actions and Subroutines/trace() + */ + + +#pragma D option quiet + +BEGIN +{ + trace("this"); + trace(" %should work.\n"); + trace("%don't w%orry -- this won't cause a %segfault.\n"); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.qstring.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.qstring.d.out new file mode 100644 index 00000000..908ffb2a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.qstring.d.out @@ -0,0 +1,3 @@ +this %should work. +%don't w%orry -- this won't cause a %segfault. + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.string.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.string.d new file mode 100644 index 00000000..c5e7c2cc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/trace/tst.string.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Positive trace tests - trace with strings + * + * SECTION: Actions and Subroutines/trace() + */ + +BEGIN +{ + trace("this"); + trace(" %should work.\n"); + trace("%don't w%orry -- this won't cause a %segfault.\n"); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_ARG.badsize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_ARG.badsize.d new file mode 100644 index 00000000..4e137cec --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_ARG.badsize.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test tracemem() with an invalid size argument. + * + * SECTION: Actions and Subroutines/tracemem() + */ + +BEGIN +{ + tracemem(123, "i'm a string"); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toofew.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toofew.d new file mode 100644 index 00000000..91c4f77b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toofew.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test tracemem() with too few arguments. + * + * SECTION: Actions and Subroutines/tracemem() + */ + + +BEGIN +{ + tracemem(123); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toomany.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toomany.d new file mode 100644 index 00000000..dfe8e4d2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toomany.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test tracemem() with too many arguments. + * + * SECTION: Actions and Subroutines/tracemem() + */ + +BEGIN +{ + tracemem(123, 456, 789); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d new file mode 100644 index 00000000..68145774 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test tracemem() with an invalid address argument. + * + * SECTION: Actions and Subroutines/tracemem() + */ + +BEGIN +{ + tracemem(`v, 123); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.negsize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.negsize.d new file mode 100644 index 00000000..b3dd4381 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.negsize.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test tracemem() with a negative size argument. + * + * SECTION: Actions and Subroutines/tracemem() + */ + +BEGIN +{ + tracemem(123, -456); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.zerosize.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.zerosize.d new file mode 100644 index 00000000..595bfcc0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_SIZE.zerosize.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test tracemem() with a zero size argument. + * + * SECTION: Actions and Subroutines/tracemem() + */ + +BEGIN +{ + tracemem(123, 0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/tst.rootvp.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/tst.rootvp.d new file mode 100644 index 00000000..afa1570d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/tracemem/tst.rootvp.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 tracemem() by tracing out the contents of the root vnode + * as a raw stream of bytes. + * + * SECTION: Actions and Subroutines/tracemem() + */ + + +BEGIN +{ + i = 1; +} + +tick-1 +/i != 5/ +{ + tracemem(`rootvp, 20); + i++; +} + +tick-1 +/i == 5/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_DECL_TYPERED.BadTransDecl.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_DECL_TYPERED.BadTransDecl.d new file mode 100644 index 00000000..2a44778e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_DECL_TYPERED.BadTransDecl.d @@ -0,0 +1,64 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a translator with the input type enclosed in + * between braces rather than angle brackets. + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *uvar; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct +{ + struct input_struct *uvar +} +{ + myi = ((struct input_struct *) uvar)->i; + myc = ((struct input_struct *) uvar)->c; +} + +BEGIN +{ + printf("Using braces instead of angle brackets for translator input"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_OP_INCOMPLETE.NonExistentInput1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_OP_INCOMPLETE.NonExistentInput1.d new file mode 100644 index 00000000..0c8c84d3 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_OP_INCOMPLETE.NonExistentInput1.d @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a translator with a non-existent input type. + * + * SECTION: Translators/Translator Declarations + * + */ + +#pragma D option quiet + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < struct input_struct *ivar > +{ + myi = ((struct input_struct *) ivar)->nonexistentI; + myc = ((struct input_struct *) ivar)->nonexistentC; +}; + +BEGIN +{ + printf("Test the translation of a non existing input type"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl1.d new file mode 100644 index 00000000..52e5c9ae --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl1.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a translator with the input type enclosed in + * between parantheses rather than angle brackets. + * + * SECTION: Translators/Translator Declarations + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *uvar; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct ( struct input_struct *uvar ) +{ + myi = ((struct input_struct *) uvar)->i; + myc = ((struct input_struct *) uvar)->c; +} + +BEGIN +{ + printf("Test translator with input type in parantheses"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl3.d new file mode 100644 index 00000000..6be8128a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl3.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a translator without enclosing braces { }. + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *uvar; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < struct input_struct *uvar > + myi = ((struct input_struct *) uvar)->i; + myc = ((struct input_struct *) uvar)->c; +; + +BEGIN +{ + printf("Test the translator definition without enclosing braces"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl4.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl4.d new file mode 100644 index 00000000..926f74c7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_SYNTAX.BadTransDecl4.d @@ -0,0 +1,65 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a translator without terminating semi-colon (;). + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *uvar; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < struct input_struct *uvar > +{ + myi = ((struct input_struct *) uvar)->i; + myc = ((struct input_struct *) uvar)->c; +} + +translator struct output_struct < struct new_struct *newvar > +{ +}; + + +BEGIN +{ + printf("Test translator declaration without terminating semi-colon"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_TYPE_MEMBER.NonExistentInput2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_TYPE_MEMBER.NonExistentInput2.d new file mode 100644 index 00000000..16deff89 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_TYPE_MEMBER.NonExistentInput2.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a translator with a non-existent member + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *ivar; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < struct input_struct *ivar > +{ + myi = ((struct input_struct *) ivar)->i; + myc = ((struct input_struct *) ivar)->nonexistent; +}; + +BEGIN +{ + printf("Testing the assignment of a non-existent input member"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_INCOMPAT.BadInputType1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_INCOMPAT.BadInputType1.d new file mode 100644 index 00000000..26cab458 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_INCOMPAT.BadInputType1.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a translator with a mismatch in types. + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *uvar; + +struct output_struct { + int myi; + char *myc; +}; + +translator struct output_struct < struct input_struct *uvar > +{ + myi = ((struct input_struct *) uvar)->i; + myc = ((struct input_struct *) uvar)->c; +}; + +BEGIN +{ + printf("Translating against the rules of assignment operator"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_MEMB.NonExistentOutput2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_MEMB.NonExistentOutput2.d new file mode 100644 index 00000000..6d6eba1b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_MEMB.NonExistentOutput2.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a translator with a non-existent output member. + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *ivar; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < struct input_struct *ivar > +{ + myi = ((struct input_struct *) ivar)->i; + yourc = ((struct input_struct *) ivar)->nonexistent; +}; + +BEGIN +{ + printf("Testing translation with non existent output member"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_NONE.BadTransDecl6.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_NONE.BadTransDecl6.d new file mode 100644 index 00000000..4cfabcea --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_NONE.BadTransDecl6.d @@ -0,0 +1,72 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * When xlate is used on a variable for which no translation exists a + * D_XLATE_NONE is thrown + * + * SECTION: Translators/Translate Operator + * + * + */ + +#pragma D option quiet + +struct myinput_struct { + int i; + char c; +}; + +struct myoutput_struct { + int myi; + char myc; +}; + +translator struct myoutput_struct < struct myinput_struct *ivar > +{ + myi = ((struct myinput_struct *) ivar)->i; + myc = ((struct myinput_struct *) ivar)->c; + +}; + +struct myinput_struct f; +BEGIN +{ + f.i = 10; + f.c = 'c'; + + xlate < struct myoutput_struct >(f)->myi; + printf("Translate operator used without correct translator decl\n"); + exit(0); +} + +ERROR +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_REDECL.RepeatTransDecl.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_REDECL.RepeatTransDecl.d new file mode 100644 index 00000000..62f8482e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_REDECL.RepeatTransDecl.d @@ -0,0 +1,67 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Redeclaring the same translation twice throws a D_XLATE_REDECL error. + * + * SECTION: Translators/Translator Declarations + * + */ + +#pragma D option quiet + +struct input_struct { + int ii1; + char ic1; +} *ivar1; + +struct output_struct { + int oi; + char oc; +}; + + +translator struct output_struct < struct input_struct *ivar1 > +{ + oi = ((struct input_struct *) ivar1)->ii1; + oc = ((struct input_struct *) ivar1)->ic1; +}; + +translator struct output_struct < struct input_struct *ivar1 > +{ + oi = ((struct input_struct *) ivar1)->ii1; + oc = ((struct input_struct *) ivar1)->ic1; +}; + + +BEGIN +{ + printf("Redeclaration of the same translation"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransDecl8.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransDecl8.d new file mode 100644 index 00000000..63786c7d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransDecl8.d @@ -0,0 +1,58 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * When the output type of the translator declaration is not a struct or + * union a D_XLATE_SOU is thrown. + * + * SECTION: Translators/Translator Declarations + */ + +#pragma D option quiet + +struct input_struct { + int ii; + char ic; +}; + +enum colors +{ + RED, + BLUE +}; + +translator enum colors < struct input_struct *ivar > +{ +}; + +BEGIN +{ + printf("Output type of translation is an enum"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransInt.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransInt.d new file mode 100644 index 00000000..65455697 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.BadTransInt.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * When the output type of the translator declaration is not a struct or + * union a D_XLATE_SOU is thrown. + * + * SECTION: Translators/Translator Declarations + */ + +#pragma D option quiet + +struct input_struct { + int ii; + char ic; +}; + +translator int < struct input_struct *ivar > +{ +}; + +BEGIN +{ + printf("Output type of translation is an int"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.NonExistentOutput1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.NonExistentOutput1.d new file mode 100644 index 00000000..1ebb94cc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/err.D_XLATE_SOU.NonExistentOutput1.d @@ -0,0 +1,55 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a translator with a non-existent output type. + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *ivar; + +translator struct output_struct < struct input_struct *ivar > +{ + myi = ((struct input_struct *) ivar)->i; + myc = ((struct input_struct *) ivar)->nonexistent; +}; + +BEGIN +{ + printf("Translation with non existent output type struct"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d new file mode 100644 index 00000000..c664188f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * The D inline translation mechanism can be used to facilitate stable + * translations. + * + * SECTION: Translators/ Translator Declarations + * SECTION: Translators/ Translate Operator + * SECTION: Translators/Stable Translations + * + * NOTES: Uncomment the pragma that explicitly resets the attributes of + * myinfo identifier to Stable/Stable/Common from Private/Private/Unknown. + * Run the program with and without the comments as: + * /usr/sbin/dtrace -vs man.TestTransStability.d + */ + +#pragma D option quiet + +inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread); + +/* +#pragma D attributes Stable/Stable/Common myinfo +*/ + +BEGIN +{ + trace(myinfo->pr_flag); + exit(0); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.CircularTransDecl.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.CircularTransDecl.d new file mode 100644 index 00000000..58466f70 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.CircularTransDecl.d @@ -0,0 +1,100 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test circular declaration of translations + * + * SECTION: Translators/ Translator Declarations + * SECTION: Translators/ Translate Operator + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +}; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < struct input_struct ivar > +{ + myi = ((struct input_struct ) ivar).i; + myc = ((struct input_struct ) ivar).c; +}; + +translator struct input_struct < struct output_struct uvar > +{ + i = ((struct output_struct ) uvar).myi; + c = ((struct output_struct ) uvar).myc; +}; + +struct input_struct f1; +struct output_struct f2; + +BEGIN +{ + f1.i = 10; + f1.c = 'c'; + + f2.myi = 100; + f2.myc = 'd'; + + printf("Testing circular translations\n"); + forwardi = xlate < struct output_struct > (f1).myi; + forwardc = xlate < struct output_struct > (f1).myc; + backwardi = xlate < struct input_struct > (f2).i; + backwardc = xlate < struct input_struct > (f2).c; + + printf("forwardi: %d\tforwardc: %c\n", forwardi, forwardc); + printf("backwardi: %d\tbackwardc: %c", backwardi, backwardc); + exit(0); +} + +BEGIN +/(10 == forwardi) && ('c' == forwardc) && (100 == backwardi) && + ('d' == backwardc)/ +{ + exit(0); +} + +BEGIN +/(10 != forwardi) || ('c' != forwardc) || (100 != backwardi) || + ('d' != backwardc)/ +{ + exit(1); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.EmptyTransDecl.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.EmptyTransDecl.d new file mode 100644 index 00000000..5a292071 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.EmptyTransDecl.d @@ -0,0 +1,79 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the empty declaration of a translator + * + * SECTION: Translators/ Translator Declarations + * SECTION: Translators/ Translate Operator + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *uvar; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < struct input_struct uvar > +{ +}; + +struct input_struct in; +struct output_struct ou; + +BEGIN +{ + in.i = 10; + in.c = 'c'; + + ou = xlate < struct output_struct > (in); + + printf("ou.myi: %d\tou.myc: %c\n", ou.myi, ou.myc); +} + +BEGIN +/(0 != ou.myi) || (0 != ou.myc)/ +{ + printf("Failed\n"); + exit(1); +} + +BEGIN +/(0 == ou.myi) || (0 == ou.myc)/ +{ + printf("Passed\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.ForwardTag.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.ForwardTag.d new file mode 100644 index 00000000..246a8d2b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.ForwardTag.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a forward tag using a translator definition. + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *uvar; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < struct callmewhatever *idontcare > +{ + myi = ((struct input_struct *) uvar)->i; + myc = ((struct input_struct *) uvar)->c; +}; + +BEGIN +{ + printf("This test defines a forward tag"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.InputAliasTrans.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.InputAliasTrans.d new file mode 100644 index 00000000..a562b394 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.InputAliasTrans.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * The input type of the tranlator declaration is an alias. + * + * SECTION: Translators/ Translator Declarations. + * + */ + +#pragma D option quiet + +typedef struct input_struct { + int ii; + char ic; +} input_t; + +struct output_struct { + int oi; + char oc; +}; + + +translator struct output_struct < input_t *ivar > +{ + oi = ((input_t *) ivar)->ii; + oc = ((input_t *) ivar)->ic; +}; + +BEGIN +{ + printf("Input type is an alias"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.InputIntTrans.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.InputIntTrans.d new file mode 100644 index 00000000..e5159ed6 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.InputIntTrans.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of a translator the input type in the translator + * declaration being different from the values being assigned inside. + * + * SECTION: Translators/Translator Declarations + * + */ + +#pragma D option quiet + +struct input_struct { + int i; + char c; +} *uvar; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < int idontcare > +{ + myi = ((struct input_struct *) uvar)->i; + myi = ((struct input_struct *) uvar)->c; +}; + +BEGIN +{ + printf("Input type to the translator decl is different from members"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.OutputAliasTrans.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.OutputAliasTrans.d new file mode 100644 index 00000000..cd471531 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.OutputAliasTrans.d @@ -0,0 +1,63 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * The output type is an alias. + * + * SECTION: Translators/ Translator Declarations. + * + * + */ + +#pragma D option quiet + +struct input_struct { + int ii; + char ic; +}; + +struct output_struct { + int oi; + char oc; +}; + +typedef struct output_struct output_t; + + +translator output_t < struct input_struct *ivar > +{ + oi = ((struct input_struct *) ivar)->ii; + oc = ((struct input_struct *) ivar)->ic; +}; + +BEGIN +{ + printf("Output type is an alias"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.PartialDereferencing.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.PartialDereferencing.d new file mode 100644 index 00000000..ae532cc4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.PartialDereferencing.d @@ -0,0 +1,85 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * If you dereference a single member of the translation input, then the + * compiler will generate the code corresponding to that member + * + * SECTION: Translators/ Translate Operator + */ + +#pragma D option quiet + +struct input_struct { + int ii; + char ic; +}; + +struct output_struct { + int oi; + char oc; +}; + + +translator struct output_struct < struct input_struct ivar > +{ + oi = ((struct input_struct) ivar).ii; + oc = ((struct input_struct) ivar).ic; +}; + +struct output_struct out; +struct input_struct in; + +BEGIN +{ + in.ii = 100; + in.ic = 'z'; + + printf("Translating only a part of the input struct\n"); + out.oi = xlate < struct output_struct > (in).oi; + + printf("out.oi: %d\t out.oc: %d\n", out.oi, out.oc); +} + +BEGIN +/(100 != out.oi) || (0 != out.oc)/ +{ + exit(1); +} + +BEGIN +/(100 == out.oi) && (0 == out.oc)/ +{ + exit(0); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.PartialOutputTransDefn.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.PartialOutputTransDefn.d new file mode 100644 index 00000000..9be52a9f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.PartialOutputTransDefn.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * A translator declaration may omit expressions for one or more members + * of the output type + * + * SECTION: Translators/Translator Declarations; + * Translators/Translate Operator + */ + +#pragma D option quiet + +struct input_struct { + int ii; + char ic; +}; + +struct output_struct { + int oi; + char oc; +}; + + +translator struct output_struct < struct input_struct *ivar > +{ + oi = ((struct input_struct *) ivar)->ii; +}; + +BEGIN +{ + printf("Translating only a part of the input struct"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.ProcModelTrans.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.ProcModelTrans.d new file mode 100644 index 00000000..ff313eca --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.ProcModelTrans.d @@ -0,0 +1,53 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Use the translators in /usr/lib/dtrace/procfs.d + * + * SECTION: Translators/ Translator Declarations + * SECTION: Translators/ Translate Operator + * SECTION: Translators/Process Model Translators + * + */ + +#pragma D option quiet + +proc_t *T; + +BEGIN +{ + mypr_addr = xlate < psinfo_t > (T).pr_addr; + printf("pr_addr: %d", mypr_addr); + exit(0); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.RepeatDeclaration.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.RepeatDeclaration.d new file mode 100644 index 00000000..a928c3e2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.RepeatDeclaration.d @@ -0,0 +1,71 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Reassign the members of the output struct using another translator + * input struct. + * + * SECTION: Translators/Translator Declarations + */ + +#pragma D option quiet + +struct input_struct1 { + int ii1; + char ic1; +} *ivar1; + +struct input_struct2 { + long ii2; + long ic2; +} *ivar2; + +struct output_struct { + int oi; + char oc; +}; + + +translator struct output_struct < struct input_struct1 *ivar1 > +{ + oi = ((struct input_struct1 *) ivar1)->ii1; + oc = ((struct input_struct1 *) ivar1)->ic1; +}; + +translator struct output_struct < struct input_struct2 *ivar2 > +{ + oi = ((struct input_struct2 *) ivar2)->ii2; + oc = ((struct input_struct2 *) ivar2)->ic2; +}; + +BEGIN +{ + printf("Reassignment of a struct's members with different input"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.SimultaneousTranslators.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.SimultaneousTranslators.d new file mode 100644 index 00000000..63cd72ca --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.SimultaneousTranslators.d @@ -0,0 +1,71 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Assign the different members of the output of the translator using + * different translator declarations. + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct input_struct1 { + int ii1; + char ic1; +} *ivar1; + +struct input_struct2 { + int ii2; + char ic2; +} *ivar2; + +struct output_struct { + int oi; + char oc; +}; + + +translator struct output_struct < struct input_struct1 *ivar1 > +{ + oi = ((struct input_struct1 *) ivar1)->ii1; +}; + +translator struct output_struct < struct input_struct2 *ivar2 > +{ + oc = ((struct input_struct2 *) ivar2)->ic2; +}; + +BEGIN +{ + printf("Translate members of output with different input structs"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.StructureAssignment.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.StructureAssignment.d new file mode 100644 index 00000000..277d95fe --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.StructureAssignment.d @@ -0,0 +1,85 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * If the entire output is copied by means of a structure assignment, any + * members for which no translation expressions are defined will be filled + * with zeroes. + * + * SECTION: Translators/ Translate Operator + */ + +#pragma D option quiet + +struct input_struct { + int ii; + char ic; +}; + +struct output_struct { + int oi; + char oc; +}; + + +translator struct output_struct < struct input_struct ivar > +{ + oi = ((struct input_struct) ivar).ii; +}; + +struct output_struct out; +struct input_struct in; + +BEGIN +{ + in.ii = 100; + in.ic = 'z'; + + printf("Translating via struct assignment\n"); + out = xlate < struct output_struct > (in); + + printf("out.oi: %d\t out.oc: %d\n", out.oi, out.oc); +} + +BEGIN +/(100 != out.oi) || (0 != out.oc)/ +{ + exit(1); +} + +BEGIN +/(100 == out.oi) && (0 == out.oc)/ +{ + exit(0); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransNonPointer.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransNonPointer.d new file mode 100644 index 00000000..3ec81434 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransNonPointer.d @@ -0,0 +1,84 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Translate the input expression to output struct type + * + * SECTION: Translators/ Translator Declarations + * SECTION: Translators/ Translate Operator + * + */ + +#pragma D option quiet + +struct myinput_struct { + int i; + char c; +}; + +struct myoutput_struct { + int myi; + char myc; +}; + +translator struct myoutput_struct < struct myinput_struct ivar > +{ + myi = ((struct myinput_struct ) ivar).i; + myc = ((struct myinput_struct ) ivar).c; + +}; + +struct myinput_struct f; +BEGIN +{ + f.i = 10; + f.c = 'c'; + + realmyi = xlate < struct myoutput_struct > (f).myi; + realmyc = xlate < struct myoutput_struct > (f).myc; +} + +BEGIN +/(10 != f.i) || ('c' != f.c)/ +{ + exit(1); +} + +BEGIN +/(10 == f.i) && ('c' == f.c)/ +{ + printf("realmyi: %d\n", realmyi); + printf("realmyc: %c\n", realmyc); + exit(0); +} + +ERROR +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransOutputPointer.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransOutputPointer.d new file mode 100644 index 00000000..9069bf5d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransOutputPointer.d @@ -0,0 +1,80 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Translate an input expression to a pointer to a struct + * + * SECTION: Translators/ Translator Declarations + * SECTION: Translators/ Translate Operator + * + */ + +#pragma D option quiet + +struct myinput_struct { + int i; + char c; +}; + +struct myoutput_struct { + int myi; + char myc; +}; + +translator struct myoutput_struct < struct myinput_struct ivar > +{ + myi = ((struct myinput_struct ) ivar).i; + myc = ((struct myinput_struct ) ivar).c; + +}; + +struct myinput_struct f; + +BEGIN +{ + f.i = 1203; + f.c = 'v'; + + realmyi = xlate < struct myoutput_struct *> (f)->myi; + realmyc = xlate < struct myoutput_struct *> (f)->myc; +} + +BEGIN +/(1203 != realmyi) || ('v' != realmyc)/ +{ + printf("Failure"); + exit(1); +} + +BEGIN +/(1203 == realmyi) && ('v' == realmyc)/ +{ + printf("Success"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransPointer.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransPointer.d new file mode 100644 index 00000000..34d31d44 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TransPointer.d @@ -0,0 +1,63 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the normal declaration of translators. + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct myinput_struct { + int i; + char c; +}; + +struct myoutput_struct { + int myi; + char myc; +}; + +translator struct myoutput_struct < struct myinput_struct *ivar > +{ + myi = ((struct myinput_struct *) ivar)->i; + myc = ((struct myinput_struct *) ivar)->c; + +}; + +struct myinput_struct *f; + +BEGIN +{ + printf("Good translator defn"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TranslateSelf.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TranslateSelf.d new file mode 100644 index 00000000..9059093f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.TranslateSelf.d @@ -0,0 +1,76 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the translation of a struct to itself. + * + * SECTION: Translators/ Translator Declarations. + * SECTION: Translators/ Translate operator. + * + * + */ + +#pragma D option quiet + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < struct output_struct uvar > +{ + myi = ((struct output_struct ) uvar).myi; + myc = ((struct output_struct ) uvar).myc; +}; + +struct output_struct out; +struct output_struct outer; + +BEGIN +{ + out.myi = 1234; + out.myc = 'a'; + + printf("Test translation of a struct to itself\n"); + outer = xlate < struct output_struct > (out); + + printf("outer.myi: %d\t outer.myc: %c\n", outer.myi, outer.myc); +} + +BEGIN +/(1234 != outer.myi) || ('a' != outer.myc)/ +{ + exit(1); +} + +BEGIN +/(1234 == outer.myi) && ('a' == outer.myc)/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.UnionInputTrans.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.UnionInputTrans.d new file mode 100644 index 00000000..fb2dcf09 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.UnionInputTrans.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test the declaration of translators with a union to be the input type. + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +union input_union { + int i; + char c; +} *ivar; + +struct output_struct { + int myi; + char myc; +}; + +translator struct output_struct < union input_union *ivar > +{ + myi = ((union input_union *) ivar)->i; + myc = ((union input_union *) ivar)->c; + +}; + +BEGIN +{ + printf("Translator definition good\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.UnionOutputTrans.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.UnionOutputTrans.d new file mode 100644 index 00000000..3b2c588d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/translators/tst.UnionOutputTrans.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * The output type in a translator definition can be a union. + * + * SECTION: Translators/Translator Declarations + * + * + */ + +#pragma D option quiet + +struct input_struct { + int ii; + char ic; +} *ivar; + +union output_union { + int oi; + char oc; +}; + +translator union output_union < struct input_struct *ivar > +{ + oi = ((struct input_struct *) ivar)->ii; + oc = ((struct input_struct *) ivar)->ic; + +}; + +BEGIN +{ + printf("Test translator definition with union output"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_DECL_IDRED.DupTypeDef.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_DECL_IDRED.DupTypeDef.d new file mode 100644 index 00000000..47a9fdfe --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_DECL_IDRED.DupTypeDef.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +/* + * ASSERTION: Cannot redeclare identifier using typedef. + * + * SECTION: Type and Constant Definitions/Typedef + * + * NOTES: + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +typedef int new_int; + +BEGIN +{ + exit(0); +} + +typedef char new_int; + +END +{ +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.BadExistingTypedef.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.BadExistingTypedef.d new file mode 100644 index 00000000..38521a05 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.BadExistingTypedef.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +/* + * ASSERTION: + * The typedef keyword throws an D_SYNTAX error when a bad existing type is + * used. + * + * SECTION: Type and Constant Definitions/Typedef + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + + +typedef pint new_int; + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.TypedefInClause.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.TypedefInClause.d new file mode 100644 index 00000000..0cb8cf73 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/err.D_SYNTAX.TypedefInClause.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ +/* + * ASSERTION: + * The typedef keyword can be used outside of the probe clauses only. + * + * SECTION: Type and Constant Definitions/Typedef + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + + +BEGIN +{ + typedef int new_int; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/tst.ChainTypedef.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/tst.ChainTypedef.d new file mode 100644 index 00000000..00810a52 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/tst.ChainTypedef.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: An identifier used to alias a primitive data type can be further + * used to typedef other aliases. typedef is transitive. + * + * SECTION: Type and Constant Definitions/Typedef + * + * NOTES: + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + + +typedef int new_int; +typedef new_int latest_int; + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/tst.TypedefDataAssign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/tst.TypedefDataAssign.d new file mode 100644 index 00000000..4565be55 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/typedef/tst.TypedefDataAssign.d @@ -0,0 +1,118 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Test the typedef keyword with the different D data types. Declare different + * data types and test some of them with values. + * + * SECTION: Type and Constant Definitions/Typedef + * + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +typedef char new_char; +typedef short new_short; +typedef int new_int; +typedef long new_long; +typedef long long new_long_long; +typedef int8_t new_int8; +typedef int16_t new_int16; +typedef int32_t new_int32; +typedef int64_t new_int64; +typedef intptr_t new_intptr; +typedef uint8_t new_uint8; +typedef uint16_t new_uint16; +typedef uint32_t new_uint32; +typedef uint64_t new_uint64; +typedef uintptr_t new_uintptr; +typedef float new_float; +typedef double new_double; +typedef long double new_long_double; + +typedef int * pointer; + +typedef struct { + char ch; + int in; + long lg; +} new_struct; + +typedef union { + char ch; + int in; + long lg; +} new_union; + +typedef enum { + RED, + GREEN, + BLUE +} new_enum; + +new_char c; +new_short s; +new_int i; +new_long l; +new_long_long ll; +new_int8 i8; +new_int16 i16; +new_int32 i32; +new_int64 i64; +new_intptr iptr; +new_uint8 ui8; +new_uint16 ui16; +new_uint32 ui32; +new_uint64 ui64; +new_uintptr uiptr; +new_float f; +new_double d; +new_long_double ld; +new_struct ns; +new_union nu; +new_enum ne; + +pointer p; + +BEGIN +{ + ns.ch = 'c'; + ns.in = 4; + ns.lg = 4; + + nu.ch = 'd'; + nu.in = 5; + nu.lg = 5; + + i = 10; + + printf("Struct: %c, %d, %d\n", ns.ch, ns.in, ns.lg); + printf("Union: %c, %d, %d\n", nu.ch, nu.in, nu.lg); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CAST_INVAL.badcast.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CAST_INVAL.badcast.d new file mode 100644 index 00000000..13d58eac --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CAST_INVAL.badcast.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +#pragma ident "%Z%%M% %I% %E% SMI" + + +/* + * ASSERTION: + * Test an illegal cast - make sure dtrace catches it. + * + * SECTION: Aggregations/Clearing aggregations + * + * + */ + + +BEGIN +{ + (char)trace(`kmem_flags); + exit(); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CG_DYN.ResultDynType.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CG_DYN.ResultDynType.d new file mode 100644 index 00000000..74f2d701 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CG_DYN.ResultDynType.d @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * An expression cannot evaluate to result of dynamic type. + * + * SECTION: Errtag/D_CG_DYN + */ + +#pragma D option quiet + +translator lwpsinfo_t < int i > +{ + pr_flag = i; +}; + +BEGIN +{ + xlate < lwpsinfo_t * > (0); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CHR_OFLOW.charconst.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CHR_OFLOW.charconst.d new file mode 100644 index 00000000..b158c3ca --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_CHR_OFLOW.charconst.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * verify the use of multi-char constants in single quotes + * + * SECTION: Types, Operators, and Expressions/Constants + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + + +BEGIN +{ + char_bad = 'abc\fefghi'; + + printf("decimal value = %d", char_bad); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_BADCLASS.bad.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_BADCLASS.bad.d new file mode 100644 index 00000000..5064a591 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_BADCLASS.bad.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invalid class names should be handled as an error. + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + * + */ + +register x; + + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_CHARATTR.badtype3.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_CHARATTR.badtype3.d new file mode 100644 index 00000000..e1407bc4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_CHARATTR.badtype3.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invalid type name + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + * + */ + + +#pragma D option quiet + +dtrace:::BEGIN +{ + i = (char long)0; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype4.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype4.d new file mode 100644 index 00000000..e925a860 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype4.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invalid type name + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + * + */ + + +#pragma D option quiet + +dtrace:::BEGIN +{ + i = (char int)0; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype5.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype5.d new file mode 100644 index 00000000..b7a3b050 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_COMBO.badtype5.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invalid type name + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + * + */ + + +#pragma D option quiet + +dtrace:::BEGIN +{ + i = (double double)0; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENCONST.badeval.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENCONST.badeval.d new file mode 100644 index 00000000..5e1c19db --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENCONST.badeval.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Attempt a bogus enum declaration by assigning a non-constant expression + * to an enumerator. + * + * SECTION: Type and Constant Definitions/Enumerations + */ + +enum e { + TAG = "i am not an integer constant!" +}; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enoflow.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enoflow.d new file mode 100644 index 00000000..25e14a69 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enoflow.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Define an enumerations with a overflow value. + * + * SECTION: Type and Constant Definitions/Enumerations + */ + +enum e { + toobig = 2147483648 +}; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enuflow.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enuflow.d new file mode 100644 index 00000000..3709cb2f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_ENOFLOW.enuflow.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Define an enumerations with a overflow value using negative value. + * + * SECTION: Type and Constant Definitions/Enumerations + */ + + +enum e { + toosmall = -2147483649 +}; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_SCOPE.scopeop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_SCOPE.scopeop.d new file mode 100644 index 00000000..ddac451f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_SCOPE.scopeop.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Using the scope operator in a declaration will result in a + * D_DECL_SCOPE error. + * + * SECTION: Variables/External Variables + * + */ + +#pragma D option quiet + +int `xyz; + +BEGIN +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_USELESS.baddec.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_USELESS.baddec.d new file mode 100644 index 00000000..7e3606e0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_DECL_USELESS.baddec.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Bad external declarations will result in a D_DECL_USELESS + * error. + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + * + */ + +extern int; + +BEGIN +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_ACT.badcond.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_ACT.badcond.d new file mode 100644 index 00000000..b139f9e7 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_ACT.badcond.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Tracing functions may not be second and third expressions + * of a conditional expr. + * + * SECTION: Types, Operators, and Expressions/Conditional Expressions + * + */ + +#pragma D option quiet + + +BEGIN +{ + i = 1; + x = i == 0 ? trace(0): trace(1); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_ARITH.badoperand.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_ARITH.badoperand.d new file mode 100644 index 00000000..9fefb170 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_ARITH.badoperand.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Arithmetic operations with a +/- must be followed by an arithmetic + * type. + * + * SECTION: Types, Operators, and Expressions/Arithmetic Operators + * + */ + + + +BEGIN +{ + p = 123 + -trace(0); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INCOMPAT.badassign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INCOMPAT.badassign.d new file mode 100644 index 00000000..04815a9d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INCOMPAT.badassign.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Assignment operators do not supported on all types + * + * SECTION: Types, Operators, and Expressions/Assignment Operators + * + */ + +#pragma D option quiet + +BEGIN +{ + a = 3; + a += "foobar"; + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badbitop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badbitop.d new file mode 100644 index 00000000..a210ea15 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badbitop.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Bitwise operators not supported on all types + * + * SECTION: Types, Operators, and Expressions/Bitwise Operators + * + */ + +#pragma D option quiet + +BEGIN +/"char" & "foo"/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badshift.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badshift.d new file mode 100644 index 00000000..978df1d4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_INT.badshift.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Shift operators not supported on all types + * + * SECTION: Types, Operators, and Expressions/Bitwise Operators + * + */ + +#pragma D option quiet + +BEGIN +{ + x = "char" << 2; + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badcond.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badcond.d new file mode 100644 index 00000000..2972ac23 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badcond.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Conditional expressions not supported on all types + * + * SECTION: Types, Operators, and Expressions/Conditional Expressions + * + */ + +#pragma D option quiet + +BEGIN +{ + a = "boo"; + c = "boo" ? "should": "fail"; + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badincop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badincop.d new file mode 100644 index 00000000..dfd5a315 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badincop.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Increment operators not supported on all types + * + * SECTION: Type and Constant Definitions/Enumerations + * + */ + +#pragma D option quiet + +BEGIN +{ + a = "boo"; + c = a++; + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badlogop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badlogop.d new file mode 100644 index 00000000..4f084c77 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_OP_SCALAR.badlogop.d @@ -0,0 +1,43 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Logical operators not supported on all types + * + * SECTION: Types, Operators, and Expressions/Logical Operators + * + */ + +#pragma D option quiet + +BEGIN +/"char" && "foo"/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_PROTO_LEN.badcond1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_PROTO_LEN.badcond1.d new file mode 100644 index 00000000..8e327509 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_PROTO_LEN.badcond1.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Conditional expressions do not accept tracing functions in + * the second or third expression + * + * SECTION: Types, Operators, and Expressions/Conditional Expressions + * + */ + +#pragma D option quiet + +BEGIN +{ + a = "boo"; + c = a == "boo" ? printf("error\n") : trace(); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badenum.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badenum.d new file mode 100644 index 00000000..3b537759 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badenum.d @@ -0,0 +1,40 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test a bogus enum declaration using an invalid identifer. + * + * SECTION: Type and Constant Definitions/Enumerations + */ + + +enum foo`bar +{ + +}; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badid.d new file mode 100644 index 00000000..a28182cd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badid.d @@ -0,0 +1,46 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Identifiers cannot begin with a digit + * + * SECTION: Types, Operators, and Expressions/Identifier Names and Keywords + */ + + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +int 0abc; + +BEGIN +{ + 0abc = 5; + printf("0abc is %d", 0abc); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badstruct.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badstruct.d new file mode 100644 index 00000000..6c57d215 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_SYNTAX.badstruct.d @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Attempt a bogus struct declaration using an invalid identifer. + * + * SECTION: Structs and Unions/Structs + */ + +struct foo`bar { + +}; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype1.d new file mode 100644 index 00000000..4f6d1e32 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype1.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invalid type name + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + * + */ + + +#pragma D option quiet + +dtrace:::BEGIN +{ + i = (long short)0; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype2.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype2.d new file mode 100644 index 00000000..f40e95f1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.badtype2.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Invalid type name + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + * + */ + + +#pragma D option quiet + +dtrace:::BEGIN +{ + i = (short long)0; + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupenum.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupenum.d new file mode 100644 index 00000000..2282f2d8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupenum.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Attempt a bogus enum declaration that contains duplicated enumerator names. + * + * SECTION: Type and Constant Definitions/Enumerations + */ + +enum foo { + x = 3, + x = 4 +}; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupstruct.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupstruct.d new file mode 100644 index 00000000..4102cd90 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_UNKNOWN.dupstruct.d @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Attempt a bogus struct declaration that contains duplicated member names. + * + * SECTION: Structs and Unions/Structs + */ + +struct foo { + int x; + char x; +}; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d new file mode 100644 index 00000000..f4e7dfd1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * An expression cannot evaluate to result of dynamic type. + * + * SECTION: Errtag/D_CG_DYN + */ + +#pragma D option quiet + +translator lwpsinfo_t < kthread_t *T > +{ + pr_flag = T->t_flag; + pr_lwpid = T->t_tid; +}; + +BEGIN +{ + xlate < lwpsinfo_t * > (curthread); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.assignops.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.assignops.d new file mode 100644 index 00000000..6bc27b09 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.assignops.d @@ -0,0 +1,82 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify assignment operators + * + * SECTION: Types, Operators, and Expressions/Assignment Operators + * + */ + +#pragma D option quiet + + +BEGIN +{ + int_1 = 0x100; + int_2 = 0xf0f0; + int_3 = 0x0f0f; + + intn = 0x1; + + intn += int_1; + printf("%x\n", intn); + intn -= int_1; + printf("%x\n", intn); + intn *= int_1; + printf("%x\n", intn); + intn /= int_1; + printf("%x\n", intn); + intn %= int_1; + printf("%x\n", intn); + printf("\n"); + + intb = 0x0000; + + intb |= (int_2 | intb); + printf("%x\n", intb); + intb &= (int_2 | int_3); + printf("%x\n", intb); + intb ^= (int_2 | int_3); + printf("%x\n", intb); + intb |= ~(intb); + printf("%x\n", intb); + printf("\n"); + + intb = int_2; + + printf("%x\n", intb); + intb <<= 3; + printf("%x\n", intb); + intb >>= 3; + printf("%x\n", intb); + + exit(0); + +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.badshiftops.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.badshiftops.d new file mode 100644 index 00000000..ac3c014e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.badshiftops.d @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Negative values and values greater than the LH operand are + * accepted. + * + * SECTION: Types, Operators, and Expressions/Bitwise Operators + */ + +#pragma D option quiet + + +BEGIN +{ + int_1 = 0xffff; + + nint = int_1 << -6; + printf("%x %x\n", int_1, nint); + nint = int_1 << 100; + printf("%x %x\n", int_1, nint); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.basics.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.basics.d new file mode 100644 index 00000000..8e762d5b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.basics.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test declaration processing of all the fundamental kinds of type + * declarations. Check their sizes. + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + */ + + +#pragma D option quiet + +BEGIN +{ + printf("\nsizeof (char) = %u\n", sizeof (char)); + printf("sizeof (signed char) = %u\n", sizeof (signed char)); + printf("sizeof (unsigned char) = %u\n", sizeof (unsigned char)); + printf("sizeof (short) = %u\n", sizeof (short)); + printf("sizeof (signed short) = %u\n", sizeof (signed short)); + printf("sizeof (unsigned short) = %u\n", sizeof (unsigned short)); + printf("sizeof (int) = %u\n", sizeof (int)); + printf("sizeof (signed int) = %u\n", sizeof (signed int)); + printf("sizeof (unsigned int) = %u\n", sizeof (unsigned int)); + printf("sizeof (long long) = %u\n", sizeof (long long)); + printf("sizeof (signed long long) = %u\n", sizeof (signed long long)); + printf("sizeof (unsigned long long) = %u\n", + sizeof (unsigned long long)); + printf("sizeof (float) = %u\n", sizeof (float)); + printf("sizeof (double) = %u\n", sizeof (double)); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.basics.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.basics.d.out new file mode 100644 index 00000000..fd05217f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.basics.d.out @@ -0,0 +1,16 @@ + +sizeof (char) = 1 +sizeof (signed char) = 1 +sizeof (unsigned char) = 1 +sizeof (short) = 2 +sizeof (signed short) = 2 +sizeof (unsigned short) = 2 +sizeof (int) = 4 +sizeof (signed int) = 4 +sizeof (unsigned int) = 4 +sizeof (long long) = 8 +sizeof (signed long long) = 8 +sizeof (unsigned long long) = 8 +sizeof (float) = 4 +sizeof (double) = 8 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.bitops.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.bitops.d new file mode 100644 index 00000000..fc643bab --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.bitops.d @@ -0,0 +1,62 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify relational operators with pointers + * + * SECTION: Types, Operators, and Expressions/Bitwise Operators + */ + +#pragma D option quiet + + +BEGIN +{ + int_1 = 0xffff; + int_2 = 0; + int_3 = 0x0f0f; + + + printf("%x %x %x\n", int_1 & int_2, int_1 & int_3, int_2 & int_3); + printf("%x %x %x\n", int_1 | int_2, int_1 | int_3, int_2 | int_3); + printf("%x %x %x\n", int_1 ^ int_2, int_1 ^ int_3, int_2 ^ int_3); + + printf("%x\n", int_1 & int_2 & int_3); + printf("%x\n", int_1 & int_2 ^ int_3); + printf("%x\n", int_1 & int_2 | int_3); + printf("%x\n", int_1 | int_2 & int_3); + printf("%x\n", int_1 | int_2 ^ int_3); + printf("%x\n", int_1 | int_2 | int_3); + printf("%x\n", int_1 ^ int_2 & int_3); + printf("%x\n", int_1 ^ int_2 ^ int_3); + printf("%x\n", int_1 ^ int_2 | int_3); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.charconstants.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.charconstants.d new file mode 100644 index 00000000..84aa61bf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.charconstants.d @@ -0,0 +1,68 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * verify the use of char constants + * + * SECTION: Types, Operators, and Expressions/Constants + * + */ + + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + + +BEGIN +{ + char_1 = 'a'; + char_2 = '\"'; + char_3 = '\"\ba'; + char_4 = '\?'; + char_5 = '\''; + char_6 = '\\'; + char_7 = '\0103'; + char_8 = '\x4E'; + char_9 = '\c'; /* Note - this is not an escape sequence */ + char_10 = 'ab\"d'; + char_11 = 'a\bcdefgh'; + + printf("decimal value = %d; character value = %c\n", char_1, char_1); + printf("decimal value = %d; character value = %c\n", char_2, char_2); + printf("decimal value = %d; character value = %c\n", char_3, char_3); + printf("decimal value = %d; character value = %c\n", char_4, char_4); + printf("decimal value = %d; character value = %c\n", char_5, char_5); + printf("decimal value = %d; character value = %c\n", char_6, char_6); + printf("decimal value = %d; character value = %c\n", char_7, char_7); + printf("decimal value = %d; character value = %c\n", char_8, char_8); + printf("decimal value = %d; character value = %c\n", char_9, char_9); + printf("decimal value = %d; character value = %c\n", char_10, char_10); + printf("decimal value = %d\n", char_11); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.complex.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.complex.d new file mode 100644 index 00000000..a912670a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.complex.d @@ -0,0 +1,74 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Test a complex structure and verify that tracemem can be used to + * look at it. + * + * SECTION: Structs and Unions/Structs; + * Actions and Subroutines/tracemem() + */ + + + +#pragma D option quiet + +struct s { + int i; + char c; + double d; + float f; + long l; + long long ll; + union sigval u; + enum uio_rw e; + struct vnode s; + struct s1 { + int i; + char c; + double d; + float f; + long l; + long long ll; + union sigval u; + enum uio_rw e; + struct vnode s; + } sx; + int a[2]; + int *p; + int *ap[4]; + int (*fp)(); + int (*afp[2])(); +}; + +BEGIN +{ + tracemem(curthread, sizeof (struct s)); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.condexpr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.condexpr.d new file mode 100644 index 00000000..fe23a73b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.condexpr.d @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * positive check conditional expressions + * + * SECTION: Types, Operators, and Expressions/Conditional Expressions + * + * NOTES: these tests are from the User's Guide + */ + +#pragma D option quiet + + +BEGIN +{ + i = 0; + x = i == 0 ? "zero" : "non-zero"; + + c = 'd'; + hexval = (c >= '0' && c <= '9') ? c - '0': + (c >= 'a' && c <= 'z') ? c + 10 - 'a' : c + 10 - 'A'; +} + +tick-1 +/x == "zero" && hexval == 13/ +{ + exit(0); +} + +tick-1 +/x != "zero" || hexval != 13/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.constants.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.constants.d new file mode 100644 index 00000000..101bb8b8 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.constants.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * verify that integer constants can be written in decimal + * octal or hexadecimal + * + * SECTION: Types, Operators, and Expressions/Constants + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + + +BEGIN +{ + decimal = 12345; + octal = 012345; + hexadecimal_1 = 0x12345; + hexadecimal_2 = 0X12345; + + printf("%d %d %d %d", decimal, octal, hexadecimal_1, hexadecimal_2); + printf("%d %o %x %x", decimal, octal, hexadecimal_1, hexadecimal_2); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.conv.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.conv.d new file mode 100644 index 00000000..90204245 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.conv.d @@ -0,0 +1,109 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * positive type conversion checks + * + * SECTION: Types, Operators, and Expressions/Type Conversions + * + * NOTES: not all type conversions are checked. A lot of this section + * is tested within other tests. + */ + +#pragma D option quiet + +unsigned int i; +char c; +short s; +long l; +long long ll; + +BEGIN +{ +/* char -> int */ + c = 'A'; + i = c; + printf("c is %c i is %d\n", c, i); + +/* int -> char */ + + i = 1601; + c = i; + printf("i is %d c is %c\n", i, c); + +/* char -> short */ + c = 'A'; + s = c; + printf("c is %c s is %d\n", c, s); + +/* short -> char */ + + s = 1601; + c = s; + printf("s is %d c is %c\n", s, c); + +/* int -> short */ + + i = 1601; + s = i; + printf("i is %d s is %d\n", i, s); + +/* short -> int */ + + s = 1601; + i = s; + printf("s is %d i is %d\n", s, i); + +/* int -> long long */ + + i = 4294967295; + ll = i; + printf("i is %d ll is %x\n", i, ll); + +/* long long -> int */ + + ll = 8589934591; + i = ll; + printf("ll is %d i is %x\n", ll, i); + +/* char -> long long */ + + c = 'A'; + ll = c; + printf("c is %c ll is %x\n", c, ll); + +/* long long -> char */ + + ll = 8589934401; + c = ll; + printf("ll is %x c is %c\n", ll, c); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.enum.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.enum.d new file mode 100644 index 00000000..49a97bff --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.enum.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Positive enumeration test + * + * SECTION: Type and Constant Definitions/Enumerations + */ + +#pragma D option quiet + +enum my_enum { + zero, + one = 1, + two, + three, + four = 4, + minimum = -2147483648, + maximum = 2147483647 +}; + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.intincop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.intincop.d new file mode 100644 index 00000000..77eb7025 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.intincop.d @@ -0,0 +1,70 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify increment operator using integers + * + * SECTION: Type and Constant Definitions/Enumerations + * + */ + +#pragma D option quiet + + +BEGIN +{ + int_orig = 100; + int_pos = 100+1; + int_neg = 100-1; + + int_pos_before = ++int_orig; + int_orig = 100; + int_neg_before = --int_orig; + int_orig = 100; + int_pos_after = int_orig++; + int_orig = 100; + int_neg_after = int_orig--; + int_orig = 100; + +} + +tick-1 +/int_pos_before == int_pos && int_neg_before == int_neg && + int_pos_after == int_orig && int_pos_after == int_orig/ +{ + exit(0); +} + + +tick-1 +/int_pos_before != int_pos || int_neg_before != int_neg || + int_pos_after != int_orig || int_pos_after != int_orig/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.intops.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.intops.d new file mode 100644 index 00000000..a3744804 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.intops.d @@ -0,0 +1,70 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify relational operators with integers + * + * SECTION: Types, Operators, and Expressions/Relational Operators; + * Types, Operators, and Expressions/Precedence + * + */ + +#pragma D option quiet + + +BEGIN +{ + int_1 = 0x100; + int_2 = 0x101; + int_3 = 0x99; +} + +tick-1 +/int_1 >= int_2 || int_2 <= int_1 || int_1 == int_2/ +{ + printf("Shouldn't end up here (1)\n"); + printf("int_1 = %x int_2 = %x int_3 = %x\n", + (int) int_1, (int) int_2, (int) int_3); + exit(1); +} + +tick-1 +/int_3 > int_1 || int_1 < int_3 || int_3 == int_1/ +{ + printf("Shouldn't end up here (2)\n"); + printf("int_1 = %x int_2 = %x int_3 = %x\n", + (int) int_1, (int) int_2, (int) int_3); + exit(1); +} + +tick-1 +/int_2 > int_3 && int_1 < int_2 ^^ int_3 == int_2 && !(int_1 != int_2)/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.inttypes.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.inttypes.d new file mode 100644 index 00000000..80bfa1f2 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.inttypes.d @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Verify integer type aliases + * + * SECTION: Types, Operators, and Expressions/Data Types and Sizes + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + + +BEGIN +{ + printf("sizeof (int8_t) = %u\n", sizeof (int8_t)); + printf("sizeof (int16_t) = %u\n", sizeof (int16_t)); + printf("sizeof (int32_t) = %u\n", sizeof (int32_t)); + printf("sizeof (int64_t) = %u\n", sizeof (int64_t)); + printf("sizeof (intptr_t) = %u\n", sizeof (intptr_t)); + printf("sizeof (uint8_t) = %u\n", sizeof (uint8_t)); + printf("sizeof (uint16_t) = %u\n", sizeof (uint16_t)); + printf("sizeof (uint32_t) = %u\n", sizeof (uint32_t)); + printf("sizeof (uint64_t) = %u\n", sizeof (uint64_t)); + printf("sizeof (uintptr_t) = %u\n", sizeof (uintptr_t)); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.ptrincop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.ptrincop.d new file mode 100644 index 00000000..0fdd561a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.ptrincop.d @@ -0,0 +1,72 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify increment/decrement operator using pointers + * + * SECTION: Types, Operators, and Expressions/Increment and Decrement Operators + * + */ + +#pragma D option quiet + + +BEGIN +{ + ptr_orig = &`kmem_flags; + ptr_pos = &`kmem_flags+1; + ptr_neg = &`kmem_flags-1; + + ptr_pos_before = ++ptr_orig; + ptr_orig = &`kmem_flags; + ptr_neg_before = --ptr_orig; + + ptr_orig = &`kmem_flags; + ptr_pos_after = ptr_orig++; + ptr_orig = &`kmem_flags; + ptr_neg_after = ptr_orig--; + ptr_orig = &`kmem_flags; + +} + +tick-1 +/ptr_pos_before == ptr_pos && ptr_neg_before == ptr_neg && + ptr_pos_after == ptr_orig && ptr_pos_after == ptr_orig/ +{ + exit(0); +} + + +tick-1 +/ptr_pos_before != ptr_pos || ptr_neg_before != ptr_neg || + ptr_pos_after != ptr_orig || ptr_pos_after != ptr_orig/ +{ + exit(1); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.ptrops.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.ptrops.d new file mode 100644 index 00000000..d4144b09 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.ptrops.d @@ -0,0 +1,71 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify relational operators with pointers + * + * SECTION: Types, Operators, and Expressions/Relational Operators; + * Types, Operators, and Expressions/Logical Operators; + * Types, Operators, and Expressions/Precedence + * + */ + +#pragma D option quiet + + +BEGIN +{ + ptr_1 = &`kmem_flags; + ptr_2 = (&`kmem_flags) + 1; + ptr_3 = (&`kmem_flags) - 1 ; +} + +tick-1 +/ptr_1 >= ptr_2 || ptr_2 <= ptr_1 || ptr_1 == ptr_2/ +{ + printf("Shouldn't end up here (1)\n"); + printf("ptr_1 = %x ptr_2 = %x ptr_3 = %x\n", + (int) ptr_1, (int) ptr_2, (int) ptr_3); + exit(1); +} + +tick-1 +/ptr_3 > ptr_1 || ptr_1 < ptr_3 || ptr_3 == ptr_1/ +{ + printf("Shouldn't end up here (2)\n"); + printf("ptr_1 = %x ptr_2 = %x ptr_3 = %x\n", + (int) ptr_1, (int) ptr_2, (int) ptr_3); + exit(1); +} + +tick-1 +/ptr_3 > ptr_2 || ptr_1 < ptr_2 ^^ ptr_3 == ptr_2 && !(ptr_1 != ptr_2)/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.relenum.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.relenum.d new file mode 100644 index 00000000..8fa6d585 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.relenum.d @@ -0,0 +1,73 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify relational operators with enumerations + * + * SECTION: Types, Operators, and Expressions/Relational Operators + * + */ + +#pragma D option quiet + +enum numbers_1 { + zero, + one, + two +}; + +enum numbers_2 { + null, + first, + second +}; + +tick-1 +/zero >= one || second <= first || zero == second/ +{ + printf("Shouldn't end up here (1)\n"); + printf("zero = %d; one = %d; two = %d", zero, one, two); + printf("null = %d; first = %d; second = %d", null, first, second); + exit(1); +} + +tick-1 +/second < one || two > second || null == first/ +{ + printf("Shouldn't end up here (2)\n"); + printf("zero = %d; one = %d; two = %d", zero, one, two); + printf("null = %d; first = %d; second = %d", null, first, second); + exit(1); +} + +tick-1 +/first < two && second > one && one != two && zero != first/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.relstring.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.relstring.d new file mode 100644 index 00000000..9e9ef29d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.relstring.d @@ -0,0 +1,70 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify relational operators with strings + * + * SECTION: Types, Operators, and Expressions/Relational Operators + * + */ + +#pragma D option quiet + + +BEGIN +{ + string_1 = "abcde"; + string_2 = "aabcde"; + string_3 = "abcdef"; +} + +tick-1 +/string_1 <= string_2 || string_2 >= string_1 || string_1 == string_2/ +{ + printf("Shouldn't end up here (1)\n"); + printf("string_1 = %s string_2 = %s string_3 = %s\n", + string_1, string_2, string_3); + exit(1); +} + +tick-1 +/string_3 < string_1 || string_1 > string_3 || string_3 == string_1/ +{ + printf("Shouldn't end up here (2)\n"); + printf("string_1 = %s string_2 = %s string_3 = %s n", + string_1, string_2, string_3); + exit(1); +} + +tick-1 +/string_3 > string_1 && string_1 > string_2 && + string_1 != string_2 && string_2 != string_3/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.shiftops.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.shiftops.d new file mode 100644 index 00000000..a2602385 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.shiftops.d @@ -0,0 +1,62 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify shift operators + * + * SECTION: Types, Operators, and Expressions/Bitwise Operators; + * Types, Operators, and Expressions/Precedence + */ + +#pragma D option quiet + + +BEGIN +{ + int_1 = 0xffff; + + nint = (((((((((((int_1 << 2 >> 2) << 3 >> 3) << 4 >> 4) << 5 >> 5) + << 6 >> 6) << 7 >> 7) << 8 >>8) << 9 >> 9) << 10 >> 10) + << 11 >> 11) << 12 >> 12); + +} + +tick-1 +/nint != int_1/ +{ + printf("Unexpected error nint = %x, expected %x\n", nint, int_1); + exit(1); +} + +tick-1 +/nint == int_1/ +{ + exit(0); + +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.stringconstants.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.stringconstants.d new file mode 100644 index 00000000..9fa08056 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.stringconstants.d @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * verify the use of char type + * + * SECTION: Types, Operators, and Expressions/Constants + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +string string_1; + +BEGIN +{ + string_1 = "abcd\n\n\nefg"; + string_2 = "abc\"\t\044\?\x4D"; + string_3 = "\?\\\'\"\0"; + + printf("string_1 = %s\n", string_1); + printf("string_2 = %s\n", string_2); + printf("string_3 = %s\n", string_3); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.struct.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.struct.d new file mode 100644 index 00000000..86610f63 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.struct.d @@ -0,0 +1,84 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Declare a dynamic type and then use it to copyin the first 3 environment + * variable pointers from the current process. + * + * SECTION: Structs and Unions/Structs; + * Actions and Subroutines/copyin(); + * Actions and Subroutines/copyinstr(); + * Variables/External Variables + * + * NOTES: + * This test program declares a dynamic type and then uses it to copyin the + * first three environment variable pointers from the current process. We + * then use the dynamic type to access the result of our copyin(). The + * special "D" module type scope is also tested. + */ + +#pragma D option quiet + +struct env_vars_32 { + uint32_t e1; + uint32_t e2; + uint32_t e3; +}; + +struct env_vars_64 { + uint64_t e1; + uint64_t e2; + uint64_t e3; +}; + +BEGIN +/curpsinfo->pr_dmodel == PR_MODEL_ILP32/ +{ + e32 = (struct D`env_vars_32 *) + copyin(curpsinfo->pr_envp, sizeof (struct D`env_vars_32)); + + printf("e1 = \"%s\"\n", stringof(copyinstr(e32->e1))); + printf("e2 = \"%s\"\n", stringof(copyinstr(e32->e2))); + printf("e3 = \"%s\"\n", stringof(copyinstr(e32->e3))); + + exit(0); +} + +BEGIN +/curpsinfo->pr_dmodel == PR_MODEL_LP64/ +{ + e64 = (struct D`env_vars_64 *) + copyin(curpsinfo->pr_envp, sizeof (struct D`env_vars_64)); + + printf("e1 = \"%s\"\n", stringof(copyinstr(e64->e1))); + printf("e2 = \"%s\"\n", stringof(copyinstr(e64->e2))); + printf("e3 = \"%s\"\n", stringof(copyinstr(e64->e3))); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.typedef.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.typedef.d new file mode 100644 index 00000000..aabfc9ba --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.typedef.d @@ -0,0 +1,85 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Declares a dynamic type and then uses it to copyin the first three + * environment variable pointers from the current process. + * + * SECTION: Structs and Unions/Structs; + * Actions and Subroutines/copyin(); + * Actions and Subroutines/copyinstr(); + * Variables/External Variables + * + * NOTES: + * This test program declares a dynamic type and then uses it to copyin the + * first three environment variable pointers from the current process. We + * then use the dynamic type to access the result of our copyin(). The + * special "D" module type scope is also tested. This is similar to our + * struct declaration test but here we use a typedef. + */ + +#pragma D option quiet + +typedef struct env_vars_32 { + uint32_t e1; + uint32_t e2; + uint32_t e3; +} env_vars_32_t; + +typedef struct env_vars_64 { + uint64_t e1; + uint64_t e2; + uint64_t e3; +} env_vars_64_t; + +BEGIN +/curpsinfo->pr_dmodel == PR_MODEL_ILP32/ +{ + e32 = (D`env_vars_32_t *) + copyin(curpsinfo->pr_envp, sizeof (D`env_vars_32_t)); + + printf("e1 = \"%s\"\n", stringof(copyinstr(e32->e1))); + printf("e2 = \"%s\"\n", stringof(copyinstr(e32->e2))); + printf("e3 = \"%s\"\n", stringof(copyinstr(e32->e3))); + + exit(0); +} + +BEGIN +/curpsinfo->pr_dmodel == PR_MODEL_LP64/ +{ + e64 = (D`env_vars_64_t *) + copyin(curpsinfo->pr_envp, sizeof (D`env_vars_64_t)); + + printf("e1 = \"%s\"\n", stringof(copyinstr(e64->e1))); + printf("e2 = \"%s\"\n", stringof(copyinstr(e64->e2))); + printf("e3 = \"%s\"\n", stringof(copyinstr(e64->e3))); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.unaryop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.unaryop.d new file mode 100644 index 00000000..b9938e4f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/types/tst.unaryop.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify unary operator + * + * SECTION: Types, Operators, and Expressions/Bitwise Operators + */ + +#pragma D option quiet + + +BEGIN +{ + int_1 = 0xffff; + int_2 = 0; + int_3 = 0x0f0f; + + printf("%x %x %x\n", int_1, int_2, int_3); + printf("%x %x %x\n", ~int_1, ~int_2, ~int_3); + printf("%x %x %x\n", ~~int_1, ~~int_2, ~~int_3); + printf("%x %x %x\n", ~~~int_1, ~~~int_2, ~~~int_3); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_ADDROF_VAR.UnionPointer.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_ADDROF_VAR.UnionPointer.d new file mode 100644 index 00000000..0a292cde --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_ADDROF_VAR.UnionPointer.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Trying to access the members of a user defined union by means of + * a pointer to it should throw a D_ADDROF_VAR compiler error. + * + * SECTION: Structs and Unions/Pointers to Structs + * + */ + +#pragma D option quiet + +union record { + int position; + int content; + +}; + +union record var; +union record *ptr; + +BEGIN +{ + + var.position = 1; + var.content = 'a'; + + ptr = &var; + + printf("ptr->position: %d\tptr->content: %c\n", + ptr->position, ptr->content); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon.d new file mode 100644 index 00000000..4adb36e9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon.d @@ -0,0 +1,69 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Combining multiple union definitions in a single line should throw a + * compiler error. + * + * SECTION: Structs and Unions/Unions + * + */ + +#pragma D option quiet + +union record { + int position; + char content; +} + + +union pirate { + int position; + char content; +}; + +union superStruct super; +union record rec; +union pirate pir; + +BEGIN +{ + rec.content = 'a'; + rec.position = 1; + + pir.content = 'b'; + pir.position = 2; + + printf( + "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d", + rec.content, rec.position, pir.content, pir.position); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon1.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon1.d new file mode 100644 index 00000000..5506a976 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_COMBO.UnionWithoutColon1.d @@ -0,0 +1,68 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Combining multiple union definitions in a single line should throw a + * compiler error. + * + * SECTION: Structs and Unions/Unions + * + */ + +#pragma D option quiet + +union record { + int position; + char content; +}; + + +union pirate { + int position; + char content; +} + +union record rec; +union pirate pir; + +BEGIN +{ + rec.content = 'a'; + rec.position = 1; + + pir.content = 'b'; + pir.position = 2; + + printf( + "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d", + rec.content, rec.position, pir.content, pir.position); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.circular.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.circular.d new file mode 100644 index 00000000..ae6e647f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.circular.d @@ -0,0 +1,65 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * A circular definition of unions (two unions defining each other as + * members) should throw an error at compile time. + * + * SECTION: Structs and Unions/Unions + * + */ + +#pragma D option quiet + +union record { + union pirate p; + int position; + char content; +}; + + +union pirate { + union record r; + int position; + char content; +}; + +union record rec; +union pirate pir; + +BEGIN +{ + rec.position = 0; + rec.content = 'a'; + printf( + "rec.position: %d\nrec.content: %c\n", rec.position, rec.content); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.order.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.order.d new file mode 100644 index 00000000..9e2ec69f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.order.d @@ -0,0 +1,69 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * When two unions are defined such that one of them contains the other, the + * inner union has to be defined first. + * + * SECTION: Structs and Unions/Unions + * + */ + +#pragma D option quiet + + +union record { + union pirate p; + int position; + char content; +}; + +union pirate { + int position; + char content; +}; + +union record rec; +union pirate pir; + +BEGIN +{ + rec.content = 'y'; + rec.position = 2; + + pir.content = 'z'; + pir.position = 26; + + printf( + "rec.content: %c\nrec.position: %d\npir.content: %c\npir.position: %d", + rec.content, rec.position, pir.content, pir.position); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.recursive.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.recursive.d new file mode 100644 index 00000000..2a86b9cd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.recursive.d @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Recursive naming of unions should produce compiler error. + * + * SECTION: Structs and Unions/Unions + * + */ + +#pragma D option quiet + +union record { + union record rec; + int position; + char content; +}; + +union record r1; +union record r2; + +BEGIN +{ + r1.position = 1; + r1.content = 'a'; + + r2.position = 2; + r2.content = 'b'; + + printf("r1.position: %d\nr1.content: %c\n", r1.position, r1.content); + printf("r2.position: %d\nr2.content: %c\n", r2.position, r2.content); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.simple.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.simple.d new file mode 100644 index 00000000..781d7266 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_DECL_INCOMPLETE.simple.d @@ -0,0 +1,58 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Declaring an inner union without defining it else where should throw + * a compiler error. + * + * SECTION: Structs and Unions/Unions + * + */ +#pragma D option quiet + + +union record { + union pirate p; + int position; + char content; +}; + + +union record rec; + +BEGIN +{ + rec.position = 0; + rec.content = 'a'; + printf("rec.position: %d\nrec.content: %c\n", + rec.position, rec.content); + + exit(0); +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_PROTO_ARG.DupUnionAssoc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_PROTO_ARG.DupUnionAssoc.d new file mode 100644 index 00000000..f9187412 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/err.D_PROTO_ARG.DupUnionAssoc.d @@ -0,0 +1,80 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Declaring an associative array with a union to be its key type and trying to + * index with another union having the same composition throws an error. + * + * SECTION: Structs and Unions/Unions + * + */ + +#pragma D option quiet + +union record { + int position; + char content; +}; + +union pirate { + int position; + char content; +}; + +union record r1; +union record r2; +union pirate p1; +union pirate p2; + +BEGIN +{ + r1.position = 1; + r1.content = 'a'; + + r2.position = 2; + r2.content = 'b'; + + p1.position = 1; + p1.content = 'a'; + + p2.position = 2; + p2.content = 'b'; + + assoc_array[r1] = 1000; + assoc_array[r2] = 2000; + assoc_array[p1] = 3333; + assoc_array[p2] = 4444; + + printf("assoc_array[r1]: %d\n", assoc_array[r1]); + printf("assoc_array[r2]: %d\n", assoc_array[r2]); + printf("assoc_array[p1]: %d\n", assoc_array[p1]); + printf("assoc_array[p2]: %d\n", assoc_array[p2]); + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionAssoc.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionAssoc.d new file mode 100644 index 00000000..882b6ae0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionAssoc.d @@ -0,0 +1,71 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * When a union is used as a key for an associative array, the key is formed + * by using the values of the members of the union variable and not the + * address of the union variable. + * + * SECTION: Structs and Unions/Unions + * + */ + +#pragma D option quiet + +union record { + int position; + char content; +}; + +union record r1; +union record r2; + +BEGIN +{ + r1.position = 1; + r1.content = 'a'; + + r2.position = 1; + r2.content = 'a'; + + assoc_array[r1] = 1000; + assoc_array[r2] = 2000; + + printf("assoc_array[r1]: %d\n", assoc_array[r1]); + printf("assoc_array[r2]: %d\n", assoc_array[r2]); + + exit(0); +} + +END +/assoc_array[r1] != assoc_array[r2]/ +{ + printf("Error"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionDataTypes.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionDataTypes.d new file mode 100644 index 00000000..d5d292d1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionDataTypes.d @@ -0,0 +1,132 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Declaration of the different data types within a union and + * their definitions in a later clause should work fine. + * + * SECTION: Structs and Unions/Unions + * + * NOTES: The floats, doubles and strings have not been implemented yet. + * When they do, appropriate lines in the code below should be uncommented. + * Similarly, the lines with the kmem_flags pointer assignment should be + * uncommented when the issues pertaining to it are clarified. + * + */ + +#pragma D option quiet + +union record { + char new_char; + short new_short; + int new_int; + long new_long; + long long new_long_long; + int8_t new_int8; + int16_t new_int16; + int32_t new_int32; + int64_t new_int64; + intptr_t new_intptr; + uint8_t new_uint8; + uint16_t new_uint16; + uint32_t new_uint32; + uint64_t new_uint64; + uintptr_t new_uintptr; + + /*float new_float; + double new_double; + long double new_long_double; + + string new_string; + */ + + struct { + char ch; + int in; + long lg; + } new_struct; + + union { + char ch; + int in; + long lg; + } new_union; + +enum { + RED, + GREEN, + BLUE +} new_enum; + + + int *pointer; +} var; + +/* + var.pointer = &`kmem_flags; +*/ +BEGIN +{ + var.new_char = 'c'; + var.new_short = 10; + var.new_int = 100; + var.new_long = 1234567890; + var.new_long_long = 1234512345; + var.new_int8 = 'p'; + var.new_int16 = 20; + var.new_int32 = 200; + var.new_int64 = 2000000; + var.new_intptr = 0x12345; + var.new_uint8 = 'q'; + var.new_uint16 = 30; + var.new_uint32 = 300; + var.new_uint64 = 3000000; + var.new_uintptr = 0x67890; + + /* var.new_float = 1.23456; + var.new_double = 2.34567890; + var.new_long_double = 3.567890123; + + var.new_string = "hello"; + */ + + /* + var.pointer = &`kmem_flags; + */ + + var.new_struct.ch = 'c'; + var.new_struct.in = 4; + var.new_struct.lg = 4; + + var.new_union.ch = 'd'; + var.new_union.in = 5; + var.new_union.lg = 5; + + + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionInside.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionInside.d new file mode 100644 index 00000000..9569002b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/union/tst.UnionInside.d @@ -0,0 +1,85 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Verify the nested behavior of unions. + * + * SECTION: Structs and Unions/Unions + * + */ +#pragma D option quiet + +union InnerMost { + int position; + char content; +}; + +union InnerMore { + union InnerMost IMost; + int dummy_More; +}; + +union Inner { + union InnerMore IMore; + int dummy_More; +}; + +union Outer { + union Inner I; + int dummy_More; +}; + +union OuterMore { + union Outer O; + int dummy_More; +}; + +union OuterMost { + union OuterMore OMore; + int dummy_More; +} OMost; + + +BEGIN +{ + + OMost.OMore.O.I.IMore.IMost.position = 5; + OMost.OMore.O.I.IMore.IMost.content = 'e'; + + printf("OMost.OMore.O.I.IMore.IMost.content: %c\n", + OMost.OMore.O.I.IMore.IMost.content); + + exit(0); +} + +END +/'e' != OMost.OMore.O.I.IMore.IMost.content/ +{ + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/argmap.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/argmap.d new file mode 100644 index 00000000..0a1c3609 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/argmap.d @@ -0,0 +1,31 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +provider test_prov { + probe place(int i, int j) : (int j, int i, int i, int j); +}; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/args.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/args.d new file mode 100644 index 00000000..a11984c1 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/args.d @@ -0,0 +1,31 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +provider test_prov { + probe place(int i, int j); +}; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/forker.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/forker.d new file mode 100644 index 00000000..f63b965d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/forker.d @@ -0,0 +1,31 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +provider forker { + probe fire(); +}; diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.andpid.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.andpid.ksh new file mode 100644 index 00000000..2096422b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.andpid.ksh @@ -0,0 +1,46 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -c date -s /dev/stdin <<EOF +plockstat\$target::mutex_lock_impl:, +pid\$target::mutex_lock_impl: +{} +EOF + +if [ $? -ne 0 ]; then + print -u2 "dtrace failed" + exit 1 +fi + +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.argmap.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.argmap.c new file mode 100644 index 00000000..5697ef51 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.argmap.c @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <sys/sdt.h> + +int +main(int argc, char **argv) +{ + for (;;) { + DTRACE_PROBE2(test_prov, place, 10, 4); + } + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.argmap.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.argmap.d new file mode 100644 index 00000000..fd9f9f47 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.argmap.d @@ -0,0 +1,65 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: Verify that argN and args[N] variables are properly remapped. + */ + +BEGIN +{ + /* Timeout after 5 seconds */ + timeout = timestamp + 5000000000; +} + +test_prov$1:::place +/arg0 != 4 || arg1 != 10 || arg2 != 10 || arg3 != 4/ +{ + printf("args are %d, %d, %d, %d; should be 4, 10, 10, 4", + arg0, arg1, arg2, arg3); + exit(1); +} + +test_prov$1:::place +/args[0] != 4 || args[1] != 10 || args[2] != 10 || args[3] != 4/ +{ + printf("args are %d, %d, %d, %d; should be 4, 10, 10, 4", + args[0], args[1], args[2], args[3]); + exit(1); +} + +test_prov$1:::place +{ + exit(0); +} + +profile:::tick-1 +/timestamp > timeout/ +{ + trace("test timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.args.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.args.c new file mode 100644 index 00000000..5697ef51 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.args.c @@ -0,0 +1,39 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <sys/sdt.h> + +int +main(int argc, char **argv) +{ + for (;;) { + DTRACE_PROBE2(test_prov, place, 10, 4); + } + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.args.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.args.d new file mode 100644 index 00000000..bb74e80f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.args.d @@ -0,0 +1,60 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * + * SECTION: + * + * NOTES: + * + */ +BEGIN +{ + /* Timeout after 5 seconds */ + timeout = timestamp + 5000000000; +} + +test_prov$1:::place +/arg0 == 10 && arg1 == 4/ +{ + exit(0); +} + +test_prov$1:::place +{ + printf("args are %d, %d; should be 10, 4", arg0, arg1); + exit(1); +} + +profile:::tick-1 +/timestamp > timeout/ +{ + trace("test timed out"); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh new file mode 100644 index 00000000..291fe83f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh @@ -0,0 +1,84 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <sys/types.h> +#include "prov.h" + +int +main(int argc, char **argv) +{ + if (TEST_PROV_GO_ENABLED()) { + TEST_PROV_GO(); + } +} +EOF + +cc -xarch=generic64 -c -o test64.o test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c 64-bit" + exit 1 +fi +cc -xarch=generic -c -o test32.o test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c 32-bit" + exit 1 +fi + +$dtrace -G -s prov.d test32.o test64.o +if [ $? -eq 0 ]; then + print -u2 "DOF generation failed to generate a warning" + exit 1 +fi + +cd / +/usr/bin/rm -rf $DIR + +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh new file mode 100644 index 00000000..68dbb034 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh @@ -0,0 +1,107 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# This test verifies that a program that corrupts its own environment +# without inducing a crash does not crash solely due to drti.o's use of +# getenv(3C). +# + +PATH=/usr/bin:/usr/sbin:$PATH + +if (( $# != 1 )); then + print -u2 'expected one argument: <dtrace-path>' + exit 2 +fi + +# +# jdtrace does not implement the -h option that is required to generate +# C header files. +# +if [[ "$1" == */jdtrace ]]; then + exit 0 +fi + +dtrace="$1" +startdir="$PWD" +dir=$(mktemp -td drtiXXXXXX) +if (( $? != 0 )); then + print -u2 'Could not create safe temporary directory' + exit 2 +fi + +cd "$dir" + +cat > Makefile <<EOF +all: main + +main: main.o prov.o + \$(CC) -o main main.o prov.o + +main.o: main.c prov.h + \$(CC) -c main.c + +prov.h: prov.d + $dtrace -h -s prov.d + +prov.o: prov.d main.o + $dtrace -G -32 -s prov.d main.o +EOF + +cat > prov.d <<EOF +provider tester { + probe entry(); +}; +EOF + +cat > main.c <<EOF +#include <stdlib.h> +#include <sys/sdt.h> +#include "prov.h" + +int +main(int argc, char **argv, char **envp) +{ + envp[0] = (char*)0xff; + TESTER_ENTRY(); + return 0; +} +EOF + +make > /dev/null +status=$? +if (( $status != 0 )) ; then + print -u2 "failed to build" +else + ./main + status=$? +fi + +cd "$startdir" +rm -rf "$dir" + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh new file mode 100755 index 00000000..0a666662 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh @@ -0,0 +1,159 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This test verifies that USDT providers are removed when its associated +# load object is closed via dlclose(3dl). +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > Makefile <<EOF +all: main livelib.so deadlib.so + +main: main.o prov.o + cc -o main main.o + +main.o: main.c + cc -c main.c + + +livelib.so: livelib.o prov.o + cc -z defs -G -o livelib.so livelib.o prov.o -lc + +livelib.o: livelib.c prov.h + cc -c livelib.c + +prov.o: livelib.o prov.d + $dtrace -G -s prov.d livelib.o + +prov.h: prov.d + $dtrace -h -s prov.d + + +deadlib.so: deadlib.o + cc -z defs -G -o deadlib.so deadlib.o -lc + +deadlib.o: deadlib.c + cc -c deadlib.c + +clean: + rm -f main.o livelib.o prov.o prov.h deadlib.o + +clobber: clean + rm -f main livelib.so deadlib.so +EOF + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +cat > livelib.c <<EOF +#include "prov.h" + +void +go(void) +{ + TEST_PROV_GO(); +} +EOF + +cat > deadlib.c <<EOF +void +go(void) +{ +} +EOF + + +cat > main.c <<EOF +#include <dlfcn.h> +#include <unistd.h> +#include <stdio.h> + +int +main(int argc, char **argv) +{ + void *live; + + if ((live = dlopen("./livelib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) { + printf("dlopen of livelib.so failed: %s\n", dlerror()); + return (1); + } + + (void) dlclose(live); + + pause(); + + return (0); +} +EOF + +/usr/ccs/bin/make > /dev/null +if [ $? -ne 0 ]; then + print -u2 "failed to build" + exit 1 +fi + +script() { + $dtrace -w -x bufsize=1k -c ./main -qs /dev/stdin <<EOF + syscall::pause:entry + /pid == \$target/ + { + system("$dtrace -l -P test_prov*"); + system("kill %d", \$target); + exit(0); + } + + tick-1s + /i++ == 5/ + { + printf("failed\n"); + exit(1); + } +EOF +} + +script 2>&1 +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh.out new file mode 100644 index 00000000..2f5bb15f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh.out @@ -0,0 +1,3 @@ +dtrace: failed to match test_prov*:::: No probe matches description + ID PROVIDER MODULE FUNCTION NAME + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh new file mode 100755 index 00000000..c83d8bfa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh @@ -0,0 +1,160 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > Makefile <<EOF +all: main livelib.so deadlib.so + +main: main.o prov.o + cc -o main main.o + +main.o: main.c + cc -c main.c + + +livelib.so: livelib.o prov.o + cc -z defs -G -o livelib.so livelib.o prov.o -lc + +livelib.o: livelib.c prov.h + cc -c livelib.c + +prov.o: livelib.o prov.d + $dtrace -G -s prov.d livelib.o + +prov.h: prov.d + $dtrace -h -s prov.d + + +deadlib.so: deadlib.o + cc -z defs -G -o deadlib.so deadlib.o -lc + +deadlib.o: deadlib.c + cc -c deadlib.c + +clean: + rm -f main.o livelib.o prov.o prov.h deadlib.o + +clobber: clean + rm -f main livelib.so deadlib.so +EOF + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +cat > livelib.c <<EOF +#include "prov.h" + +void +go(void) +{ + TEST_PROV_GO(); +} +EOF + +cat > deadlib.c <<EOF +void +go(void) +{ +} +EOF + + +cat > main.c <<EOF +#include <dlfcn.h> +#include <unistd.h> +#include <stdio.h> + +int +main(int argc, char **argv) +{ + void *live, *dead; + void *go; + + if ((live = dlopen("./livelib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) { + printf("dlopen of livelib.so failed: %s\n", dlerror()); + return (1); + } + + (void) dlclose(live); + + if ((dead = dlopen("./deadlib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) { + printf("dlopen of deadlib.so failed: %s\n", dlerror()); + return (1); + } + + if ((live = dlopen("./livelib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) { + printf("dlopen of livelib.so failed: %s\n", dlerror()); + return (1); + } + + if ((go = dlsym(live, "go")) == NULL) { + printf("failed to lookup 'go' in livelib.so\n"); + return (1); + } + + ((void (*)(void))go)(); + + return (0); +} +EOF + +/usr/ccs/bin/make > /dev/null +if [ $? -ne 0 ]; then + print -u2 "failed to build" + exit 1 +fi + +script() { + $dtrace -w -c ./main -Zqs /dev/stdin <<EOF + test_prov*::: + { + printf("%s:%s:%s\n", probemod, probefunc, probename); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh.out new file mode 100644 index 00000000..2164eabc --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh.out @@ -0,0 +1,2 @@ +livelib.so:go:go + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh new file mode 100755 index 00000000..72f24ce5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh @@ -0,0 +1,170 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This test verifies that performing a dlclose(3dl) on a library doesn't +# cause existing pid provider probes to become invalid. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > Makefile <<EOF +all: main livelib.so deadlib.so + +main: main.o prov.o + cc -o main main.o + +main.o: main.c + cc -c main.c + + +livelib.so: livelib.o prov.o + cc -z defs -G -o livelib.so livelib.o prov.o -lc + +livelib.o: livelib.c prov.h + cc -c livelib.c + +prov.o: livelib.o prov.d + $dtrace -G -s prov.d livelib.o + +prov.h: prov.d + $dtrace -h -s prov.d + + +deadlib.so: deadlib.o + cc -z defs -G -o deadlib.so deadlib.o -lc + +deadlib.o: deadlib.c + cc -c deadlib.c + +clean: + rm -f main.o livelib.o prov.o prov.h deadlib.o + +clobber: clean + rm -f main livelib.so deadlib.so +EOF + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +cat > livelib.c <<EOF +#include "prov.h" + +void +go(void) +{ + TEST_PROV_GO(); +} +EOF + +cat > deadlib.c <<EOF +void +go(void) +{ +} +EOF + + +cat > main.c <<EOF +#include <dlfcn.h> +#include <unistd.h> +#include <stdio.h> + +static void +foo(void) +{ + (void) close(-1); +} + +int +main(int argc, char **argv) +{ + void *live; + + if ((live = dlopen("./livelib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) { + printf("dlopen of livelib.so failed: %s\n", dlerror()); + return (1); + } + + (void) dlclose(live); + + foo(); + + return (0); +} +EOF + +/usr/ccs/bin/make > /dev/null +if [ $? -ne 0 ]; then + print -u2 "failed to build" + exit 1 +fi + +script() { + $dtrace -c ./main -s /dev/stdin <<EOF + pid\$target:a.out:foo:entry + { + gotit = 1; + exit(0); + } + + tick-1s + /i++ == 5/ + { + printf("test timed out"); + exit(1); + } + + END + /!gotit/ + { + printf("program ended without hitting probe"); + exit(1); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh new file mode 100644 index 00000000..687e435e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh @@ -0,0 +1,106 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# Make sure temporary symbols generated due to DTrace probes in static +# functions are removed in the final link step. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <sys/types.h> +#include "prov.h" + +static void +foo(void) +{ + TEST_PROV_GO(); +} + +int +main(int argc, char **argv) +{ + foo(); + + return (0); +} +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +nm test.o | grep \$dtrace > /dev/null +if [ $? -ne 0 ]; then + print -u2 "no temporary symbols in the object file" + exit 1 +fi + +nm test | grep \$dtrace > /dev/null +if [ $? -eq 0 ]; then + print -u2 "failed to eliminate temporary symbols" + exit 1 +fi + +cd / +/usr/bin/rm -rf $DIR + +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh new file mode 100644 index 00000000..ba62be75 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh @@ -0,0 +1,96 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <sys/types.h> +#include "prov.h" + +int +main(int argc, char **argv) +{ + if (TEST_PROV_GO_ENABLED()) { + TEST_PROV_GO(); + } +} +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() +{ + $dtrace -c ./test -qs /dev/stdin <<EOF + test_prov\$target::: + { + printf("%s:%s:%s\n", probemod, probefunc, probename); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh.out new file mode 100644 index 00000000..b856cc59 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh.out @@ -0,0 +1,2 @@ +test:main:go + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh new file mode 100644 index 00000000..34016484 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh @@ -0,0 +1,113 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +# +# This test is primarily intended to verify a fix for SPARC, but there's no +# harm in running it on other platforms. Here, we verify that is-enabled +# probes don't interfere with return values from previously invoked functions. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <stdio.h> +#include "prov.h" + +int +foo(void) +{ + return (24); +} + +int +main(int argc, char **argv) +{ + int a = foo(); + if (TEST_PROV_GO_ENABLED()) { + TEST_PROV_GO(); + } + (void) printf("%d %d %d\n", a, a, a); + + return (0); +} +EOF + +cc -c -xO2 test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() +{ + ./test + + $dtrace -c ./test -qs /dev/stdin <<EOF + test_prov\$target::: + { + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out new file mode 100644 index 00000000..563d68fd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out @@ -0,0 +1,3 @@ +24 24 24 +24 24 24 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh new file mode 100644 index 00000000..9d2646cd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh @@ -0,0 +1,118 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.c <<EOF +#include <sys/sdt.h> + +int +main(int argc, char **argv) +{ + DTRACE_PROBE(test_prov, entry); + DTRACE_PROBE(test_prov, __entry); + DTRACE_PROBE(test_prov, foo__entry); + DTRACE_PROBE(test_prov, carpentry); + DTRACE_PROBE(test_prov, miniatureturn); + DTRACE_PROBE(test_prov, foo__return); + DTRACE_PROBE(test_prov, __return); + /* + * Unfortunately, a "return" probe is not currently possible due to + * the conflict with a reserved word. + */ + DTRACE_PROBE(test_prov, done); +} +EOF + +cat > prov.d <<EOF +provider test_prov { + probe entry(); + probe __entry(); + probe foo__entry(); + probe carpentry(); + probe miniatureturn(); + probe foo__return(); + probe __return(); + probe done(); +}; +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() +{ + $dtrace -wqZFs /dev/stdin <<EOF + BEGIN + { + system("$DIR/test"); + printf("\n"); + } + + test_prov*:::done + /progenyof(\$pid)/ + { + exit(0); + } + + test_prov*::: + /progenyof(\$pid)/ + { + printf("\n"); + } +EOF +} + +script | cut -c5- +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh.out new file mode 100644 index 00000000..3bf28907 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh.out @@ -0,0 +1,10 @@ +FUNCTION +| :BEGIN + -> main + -> main + -> main + | main:carpentry + | main:miniatureturn + <- main + <- main + | main:done diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh new file mode 100755 index 00000000..9c12e6de --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh @@ -0,0 +1,105 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <sys/types.h> +#include <sys/wait.h> +#include <unistd.h> +#include "prov.h" + +int +main(int argc, char **argv) +{ + TEST_PROV_GO(); + if (fork() == 0) { + TEST_PROV_GO(); + return (0); + } + + (void) wait(NULL); + TEST_PROV_GO(); + + return (0); +} +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() { + $dtrace -c ./test -Zqs /dev/stdin <<EOF + test_prov*::: + { + printf("%s:%s:%s\n", probemod, probefunc, probename); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh.out new file mode 100644 index 00000000..c656c337 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh.out @@ -0,0 +1,4 @@ +test:main:go +test:main:go +test:main:go + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.forker.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.forker.c new file mode 100644 index 00000000..ade7f83b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.forker.c @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> + +#include "forker.h" + +int +main(int argc, char **argv) +{ + int i; + + for (i = 0; i < 10000; i++) { + FORKER_FIRE(); + if (fork() == 0) + exit(0); + + (void) wait(NULL); + } + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.forker.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.forker.ksh new file mode 100755 index 00000000..d35fc4db --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.forker.ksh @@ -0,0 +1,55 @@ +#!/usr/bin/ksh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +# +# Test that we don't deadlock between forking and enabling/disabling USDT +# probes. This test has succeeded if it completes at all. +# + +./tst.forker.exe & +id=$! + +while kill -0 $id >/dev/null 2>&1; do + $dtrace -p $id -s /dev/stdin <<-EOF + forker*:::fire + /i++ == 4/ + { + exit(0); + } + EOF +done + +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh new file mode 100644 index 00000000..68a8d016 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh @@ -0,0 +1,96 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <sys/types.h> +#include "prov.h" + +int +main(int argc, char **argv) +{ + if (TEST_PROV_GO_ENABLED()) { + TEST_PROV_GO(); + } +} +EOF + +cc -xarch=generic -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -xarch=generic -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() +{ + $dtrace -c ./test -qs /dev/stdin <<EOF + test_prov\$target::: + { + printf("%s:%s:%s\n", probemod, probefunc, probename); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh new file mode 100644 index 00000000..39de8e0d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh @@ -0,0 +1,100 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <sys/types.h> +#include "prov.h" + +int +main(int argc, char **argv) +{ + if (TEST_PROV_GO_ENABLED()) { + TEST_PROV_GO(); + } +} +EOF + +cc -xarch=generic64 -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -xarch=generic64 -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() +{ + $dtrace -c ./test -qs /dev/stdin <<EOF + test_prov\$target::: + { + printf("%s:%s:%s\n", probemod, probefunc, probename); + } +EOF +} + +if [ `isainfo -b` -ne '64']; then + script + status=$? +else + status=0 +fi + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.header.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.header.ksh new file mode 100644 index 00000000..08a1912b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.header.ksh @@ -0,0 +1,85 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe zero(); + probe one(uintptr_t); + probe u_nder(char *); + probe d__ash(int **); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <sys/types.h> +#include "prov.h" + +int +main(int argc, char **argv) +{ + TEST_PROV_ZERO(); + TEST_PROV_ONE(1); + TEST_PROV_U_NDER("hi there"); + TEST_PROV_D_ASH(argv); +} +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +cd / +/usr/bin/rm -rf $DIR diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.include.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.include.ksh new file mode 100644 index 00000000..5683f47d --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.include.ksh @@ -0,0 +1,61 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# Make sure <unistd.h> defines _DTRACE_VERSION + +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.c <<EOF +#include <unistd.h> + +int +main(int argc, char **argv) +{ +#ifdef _DTRACE_VERSION + return (0); +#else + return (1); +#endif +} +EOF + +cc -xarch=generic -o test test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi + +./test +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh new file mode 100644 index 00000000..ec07e057 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh @@ -0,0 +1,82 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.c <<EOF +#include <sys/sdt.h> + +int +main(int argc, char **argv) +{ + DTRACE_PROBE(test_prov, zero); + DTRACE_PROBE1(test_prov, one, 1); + DTRACE_PROBE2(test_prov, two, 2, 3); + DTRACE_PROBE3(test_prov, three, 4, 5, 7); + DTRACE_PROBE4(test_prov, four, 7, 8, 9, 10); + DTRACE_PROBE5(test_prov, five, 11, 12, 13, 14, 15); +} +EOF + +cat > prov.d <<EOF +provider test_prov { + probe zero(); + probe one(uintptr_t); + probe two(uintptr_t, uintptr_t); + probe three(uintptr_t, uintptr_t, uintptr_t); + probe four(uintptr_t, uintptr_t, uintptr_t, uintptr_t); + probe five(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +}; +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +cd / +/usr/bin/rm -rf $DIR diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh new file mode 100644 index 00000000..01b2126c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh @@ -0,0 +1,84 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +ppriv -s A=basic $$ + +cat > test.c <<EOF +#include <sys/sdt.h> + +int +main(int argc, char **argv) +{ + DTRACE_PROBE(test_prov, zero); + DTRACE_PROBE1(test_prov, one, 1); + DTRACE_PROBE2(test_prov, two, 2, 3); + DTRACE_PROBE3(test_prov, three, 4, 5, 7); + DTRACE_PROBE4(test_prov, four, 7, 8, 9, 10); + DTRACE_PROBE5(test_prov, five, 11, 12, 13, 14, 15); +} +EOF + +cat > prov.d <<EOF +provider test_prov { + probe zero(); + probe one(uintptr_t); + probe two(uintptr_t, uintptr_t); + probe three(uintptr_t, uintptr_t, uintptr_t); + probe four(uintptr_t, uintptr_t, uintptr_t, uintptr_t); + probe five(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +}; +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +cd / +/usr/bin/rm -rf $DIR diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh new file mode 100755 index 00000000..0c8b072c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh @@ -0,0 +1,99 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <sys/types.h> +#include "prov.h" + +int +main(int argc, char **argv) +{ + TEST_PROV_GO(); + TEST_PROV_GO(); + TEST_PROV_GO(); + TEST_PROV_GO(); + + return (0); +} +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() { + $dtrace -c ./test -qs /dev/stdin <<EOF + test_prov\$target::: + { + printf("%s:%s:%s\n", probemod, probefunc, probename); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh.out new file mode 100644 index 00000000..5e826192 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh.out @@ -0,0 +1,5 @@ +test:main:go +test:main:go +test:main:go +test:main:go + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh new file mode 100644 index 00000000..a911bcdf --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh @@ -0,0 +1,90 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# Fake up a scenario where _DTRACE_VERSION is not defined by having our own +# <unistd.h>. This tests that dtrace -h will produce a header file which can +# be used on a system where DTrace is not present. + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +touch unistd.h + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include "prov.h" + +int +main(int argc, char **argv) +{ + TEST_PROV_GO(); + + if (TEST_PROV_GO_ENABLED()) { + TEST_PROV_GO(); + } + + return (0); +} +EOF + +cc -I. -xarch=generic -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +cc -xarch=generic -o test test.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +./test +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh new file mode 100644 index 00000000..989d6d32 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh @@ -0,0 +1,82 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <sys/types.h> +#include "prov.h" + +int +main(int argc, char **argv) +{ + if (TEST_PROV_GO_ENABLED()) + return (2); + + return (0); +} +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +cd / +/usr/bin/rm -rf $DIR diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh new file mode 100644 index 00000000..7fad4015 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh @@ -0,0 +1,98 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.c <<EOF +#include <sys/sdt.h> + +int +main(int argc, char **argv) +{ + DTRACE_PROBE(test_prov, zero); +} +EOF + +cat > prov.d <<EOF +provider test_prov { + probe zero(); +}; +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() +{ + $dtrace -wZs /dev/stdin <<EOF + BEGIN + { + system("$DIR/test"); + } + + test_prov*::: + { + seen = 1; + } + + proc:::exit + /progenyof(\$pid) && execname == "test"/ + { + exit(seen ? 0 : 2); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static.ksh new file mode 100644 index 00000000..1ebcdb95 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static.ksh @@ -0,0 +1,98 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.c <<EOF +#include <unistd.h> +#include <sys/sdt.h> + +static void +foo(void) +{ + DTRACE_PROBE(test_prov, probe1); + DTRACE_PROBE(test_prov, probe2); +} + +int +main(int argc, char **argv) +{ + DTRACE_PROBE(test_prov, probe1); + DTRACE_PROBE(test_prov, probe2); + foo(); +} +EOF + +cat > prov.d <<EOF +provider test_prov { + probe probe1(); + probe probe2(); +}; +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() +{ + $dtrace -c ./test -qs /dev/stdin <<EOF + test_prov\$target::: + { + printf("%s:%s:%s\n", probemod, probefunc, probename); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static.ksh.out new file mode 100644 index 00000000..a559d97a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static.ksh.out @@ -0,0 +1,5 @@ +test:main:probe1 +test:main:probe2 +test:foo:probe1 +test:foo:probe2 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh new file mode 100644 index 00000000..7cf9004c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh @@ -0,0 +1,108 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +# Rebuilding an object file containing DOF changes slightly when the object +# files containing the probes have already been modified. This tests that +# case by generating the DOF object, removing it, and building it again. + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.c <<EOF +#include <unistd.h> +#include <sys/sdt.h> + +static void +foo(void) +{ + DTRACE_PROBE(test_prov, probe1); + DTRACE_PROBE(test_prov, probe2); +} + +int +main(int argc, char **argv) +{ + DTRACE_PROBE(test_prov, probe1); + DTRACE_PROBE(test_prov, probe2); + foo(); +} +EOF + +cat > prov.d <<EOF +provider test_prov { + probe probe1(); + probe probe2(); +}; +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create initial DOF" + exit 1 +fi +rm -f prov.o +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create final DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() +{ + $dtrace -c ./test -qs /dev/stdin <<EOF + test_prov\$target::: + { + printf("%s:%s:%s\n", probemod, probefunc, probename); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh.out new file mode 100644 index 00000000..a559d97a --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh.out @@ -0,0 +1,5 @@ +test:main:probe1 +test:main:probe2 +test:foo:probe1 +test:foo:probe2 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.user.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.user.ksh new file mode 100755 index 00000000..d5d9fdc4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.user.ksh @@ -0,0 +1,96 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > prov.d <<EOF +provider test_prov { + probe go(); +}; +EOF + +$dtrace -h -s prov.d +if [ $? -ne 0 ]; then + print -u2 "failed to generate header file" + exit 1 +fi + +cat > test.c <<EOF +#include <sys/types.h> +#include "prov.h" + +int +main(int argc, char **argv) +{ + TEST_PROV_GO(); + + return (0); +} +EOF + +cc -c test.c +if [ $? -ne 0 ]; then + print -u2 "failed to compile test.c" + exit 1 +fi +$dtrace -G -32 -s prov.d test.o +if [ $? -ne 0 ]; then + print -u2 "failed to create DOF" + exit 1 +fi +cc -o test test.o prov.o +if [ $? -ne 0 ]; then + print -u2 "failed to link final executable" + exit 1 +fi + +script() { + $dtrace -c 'ppriv -e -s A=basic ./test' -Zqs /dev/stdin <<EOF + test_prov\$target::: + { + printf("%s:%s:%s\n", probemod, probefunc, probename); + } +EOF +} + +script +status=$? + +cd / +/usr/bin/rm -rf $DIR + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.user.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.user.ksh.out new file mode 100644 index 00000000..b856cc59 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/usdt/tst.user.ksh.out @@ -0,0 +1,2 @@ +test:main:go + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c new file mode 100644 index 00000000..edd3dd15 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +void grow1(int); + +void +grow(int frame) +{ + /* + * Create a ridiculously large stack - enough to push us over + * the default setting of 'dtrace_ustackdepth_max' (2048). + */ + if (frame >= 2048) + for (;;) + getpid(); + + grow1(++frame); +} + +void +grow1(int frame) +{ + grow(++frame); +} + +int +main(int argc, char *argv[]) +{ + grow(1); + + return (0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.bigstack.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.bigstack.d new file mode 100644 index 00000000..66fda5ba --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.bigstack.d @@ -0,0 +1,45 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +syscall::getpid:entry +/pid == $1/ +{ + @[ustackdepth] = count(); +} + +ERROR +/arg4 == DTRACEFLT_BADSTACK/ +{ + exit(0); +} + +profile:::tick-1s +/++n == 10/ +{ + exit(1) +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.depth.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.depth.ksh new file mode 100644 index 00000000..26cff421 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.depth.ksh @@ -0,0 +1,110 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +file=out.$$ +dtrace=$1 + +rm -f $file + +$dtrace -o $file -c date -s /dev/stdin <<EOF + + #pragma D option quiet + #pragma D option bufsize=1M + #pragma D option bufpolicy=fill + + pid\$target:::entry, + pid\$target:::return, + pid\$target:a.out::, + syscall:::return, + profile:::profile-997 + /pid == \$target/ + { + printf("START %s:%s:%s:%s\n", + probeprov, probemod, probefunc, probename); + trace(ustackdepth); + ustack(100); + trace("END\n"); + } + + tick-1sec + /n++ == 10/ + { + trace("test timed out..."); + exit(1); + } +EOF + +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed + exit $status +fi + +perl /dev/stdin $file <<EOF + while (<>) { + chomp; + + last if /^\$/; + + die "expected START at \$.\n" unless /^START/; + + \$_ = <>; + chomp; + die "expected depth (\$_) at \$.\n" unless /^(\d+)\$/; + \$depth = \$1; + + for (\$i = 0; \$i < \$depth; \$i++) { + \$_ = <>; + chomp; + die "unexpected END at \$.\n" if /^END/; + } + + \$_ = <>; + chomp; + die "expected END at \$.\n" unless /^END\$/; + } +EOF + +status=$? + +count=`wc -l $file | cut -f1 -do` +if [ "$count" -lt 1000 ]; then + echo $tst: output was too short + status=1 +fi + + +if [ "$status" -eq 0 ]; then + rm -f $file +fi + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.spin.c b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.spin.c new file mode 100644 index 00000000..bdeb16d9 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.spin.c @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include <unistd.h> + +volatile long long count = 0; + +int +baz(int a) +{ + (void) getpid(); + while (count != -1) { + count++; + a++; + } + + return (a + 1); +} + +int +bar(int a) +{ + return (baz(a + 1) - 1); +} + +int +foo(int a, int b) +{ + return (bar(a) - b); +} + +int +main(int argc, char **argv) +{ + return (foo(argc, (int)argv) == 0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh new file mode 100644 index 00000000..1a7e0e12 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/ustack/tst.spin.ksh @@ -0,0 +1,139 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +file=out.$$ +dtrace=$1 + +rm -f $file + +dir=`dirname $tst` + +$dtrace -o $file -c $dir/tst.spin.exe -s /dev/stdin <<EOF + + #pragma D option quiet + #pragma D option destructive + #pragma D option evaltime=main + + /* + * Toss out the first 100 samples to wait for the program to enter + * its steady state. + */ + + profile-1999 + /pid == \$target && n++ > 100/ + { + @total = count(); + @stacks[ustack(4)] = count(); + } + + tick-1s + { + secs++; + } + + tick-1s + /secs > 5/ + { + done = 1; + } + + tick-1s + /secs > 10/ + { + trace("test timed out"); + exit(1); + } + + profile-1999 + /pid == \$target && done/ + { + raise(SIGINT); + exit(0); + } + + END + { + printa("TOTAL %@u\n", @total); + printa("START%kEND\n", @stacks); + } +EOF + +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: dtrace failed + exit $status +fi + +perl /dev/stdin $file <<EOF + \$_ = <>; + chomp; + die "output problem\n" unless /^TOTAL (\d+)/; + \$count = \$1; + die "too few samples (\$count)\n" unless \$count >= 1000; + + while (<>) { + chomp; + + last if /^$/; + + die "expected START at \$.\n" unless /^START/; + + + \$_ = <>; + chomp; + die "expected END at \$.\n" unless /\`baz\+/; + + \$_ = <>; + chomp; + die "expected END at \$.\n" unless /\`bar\+/; + + \$_ = <>; + chomp; + die "expected END at \$.\n" unless /\`foo\+/; + + \$_ = <>; + chomp; + die "expected END at \$.\n" unless /\`main\+/; + + \$_ = <>; + chomp; + die "expected END at \$.\n" unless /^END\$/; + } + +EOF + +status=$? +if [ "$status" -eq 0 ]; then + rm -f $file +fi + +exit $status diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.gid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.gid.d new file mode 100644 index 00000000..23fcf389 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.gid.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +/curpsinfo->pr_gid == gid/ +{ + exit(0); +} + +BEGIN +{ + printf("%d != %d\n", curpsinfo->pr_gid, gid); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.nullassign.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.nullassign.d new file mode 100644 index 00000000..accc763f --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.nullassign.d @@ -0,0 +1,94 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +{ + die = "Die"; + tap = ", SystemTap, "; + the = "The"; +} + +BEGIN +{ + phrase = strjoin(die, tap); + phrase = strjoin(phrase, die); + expected = "Die, SystemTap, Die"; +} + +BEGIN +/phrase != expected/ +{ + printf("global: expected '%s', found '%s'\n", expected, phrase); + exit(1); +} + +BEGIN +{ + this->phrase = strjoin(the, tap); +} + +BEGIN +{ + this->phrase = strjoin(this->phrase, the); + expected = "The, SystemTap, The"; +} + +BEGIN +/this->phrase != expected/ +{ + printf("clause-local: expected '%s', found '%s'\n", + expected, this->phrase); + exit(2); +} + +BEGIN +{ + phrase = NULL; + this->phrase = NULL; +} + +BEGIN +/phrase != NULL/ +{ + printf("expected global to be NULL\n"); + exit(3); +} + +BEGIN +/this->phrase != NULL/ +{ + printf("expected clause-local to be NULL\n"); + exit(4); +} + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ppid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ppid.d new file mode 100644 index 00000000..5f0da5fd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ppid.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +/curpsinfo->pr_ppid == ppid/ +{ + exit(0); +} + +BEGIN +{ + printf("%d != %d\n", curpsinfo->pr_ppid, ppid); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh new file mode 100644 index 00000000..8427ea0c --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh @@ -0,0 +1,65 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +# +# This test is a bit naughty; it's assuming that ld.so.1 has an implementation +# of calloc(3C), and that it's implemented in terms of the ld.so.1 +# implementation of malloc(3C). If you're reading this comment because +# those assumptions have become false, please accept my apologies... +# +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -qs /dev/stdin -c "/usr/bin/echo" <<EOF +pid\$target:ld.so.1:calloc:entry +{ + self->calloc = 1; +} + +pid\$target:ld.so.1:malloc:entry +/self->calloc/ +{ + @[umod(ucaller), ufunc(ucaller)] = count(); +} + +pid\$target:ld.so.1:calloc:return +/self->calloc/ +{ + self->calloc = 0; +} + +END +{ + printa("%A %A\n", @); +} +EOF + +exit 0 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh.out new file mode 100644 index 00000000..86c72a4e --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh.out @@ -0,0 +1,3 @@ + +ld.so.1 ld.so.1`calloc + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.uid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.uid.d new file mode 100644 index 00000000..bf1c9dc5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.uid.d @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +BEGIN +/curpsinfo->pr_uid == uid/ +{ + exit(0); +} + +BEGIN +{ + printf("%d != %d\n", curpsinfo->pr_uid, uid); + exit(1); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.walltimestamp.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.walltimestamp.d new file mode 100644 index 00000000..e17bb946 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/vars/tst.walltimestamp.d @@ -0,0 +1,55 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option quiet + +uint64_t now; + +BEGIN +{ + now = 18252813184; /* Jan 1, 2004 00:00:00 */ +} + +BEGIN +/walltimestamp < timestamp/ +{ + printf("%d < %d", walltimestamp, timestamp); + exit(1); +} + +BEGIN +/walltimestamp < now/ +{ + printf("%d (%Y) is before %Y", walltimestamp, walltimestamp, now); + exit(2); +} + +BEGIN +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/version/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/version/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/version/Makefile.kup diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/version/tst.1.0.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/version/tst.1.0.d new file mode 100644 index 00000000..0ab2af78 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/version/tst.1.0.d @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#pragma D option version=1.0 + +/* + * The following identifiers were added as D built-ins as of version 1.1. + * Using these identifiers as user-specified variables should be illegal in + * that and any later versions, but legal in earlier versions. + */ +int strstr; +int strchr; +int strrchr; +int strtok; +int substr; +int index; +int freopen; + +BEGIN +{ + exit(0); +} + |