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 --- .../dtrace/test/tst/common/predicates/Makefile.kup | 0 .../predicates/err.D_PRED_SCALAR.NonScalarPred.d | 44 +++++ .../tst/common/predicates/err.D_SYNTAX.invalid.d | 50 ++++++ .../tst/common/predicates/err.D_SYNTAX.operr.d | 50 ++++++ .../test/tst/common/predicates/tst.argsnotcached.d | 55 ++++++ .../dtrace/test/tst/common/predicates/tst.basics.d | 57 ++++++ .../test/tst/common/predicates/tst.basics.d.out | 1 + .../test/tst/common/predicates/tst.complex.d | 126 +++++++++++++ .../test/tst/common/predicates/tst.complex.d.out | 83 +++++++++ .../test/tst/common/predicates/tst.predcache.ksh | 197 +++++++++++++++++++++ 10 files changed, 663 insertions(+) create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/Makefile.kup create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out create mode 100644 src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh (limited to 'src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates') diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/Makefile.kup new file mode 100644 index 00000000..e69de29b diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d new file mode 100644 index 00000000..5f02b7a4 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_PRED_SCALAR.NonScalarPred.d @@ -0,0 +1,44 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Predicate result must be of scalar type. + * + * SECTION: Errtags/ D_PRED_SCALAR + * + */ + +#pragma D option quiet +int a[4]; + +BEGIN +/a/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d new file mode 100644 index 00000000..391d4256 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.invalid.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple if,then operation test. + * Call invalid conditions and make sure it gives compilation error. + * + * SECTION: Program Structure/Predicates + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile-1 +/i < != > 10/ +{ + i++; + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d new file mode 100644 index 00000000..8ffab279 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/err.D_SYNTAX.operr.d @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple if,then operations test. + * Call impossible conditions and make sure compilation fails. + * + * SECTION: Program Structure/Predicates + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +profile-1 +/i != 0 && >= 5 || <= 10/ +{ + i++; + trace(i); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d new file mode 100644 index 00000000..f461c5dd --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.argsnotcached.d @@ -0,0 +1,55 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +int schedules; +int executes; + +/* + * This script is a bit naughty: it's assuming the implementation of the + * VM system's page scanning. If this implementation changes -- either by + * changing the function that scans pages or by making that scanning + * multithreaded -- this script will break. + */ +fbt::timeout:entry +/args[0] == (void *)&genunix`schedpaging/ +{ + schedules++; +} + +fbt::schedpaging:entry +/executes == 10/ +{ + printf("%d schedules, %d executes\n", schedules, executes); + exit(executes == schedules ? 0 : 1); +} + +fbt::schedpaging:entry +{ + executes++; +} + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d new file mode 100644 index 00000000..9b43b619 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d @@ -0,0 +1,57 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Simple if,then operations test. + * Call simple expressions and make sure test satisfy conditions. + * Match expected output in tst.basics.d.out + * + * SECTION: Program Structure/Predicates + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; +} + +tick-10ms +/i < 10/ +{ + i++; + trace(i); +} + +tick-10ms +/i == 10/ +{ + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out new file mode 100644 index 00000000..2a5b99aa --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.basics.d.out @@ -0,0 +1 @@ +12345678910 diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d new file mode 100644 index 00000000..d08543f0 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d @@ -0,0 +1,126 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Complex operations and if,then test. + * Call 'n' permutation and combination of operations over if,then. + * Match expected output in tst.complex.d.out + * + * SECTION: Program Structure/Predicates + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; + j = 0; +} + +tick-10ms +/i < 10/ +{ + i++; + j++; + printf("\n\n%d\n------\n", i); +} + +tick-10ms +/i == 5 || i == 10/ +{ + printf("i == 5 (or) i == 10\n"); +} + +tick-10ms +/i <= 5/ +{ + printf("i <= 5\n"); +} + +tick-10ms +/j >= 5/ +{ + printf("j >= 5\n"); +} + +tick-10ms +/j >= 5 || i <= 5/ +{ + printf("i >= 5 || j >= 5\n"); +} + +tick-10ms +/j >= 5 && i <= 5/ +{ + printf("j >= 5 && i <= 55\n"); +} + +tick-10ms +/i < 5/ +{ + printf("i < 5\n"); +} + +tick-10ms +/i == 2 || j == 2/ +{ + printf("i == 2 (or) j == 2\n"); +} + +tick-10ms +/i == 2 && j == 2/ +{ + printf("i == 2 (and) j == 2\n"); +} + +tick-10ms +/j != 10/ +{ + printf("j != 10\n"); +} + +tick-10ms +/j == 5 || i == 2/ +{ + printf("j == 5 || i == 2\n"); +} + +tick-10ms +/j == 5 && i == 2/ +{ + printf("j == 5 && i == 2\n"); +} + +tick-10ms +/i == 10/ +{ + printf("i == 10\n"); + exit(0); +} diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out new file mode 100644 index 00000000..5f16dbdb --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.complex.d.out @@ -0,0 +1,83 @@ + + +1 +------ +i <= 5 +i >= 5 || j >= 5 +i < 5 +j != 10 + + +2 +------ +i <= 5 +i >= 5 || j >= 5 +i < 5 +i == 2 (or) j == 2 +i == 2 (and) j == 2 +j != 10 +j == 5 || i == 2 + + +3 +------ +i <= 5 +i >= 5 || j >= 5 +i < 5 +j != 10 + + +4 +------ +i <= 5 +i >= 5 || j >= 5 +i < 5 +j != 10 + + +5 +------ +i == 5 (or) i == 10 +i <= 5 +j >= 5 +i >= 5 || j >= 5 +j >= 5 && i <= 55 +j != 10 +j == 5 || i == 2 + + +6 +------ +j >= 5 +i >= 5 || j >= 5 +j != 10 + + +7 +------ +j >= 5 +i >= 5 || j >= 5 +j != 10 + + +8 +------ +j >= 5 +i >= 5 || j >= 5 +j != 10 + + +9 +------ +j >= 5 +i >= 5 || j >= 5 +j != 10 + + +10 +------ +i == 5 (or) i == 10 +j >= 5 +i >= 5 || j >= 5 +i == 10 + diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh new file mode 100644 index 00000000..f06edcb5 --- /dev/null +++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh @@ -0,0 +1,197 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +unload() +{ + # + # Get the list of services whose processes have USDT probes. Ideally + # it would be possible to unload the fasttrap provider while USDT + # probes exist -- once that fix is integrated, this hack can go away + # We create two lists -- one of regular SMF services and one of legacy + # services -- since each must be enabled and disabled using a specific + # mechanism. + # + pids=$(dtrace -l | \ + perl -ne 'print "$1\n" if (/^\s*\S+\s+\S*\D(\d+)\s+/);' | \ + sort | uniq | tr '\n' ',') + + ctids=$(ps -p $pids -o ctid | tail +2 | sort | uniq) + svcs= + lrcs= + + for ct in $ctids + do + line=$(svcs -o fmri,ctid | grep " $ct\$") + svc=$(echo $line | cut -d' ' -f1) + + if [[ $(svcs -Ho STA $svc) == "LRC" ]]; then + lrc=$(svcs -Ho SVC $svc | tr _ '?') + lrcs="$lrcs $lrc" + else + svcs="$svcs $svc" + fi + done + + for svc in $svcs + do + svcadm disable -ts $svc + done + + for lrc in $lrcs + do + # + # Does it seem a little paternalistic that lsvcrun requires + # this environment variable to be set? I'd say so... + # + SMF_RESTARTER=svc:/system/svc/restarter:default \ + /lib/svc/bin/lsvcrun $lrc stop + done + + modunload -i 0 + modunload -i 0 + modunload -i 0 + modinfo | grep dtrace + success=$? + + for svc in $svcs + do + svcadm enable -ts $svc + done + + for lrc in $lrcs + do + SMF_RESTARTER=svc:/system/svc/restarter:default \ + /lib/svc/bin/lsvcrun $lrc start + done + + if [ ! $success ]; then + echo $tst: could not unload dtrace + exit 1 + fi +} + +script1() +{ + $dtrace -s /dev/stdin <' + exit 2 +fi + +ppid=$$ +dtrace=$1 + +unload +script1 & +child=$! + +let waited=0 + +while [ "$waited" -lt 5 ]; do + seconds=`date +%S` + + if [ "$seconds" -ne "$last" ]; then + last=$seconds + let waited=waited+1 + fi +done + +wait $child +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: first dtrace failed + exit $status +fi + +unload +script2 & +child=$! + +let waited=0 + +while [ "$waited" -lt 10 ]; do + seconds=`date +%S` + + if [ "$seconds" -ne "$last" ]; then + last=$seconds + let waited=waited+1 + fi +done + +wait $child +status=$? + +exit $status -- cgit v1.2.3