From f215e02bf85f68d3a6106c2a1f4f7f063f819064 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 11 Apr 2024 10:17:27 +0200 Subject: Adding upstream version 7.0.14-dfsg. Signed-off-by: Daniel Baumann --- .../test/tst/common/speculation/Makefile.kup | 0 .../speculation/bug.1001148.SpecSizeVariations.d | 87 ++++++++++++++++++ .../common/speculation/err.BufSizeVariations1.d | 88 ++++++++++++++++++ .../common/speculation/err.BufSizeVariations2.d | 88 ++++++++++++++++++ .../err.D_ACT_SPEC.SpeculateWithBreakPoint.d | 69 ++++++++++++++ .../err.D_ACT_SPEC.SpeculateWithChill.d | 69 ++++++++++++++ .../err.D_ACT_SPEC.SpeculateWithCopyOut.d | 69 ++++++++++++++ .../err.D_ACT_SPEC.SpeculateWithCopyOutStr.d | 68 ++++++++++++++ .../err.D_ACT_SPEC.SpeculateWithPanic.d | 69 ++++++++++++++ .../err.D_ACT_SPEC.SpeculateWithRaise.d | 68 ++++++++++++++ .../speculation/err.D_ACT_SPEC.SpeculateWithStop.d | 68 ++++++++++++++ .../speculation/err.D_AGG_COMM.AggAftCommit.d | 40 ++++++++ .../speculation/err.D_AGG_SPEC.SpeculateWithAvg.d | 67 ++++++++++++++ .../err.D_AGG_SPEC.SpeculateWithCount.d | 67 ++++++++++++++ .../err.D_AGG_SPEC.SpeculateWithLquant.d | 72 +++++++++++++++ .../speculation/err.D_AGG_SPEC.SpeculateWithMax.d | 62 +++++++++++++ .../speculation/err.D_AGG_SPEC.SpeculateWithMin.d | 62 +++++++++++++ .../err.D_AGG_SPEC.SpeculateWithQuant.d | 67 ++++++++++++++ .../err.D_AGG_SPEC.SpeculateWithStddev.d | 65 +++++++++++++ .../speculation/err.D_AGG_SPEC.SpeculateWithSum.d | 62 +++++++++++++ .../speculation/err.D_COMM_COMM.CommitAftCommit.d | 82 +++++++++++++++++ .../speculation/err.D_COMM_COMM.DisjointCommit.d | 102 +++++++++++++++++++++ .../speculation/err.D_COMM_DREC.CommitAftDataRec.d | 51 +++++++++++ .../speculation/err.D_DREC_COMM.DataRecAftCommit.d | 73 +++++++++++++++ .../speculation/err.D_DREC_COMM.ExitAfterCommit.d | 61 ++++++++++++ .../speculation/err.D_EXIT_SPEC.ExitAftSpec.d | 70 ++++++++++++++ .../speculation/err.D_PRAGMA_MALFORM.NspecExpr.d | 77 ++++++++++++++++ .../err.D_PRAGMA_OPTSET.HugeNspecValue.d | 76 +++++++++++++++ .../err.D_PRAGMA_OPTSET.InvalidSpecSize.d | 53 +++++++++++ .../speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d | 78 ++++++++++++++++ .../common/speculation/err.D_PROTO_LEN.SpecNoId.d | 61 ++++++++++++ .../speculation/err.D_SPEC_COMM.SpecAftCommit.d | 72 +++++++++++++++ .../speculation/err.D_SPEC_DREC.SpecAftDataRec.d | 70 ++++++++++++++ .../speculation/err.D_SPEC_SPEC.SpecAftSpec.d | 66 +++++++++++++ .../tst/common/speculation/err.NegativeBufSize.d | 88 ++++++++++++++++++ .../tst/common/speculation/err.NegativeNspec.d | 48 ++++++++++ .../tst/common/speculation/err.NegativeSpecSize.d | 47 ++++++++++ .../common/speculation/err.SpecSizeVariations1.d | 78 ++++++++++++++++ .../common/speculation/err.SpecSizeVariations2.d | 78 ++++++++++++++++ .../common/speculation/tst.CommitAfterDiscard.d | 86 +++++++++++++++++ .../tst/common/speculation/tst.CommitWithZero.d | 66 +++++++++++++ .../tst/common/speculation/tst.DataRecAftDiscard.d | 77 ++++++++++++++++ .../tst/common/speculation/tst.DiscardAftCommit.d | 85 +++++++++++++++++ .../tst/common/speculation/tst.DiscardAftDataRec.d | 50 ++++++++++ .../tst/common/speculation/tst.DiscardAftDiscard.d | 85 +++++++++++++++++ .../tst/common/speculation/tst.DiscardWithZero.d | 67 ++++++++++++++ .../tst/common/speculation/tst.ExitAftDiscard.d | 56 +++++++++++ .../test/tst/common/speculation/tst.NoSpecBuffer.d | 64 +++++++++++++ .../common/speculation/tst.SpecSizeVariations1.d | 78 ++++++++++++++++ .../common/speculation/tst.SpecSizeVariations2.d | 78 ++++++++++++++++ .../common/speculation/tst.SpecSizeVariations3.d | 78 ++++++++++++++++ .../common/speculation/tst.SpeculateWithRandom.d | 59 ++++++++++++ .../tst/common/speculation/tst.SpeculationCommit.d | 75 +++++++++++++++ .../common/speculation/tst.SpeculationDiscard.d | 74 +++++++++++++++ .../tst/common/speculation/tst.SpeculationID.d | 50 ++++++++++ .../common/speculation/tst.SpeculationWithZero.d | 65 +++++++++++++ .../tst/common/speculation/tst.TwoSpecBuffers.d | 77 ++++++++++++++++ .../test/tst/common/speculation/tst.negcommit.d | 37 ++++++++ .../test/tst/common/speculation/tst.negspec.d | 37 ++++++++ .../test/tst/common/speculation/tst.zerosize.d | 53 +++++++++++ 60 files changed, 4035 insertions(+) create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/bug.1001148.SpecSizeVariations.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_COMM.AggAftCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithAvg.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithCount.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithLquant.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMax.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithMin.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithQuant.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithSum.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.CommitAftCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_COMM.DisjointCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_COMM_DREC.CommitAftDataRec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.DataRecAftCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_DREC_COMM.ExitAfterCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_EXIT_SPEC.ExitAftSpec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_MALFORM.NspecExpr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.HugeNspecValue.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.InvalidSpecSize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PRAGMA_OPTSET.NegSpecSize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_PROTO_LEN.SpecNoId.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_COMM.SpecAftCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_DREC.SpecAftDataRec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.D_SPEC_SPEC.SpecAftSpec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeBufSize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeNspec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.NegativeSpecSize.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/err.SpecSizeVariations2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.CommitAfterDiscard.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.CommitWithZero.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DataRecAftDiscard.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDataRec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardAftDiscard.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.DiscardWithZero.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.ExitAftDiscard.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations1.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations2.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculateWithRandom.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationCommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationDiscard.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationID.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.SpeculationWithZero.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.TwoSpecBuffers.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.negcommit.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.negspec.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation/tst.zerosize.d (limited to 'src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/speculation') 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 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); +} -- cgit v1.2.3