Update illumos/dist to revision 13742:b6bbdd77139c
ZFS bits will follow in a separate commit
This commit is contained in:
parent
e0ea83ebb1
commit
4a37bb98c9
@ -23,7 +23,6 @@
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* ident "%Z%%M% %I% %E% SMI"
|
||||
*/
|
||||
import org.opensolaris.os.dtrace.*;
|
||||
import java.io.*;
|
||||
@ -303,6 +302,7 @@ public class JDTrace {
|
||||
Distribution.Bucket bucket;
|
||||
int b1 = 0; // first displayed bucket
|
||||
int b2 = d.size() - 1; // last displayed bucket
|
||||
|
||||
for (; (b1 <= b2) && (d.get(b1).getFrequency() == 0); ++b1);
|
||||
// If possible, get one bucket before the first non-zero
|
||||
// bucket and one bucket after the last.
|
||||
@ -337,9 +337,14 @@ public class JDTrace {
|
||||
v = bucket.getFrequency();
|
||||
b = bucket.getMin();
|
||||
|
||||
if (d instanceof LinearDistribution) {
|
||||
if ((d instanceof LinearDistribution) ||
|
||||
(d instanceof LogLinearDistribution)) {
|
||||
if (b == Long.MIN_VALUE) {
|
||||
String lt = "< " + ((LinearDistribution)d).getBase();
|
||||
String lt;
|
||||
if (d instanceof LinearDistribution)
|
||||
lt = "< " + ((LinearDistribution)d).getBase();
|
||||
else
|
||||
lt = "< " + ((LogLinearDistribution)d).getBase();
|
||||
out.printf("%16s ", lt);
|
||||
} else if (bucket.getMax() == Long.MAX_VALUE) {
|
||||
String ge = ">= " + b;
|
||||
|
@ -23,7 +23,6 @@
|
||||
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
# Exception list: names tests that are bypassed when running in Java
|
||||
# mode (relative to /opt/SUNWdtrt/tst)
|
||||
@ -52,14 +51,17 @@ common/usdt/tst.enabled.ksh
|
||||
common/usdt/tst.enabled2.ksh
|
||||
common/usdt/tst.entryreturn.ksh
|
||||
common/usdt/tst.fork.ksh
|
||||
common/usdt/tst.header.ksh
|
||||
common/usdt/tst.guess32.ksh
|
||||
common/usdt/tst.guess64.ksh
|
||||
common/usdt/tst.header.ksh
|
||||
common/usdt/tst.linkpriv.ksh
|
||||
common/usdt/tst.linkunpriv.ksh
|
||||
common/usdt/tst.multiple.ksh
|
||||
common/usdt/tst.nodtrace.ksh
|
||||
common/usdt/tst.noreap.ksh
|
||||
common/usdt/tst.noreapring.ksh
|
||||
common/usdt/tst.onlyenabled.ksh
|
||||
common/usdt/tst.reap.ksh
|
||||
common/usdt/tst.reeval.ksh
|
||||
common/usdt/tst.static.ksh
|
||||
common/usdt/tst.static2.ksh
|
||||
|
@ -22,25 +22,27 @@
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* Copyright 2011, Richard Lowe
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
#include <alloca.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <err.h>
|
||||
#include <sys/systeminfo.h>
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int i, ac, has64;
|
||||
int i, ac;
|
||||
char **av, **p;
|
||||
char isaname[16];
|
||||
|
||||
ac = argc + 3;
|
||||
av = p = alloca(sizeof (char *) * ac);
|
||||
|
||||
*p++ = "java";
|
||||
*p++ = "/usr/java/bin/java";
|
||||
*p++ = "-jar";
|
||||
*p++ = "/opt/SUNWdtrt/lib/java/jdtrace.jar";
|
||||
|
||||
@ -52,9 +54,9 @@ main(int argc, char **argv)
|
||||
}
|
||||
p[i] = NULL;
|
||||
|
||||
(void) execvp(av[0], av);
|
||||
if (sysinfo(SI_ARCHITECTURE_64, isaname, sizeof (isaname)) != -1)
|
||||
asprintf(av, "/usr/java/bin/%s/java", isaname);
|
||||
|
||||
perror("exec failed");
|
||||
|
||||
return (0);
|
||||
(void) execv(av[0], av);
|
||||
err(1, "exec failed");
|
||||
}
|
||||
|
@ -25,6 +25,9 @@
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
#
|
||||
require 5.8.4;
|
||||
|
||||
use File::Find;
|
||||
@ -35,8 +38,8 @@ use Cwd 'abs_path';
|
||||
|
||||
$PNAME = $0;
|
||||
$PNAME =~ s:.*/::;
|
||||
$OPTSTR = 'abd:fghi:jlnqsx:';
|
||||
$USAGE = "Usage: $PNAME [-abfghjlnqs] [-d dir] [-i isa] "
|
||||
$OPTSTR = 'abd:fFghi:jlnqsx:';
|
||||
$USAGE = "Usage: $PNAME [-abfFghjlnqs] [-d dir] [-i isa] "
|
||||
. "[-x opt[=arg]] [file | dir ...]\n";
|
||||
($MACH = `uname -p`) =~ s/\W*\n//;
|
||||
($PLATFORM = `uname -i`) =~ s/\W*\n//;
|
||||
@ -69,6 +72,20 @@ sub dirname {
|
||||
return $i == -1 ? '.' : $i == 0 ? '/' : $s;
|
||||
}
|
||||
|
||||
sub inpath
|
||||
{
|
||||
my ($exec) = (@_);
|
||||
my @path = File::Spec->path();
|
||||
|
||||
for my $dir (@path) {
|
||||
if (-x $dir . "/" . $exec) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub usage
|
||||
{
|
||||
print $USAGE;
|
||||
@ -77,6 +94,7 @@ sub usage
|
||||
print "\t -d specify directory for test results files and cores\n";
|
||||
print "\t -g enable libumem debugging when running tests\n";
|
||||
print "\t -f force bypassed tests to run\n";
|
||||
print "\t -F force tests to be run, even if missing dependencies\n";
|
||||
print "\t -h display verbose usage message\n";
|
||||
print "\t -i specify ISA to test instead of isaexec(3C) default\n";
|
||||
print "\t -j execute test suite using jdtrace (Java API) only\n";
|
||||
@ -240,8 +258,8 @@ sub run_tests {
|
||||
my($failed) = $errs;
|
||||
my($total) = 0;
|
||||
|
||||
die "$PNAME: $dtrace not found\n" unless (-x "$dtrace");
|
||||
logmsg($dtrace . "\n");
|
||||
die "$PNAME: $dtrace not found; aborting\n" unless (-x "$dtrace");
|
||||
logmsg("executing tests using $dtrace ...\n");
|
||||
|
||||
load_exceptions($exceptions_path);
|
||||
|
||||
@ -546,9 +564,20 @@ $dt_bin = '/opt/SUNWdtrt/bin';
|
||||
$defdir = -d $dt_tst ? $dt_tst : '.';
|
||||
$bindir = -d $dt_bin ? $dt_bin : '.';
|
||||
|
||||
if (!$opt_F) {
|
||||
my @dependencies = ("gcc", "make", "java", "perl");
|
||||
|
||||
for my $dep (@dependencies) {
|
||||
if (!inpath($dep)) {
|
||||
die "$PNAME: '$dep' not found (use -F to force run)\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
find(\&wanted, "$defdir/common") if (scalar(@ARGV) == 0);
|
||||
find(\&wanted, "$defdir/$MACH") if (scalar(@ARGV) == 0);
|
||||
find(\&wanted, "$defdir/$PLATFORM") if (scalar(@ARGV) == 0);
|
||||
|
||||
die $USAGE if (scalar(@files) == 0);
|
||||
|
||||
$dtrace_path = '/usr/sbin/dtrace';
|
||||
@ -562,7 +591,7 @@ if ($opt_j || $opt_n || $opt_i) {
|
||||
push(@dtrace_cmds, $jdtrace_path) if ($opt_j);
|
||||
push(@dtrace_cmds, "/usr/sbin/$opt_i/dtrace") if ($opt_i);
|
||||
} else {
|
||||
@dtrace_cmds = ($dtrace_path, $jdtrace_path);
|
||||
@dtrace_cmds = ($dtrace_path);
|
||||
}
|
||||
|
||||
if ($opt_d) {
|
||||
@ -589,12 +618,6 @@ if ($opt_g) {
|
||||
$ENV{'LD_PRELOAD'} = 'libumem.so';
|
||||
}
|
||||
|
||||
#
|
||||
# Ensure that $PATH contains a cc(1) so that we can execute the
|
||||
# test programs that require compilation of C code.
|
||||
#
|
||||
$ENV{'PATH'} = $ENV{'PATH'} . ':/ws/onnv-tools/SUNWspro/SS11/bin';
|
||||
|
||||
if ($opt_b) {
|
||||
logmsg("badioctl'ing ... ");
|
||||
|
||||
|
42
cmd/dtrace/test/cmd/scripts/dtfailures.ksh
Executable file
42
cmd/dtrace/test/cmd/scripts/dtfailures.ksh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/usr/bin/ksh -p
|
||||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
#
|
||||
|
||||
let failure=0
|
||||
|
||||
printf "%-3s %-10s %-31s %s\n" "#" "KIND" "TEST" "DETAILS"
|
||||
|
||||
while [[ -d failure.$failure ]]; do
|
||||
dir=failure.$failure
|
||||
tst=`cat $dir/README | head -1 | nawk '{ print $2 }'`
|
||||
kind=`basename $(dirname $tst)`
|
||||
name=`basename $tst`
|
||||
cols=$(expr `tput cols` - 47)
|
||||
details=`tail -1 $dir/*.err | cut -c1-$cols`
|
||||
printf "%-3d %-10s %-31s " $failure $kind $name
|
||||
echo $details
|
||||
let failure=failure+1
|
||||
done
|
||||
|
@ -24,8 +24,6 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
#include <sys/dtrace.h>
|
||||
|
||||
#define INTFUNC(x) \
|
||||
@ -98,6 +96,8 @@ INTFUNC(ntohll(0x1234567890abcdefL))
|
||||
STRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof (ipaddr_t))))
|
||||
STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t))))
|
||||
STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t))))
|
||||
STRFUNC(toupper("foo"))
|
||||
STRFUNC(tolower("BAR"))
|
||||
|
||||
BEGIN
|
||||
/subr == DIF_SUBR_MAX + 1/
|
||||
|
@ -24,8 +24,6 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
/*
|
||||
* ASSERTION:
|
||||
* Checks that setting "bufresize" to "auto" will cause buffer
|
||||
@ -34,14 +32,8 @@
|
||||
* SECTION: Buffers and Buffering/Buffer Resizing Policy;
|
||||
* Options and Tunables/bufsize;
|
||||
* Options and Tunables/bufresize
|
||||
*
|
||||
* NOTES:
|
||||
* We use the undocumented "preallocate" option to make sure dtrace(1M)
|
||||
* has enough space in its heap to allocate a buffer as large as the
|
||||
* kernel's trace buffer.
|
||||
*/
|
||||
|
||||
#pragma D option preallocate=100t
|
||||
#pragma D option bufresize=auto
|
||||
#pragma D option bufsize=100t
|
||||
|
||||
|
@ -24,8 +24,6 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
/*
|
||||
* ASSERTION:
|
||||
* Checks that setting "bufresize" to "auto" will cause buffer
|
||||
@ -34,14 +32,8 @@
|
||||
* SECTION: Buffers and Buffering/Buffer Resizing Policy;
|
||||
* Options and Tunables/aggsize;
|
||||
* Options and Tunables/bufresize
|
||||
*
|
||||
* NOTES:
|
||||
* We use the undocumented "preallocate" option to make sure dtrace(1M)
|
||||
* has enough space in its heap to allocate a buffer as large as the
|
||||
* kernel's trace buffer.
|
||||
*/
|
||||
|
||||
#pragma D option preallocate=100t
|
||||
#pragma D option bufresize=auto
|
||||
#pragma D option aggsize=100t
|
||||
|
||||
|
30
cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d
Normal file
30
cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.tolower.d
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace(tolower(2152006));
|
||||
exit(1);
|
||||
}
|
30
cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d
Normal file
30
cmd/dtrace/test/tst/common/funcs/err.D_PROTO_ARG.toupper.d
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace(toupper(timestamp));
|
||||
exit(1);
|
||||
}
|
30
cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d
Normal file
30
cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.tolower.d
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace(tolower());
|
||||
exit(1);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace(tolower("dory", "eel", "roughy"));
|
||||
exit(1);
|
||||
}
|
30
cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d
Normal file
30
cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.toupper.d
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace(toupper());
|
||||
exit(1);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace(tolower("haino", "tylo"));
|
||||
exit(1);
|
||||
}
|
80
cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d
Normal file
80
cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
int64_t val[int];
|
||||
|
||||
BEGIN
|
||||
{
|
||||
base = -2;
|
||||
i = 0;
|
||||
val[i++] = -10;
|
||||
val[i++] = -1;
|
||||
val[i++] = 0;
|
||||
val[i++] = 10;
|
||||
val[i++] = 100;
|
||||
val[i++] = 1000;
|
||||
val[i++] = (1LL << 62);
|
||||
maxval = i;
|
||||
i = 0;
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/i < maxval/
|
||||
{
|
||||
printf("base %2d of %20d: ", base, val[i]);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/i < maxval/
|
||||
{
|
||||
printf(" %s\n", lltostr(val[i], base));
|
||||
}
|
||||
|
||||
ERROR
|
||||
{
|
||||
printf(" <error>\n");
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/i < maxval/
|
||||
{
|
||||
i++;
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/i == maxval/
|
||||
{
|
||||
i = 0;
|
||||
base++;
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/base > 40/
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
302
cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out
Normal file
302
cmd/dtrace/test/tst/common/funcs/tst.lltostrbase.d.out
Normal file
@ -0,0 +1,302 @@
|
||||
base -2 of -10: <error>
|
||||
base -2 of -1: <error>
|
||||
base -2 of 0: <error>
|
||||
base -2 of 10: <error>
|
||||
base -2 of 100: <error>
|
||||
base -2 of 1000: <error>
|
||||
base -2 of 4611686018427387904: <error>
|
||||
base -1 of -10: <error>
|
||||
base -1 of -1: <error>
|
||||
base -1 of 0: <error>
|
||||
base -1 of 10: <error>
|
||||
base -1 of 100: <error>
|
||||
base -1 of 1000: <error>
|
||||
base -1 of 4611686018427387904: <error>
|
||||
base 0 of -10: <error>
|
||||
base 0 of -1: <error>
|
||||
base 0 of 0: <error>
|
||||
base 0 of 10: <error>
|
||||
base 0 of 100: <error>
|
||||
base 0 of 1000: <error>
|
||||
base 0 of 4611686018427387904: <error>
|
||||
base 1 of -10: <error>
|
||||
base 1 of -1: <error>
|
||||
base 1 of 0: <error>
|
||||
base 1 of 10: <error>
|
||||
base 1 of 100: <error>
|
||||
base 1 of 1000: <error>
|
||||
base 1 of 4611686018427387904: <error>
|
||||
base 2 of -10: 1111111111111111111111111111111111111111111111111111111111110110
|
||||
base 2 of -1: 1111111111111111111111111111111111111111111111111111111111111111
|
||||
base 2 of 0: 0
|
||||
base 2 of 10: 1010
|
||||
base 2 of 100: 1100100
|
||||
base 2 of 1000: 1111101000
|
||||
base 2 of 4611686018427387904: 100000000000000000000000000000000000000000000000000000000000000
|
||||
base 3 of -10: 11112220022122120101211020120210210211120
|
||||
base 3 of -1: 11112220022122120101211020120210210211220
|
||||
base 3 of 0: 0
|
||||
base 3 of 10: 101
|
||||
base 3 of 100: 10201
|
||||
base 3 of 1000: 1101001
|
||||
base 3 of 4611686018427387904: 1010201120122220002201001122110012110111
|
||||
base 4 of -10: 33333333333333333333333333333312
|
||||
base 4 of -1: 33333333333333333333333333333333
|
||||
base 4 of 0: 0
|
||||
base 4 of 10: 22
|
||||
base 4 of 100: 1210
|
||||
base 4 of 1000: 33220
|
||||
base 4 of 4611686018427387904: 10000000000000000000000000000000
|
||||
base 5 of -10: 2214220303114400424121122411
|
||||
base 5 of -1: 2214220303114400424121122430
|
||||
base 5 of 0: 0
|
||||
base 5 of 10: 20
|
||||
base 5 of 100: 400
|
||||
base 5 of 1000: 13000
|
||||
base 5 of 4611686018427387904: 302141200402211214402403104
|
||||
base 6 of -10: 3520522010102100444244410
|
||||
base 6 of -1: 3520522010102100444244423
|
||||
base 6 of 0: 0
|
||||
base 6 of 10: 14
|
||||
base 6 of 100: 244
|
||||
base 6 of 1000: 4344
|
||||
base 6 of 4611686018427387904: 550120301313313111041104
|
||||
base 7 of -10: 45012021522523134134556
|
||||
base 7 of -1: 45012021522523134134601
|
||||
base 7 of 0: 0
|
||||
base 7 of 10: 13
|
||||
base 7 of 100: 202
|
||||
base 7 of 1000: 2626
|
||||
base 7 of 4611686018427387904: 11154003640456024361134
|
||||
base 8 of -10: 01777777777777777777766
|
||||
base 8 of -1: 01777777777777777777777
|
||||
base 8 of 0: 0
|
||||
base 8 of 10: 012
|
||||
base 8 of 100: 0144
|
||||
base 8 of 1000: 01750
|
||||
base 8 of 4611686018427387904: 0400000000000000000000
|
||||
base 9 of -10: 145808576354216723746
|
||||
base 9 of -1: 145808576354216723756
|
||||
base 9 of 0: 0
|
||||
base 9 of 10: 11
|
||||
base 9 of 100: 121
|
||||
base 9 of 1000: 1331
|
||||
base 9 of 4611686018427387904: 33646586081048405414
|
||||
base 10 of -10: -10
|
||||
base 10 of -1: -1
|
||||
base 10 of 0: 0
|
||||
base 10 of 10: 10
|
||||
base 10 of 100: 100
|
||||
base 10 of 1000: 1000
|
||||
base 10 of 4611686018427387904: 4611686018427387904
|
||||
base 11 of -10: 335500516a429071276
|
||||
base 11 of -1: 335500516a429071284
|
||||
base 11 of 0: 0
|
||||
base 11 of 10: a
|
||||
base 11 of 100: 91
|
||||
base 11 of 1000: 82a
|
||||
base 11 of 4611686018427387904: 9140013181078458a4
|
||||
base 12 of -10: 839365134a2a240706
|
||||
base 12 of -1: 839365134a2a240713
|
||||
base 12 of 0: 0
|
||||
base 12 of 10: a
|
||||
base 12 of 100: 84
|
||||
base 12 of 1000: 6b4
|
||||
base 12 of 4611686018427387904: 20b3a733a268670194
|
||||
base 13 of -10: 219505a9511a867b66
|
||||
base 13 of -1: 219505a9511a867b72
|
||||
base 13 of 0: 0
|
||||
base 13 of 10: a
|
||||
base 13 of 100: 79
|
||||
base 13 of 1000: 5bc
|
||||
base 13 of 4611686018427387904: 6c1349246a2881c84
|
||||
base 14 of -10: 8681049adb03db166
|
||||
base 14 of -1: 8681049adb03db171
|
||||
base 14 of 0: 0
|
||||
base 14 of 10: a
|
||||
base 14 of 100: 72
|
||||
base 14 of 1000: 516
|
||||
base 14 of 4611686018427387904: 219038263637dd3c4
|
||||
base 15 of -10: 2c1d56b648c6cd106
|
||||
base 15 of -1: 2c1d56b648c6cd110
|
||||
base 15 of 0: 0
|
||||
base 15 of 10: a
|
||||
base 15 of 100: 6a
|
||||
base 15 of 1000: 46a
|
||||
base 15 of 4611686018427387904: a7e8ce189a933404
|
||||
base 16 of -10: 0xfffffffffffffff6
|
||||
base 16 of -1: 0xffffffffffffffff
|
||||
base 16 of 0: 0x0
|
||||
base 16 of 10: 0xa
|
||||
base 16 of 100: 0x64
|
||||
base 16 of 1000: 0x3e8
|
||||
base 16 of 4611686018427387904: 0x4000000000000000
|
||||
base 17 of -10: 67979g60f5428008
|
||||
base 17 of -1: 67979g60f5428010
|
||||
base 17 of 0: 0
|
||||
base 17 of 10: a
|
||||
base 17 of 100: 5f
|
||||
base 17 of 1000: 37e
|
||||
base 17 of 4611686018427387904: 1a6a6ca03e10a88d
|
||||
base 18 of -10: 2d3fgb0b9cg4bd26
|
||||
base 18 of -1: 2d3fgb0b9cg4bd2f
|
||||
base 18 of 0: 0
|
||||
base 18 of 10: a
|
||||
base 18 of 100: 5a
|
||||
base 18 of 1000: 31a
|
||||
base 18 of 4611686018427387904: c588bdbfgd12ge4
|
||||
base 19 of -10: 141c8786h1ccaag7
|
||||
base 19 of -1: 141c8786h1ccaagg
|
||||
base 19 of 0: 0
|
||||
base 19 of 10: a
|
||||
base 19 of 100: 55
|
||||
base 19 of 1000: 2ec
|
||||
base 19 of 4611686018427387904: 5ecbb6fi9h7ggi9
|
||||
base 20 of -10: b53bjh07be4dj06
|
||||
base 20 of -1: b53bjh07be4dj0f
|
||||
base 20 of 0: 0
|
||||
base 20 of 10: a
|
||||
base 20 of 100: 50
|
||||
base 20 of 1000: 2a0
|
||||
base 20 of 4611686018427387904: 2g5hjj51hib39f4
|
||||
base 21 of -10: 5e8g4ggg7g56di6
|
||||
base 21 of -1: 5e8g4ggg7g56dif
|
||||
base 21 of 0: 0
|
||||
base 21 of 10: a
|
||||
base 21 of 100: 4g
|
||||
base 21 of 1000: 25d
|
||||
base 21 of 4611686018427387904: 18hjgjjjhebh8f4
|
||||
base 22 of -10: 2l4lf104353j8k6
|
||||
base 22 of -1: 2l4lf104353j8kf
|
||||
base 22 of 0: 0
|
||||
base 22 of 10: a
|
||||
base 22 of 100: 4c
|
||||
base 22 of 1000: 21a
|
||||
base 22 of 4611686018427387904: g6g95gc0hha7g4
|
||||
base 23 of -10: 1ddh88h2782i50j
|
||||
base 23 of -1: 1ddh88h2782i515
|
||||
base 23 of 0: 0
|
||||
base 23 of 10: a
|
||||
base 23 of 100: 48
|
||||
base 23 of 1000: 1kb
|
||||
base 23 of 4611686018427387904: 93a22467dc4chd
|
||||
base 24 of -10: l12ee5fn0ji1i6
|
||||
base 24 of -1: l12ee5fn0ji1if
|
||||
base 24 of 0: 0
|
||||
base 24 of 10: a
|
||||
base 24 of 100: 44
|
||||
base 24 of 1000: 1hg
|
||||
base 24 of 4611686018427387904: 566ffd9ni4mcag
|
||||
base 25 of -10: c9c336o0mlb7e6
|
||||
base 25 of -1: c9c336o0mlb7ef
|
||||
base 25 of 0: 0
|
||||
base 25 of 10: a
|
||||
base 25 of 100: 40
|
||||
base 25 of 1000: 1f0
|
||||
base 25 of 4611686018427387904: 32970kc6bo2kg4
|
||||
base 26 of -10: 7b7n2pcniokcg6
|
||||
base 26 of -1: 7b7n2pcniokcgf
|
||||
base 26 of 0: 0
|
||||
base 26 of 10: a
|
||||
base 26 of 100: 3m
|
||||
base 26 of 1000: 1cc
|
||||
base 26 of 4611686018427387904: 1m8c769io65344
|
||||
base 27 of -10: 4eo8hfam6fllmf
|
||||
base 27 of -1: 4eo8hfam6fllmo
|
||||
base 27 of 0: 0
|
||||
base 27 of 10: a
|
||||
base 27 of 100: 3j
|
||||
base 27 of 1000: 1a1
|
||||
base 27 of 4611686018427387904: 13jfho2j1hc5cd
|
||||
base 28 of -10: 2nc6j26l66rho6
|
||||
base 28 of -1: 2nc6j26l66rhof
|
||||
base 28 of 0: 0
|
||||
base 28 of 10: a
|
||||
base 28 of 100: 3g
|
||||
base 28 of 1000: 17k
|
||||
base 28 of 4611686018427387904: jo1ilfj8fkpd4
|
||||
base 29 of -10: 1n3rsh11f098re
|
||||
base 29 of -1: 1n3rsh11f098rn
|
||||
base 29 of 0: 0
|
||||
base 29 of 10: a
|
||||
base 29 of 100: 3d
|
||||
base 29 of 1000: 15e
|
||||
base 29 of 4611686018427387904: d0slim0b029e6
|
||||
base 30 of -10: 14l9lkmo30o406
|
||||
base 30 of -1: 14l9lkmo30o40f
|
||||
base 30 of 0: 0
|
||||
base 30 of 10: a
|
||||
base 30 of 100: 3a
|
||||
base 30 of 1000: 13a
|
||||
base 30 of 4611686018427387904: 8k9rrkl0ml104
|
||||
base 31 of -10: nd075ib45k866
|
||||
base 31 of -1: nd075ib45k86f
|
||||
base 31 of 0: 0
|
||||
base 31 of 10: a
|
||||
base 31 of 100: 37
|
||||
base 31 of 1000: 118
|
||||
base 31 of 4611686018427387904: 5qfh94i8okhh4
|
||||
base 32 of -10: fvvvvvvvvvvvm
|
||||
base 32 of -1: fvvvvvvvvvvvv
|
||||
base 32 of 0: 0
|
||||
base 32 of 10: a
|
||||
base 32 of 100: 34
|
||||
base 32 of 1000: v8
|
||||
base 32 of 4611686018427387904: 4000000000000
|
||||
base 33 of -10: b1w8p7j5q9r66
|
||||
base 33 of -1: b1w8p7j5q9r6f
|
||||
base 33 of 0: 0
|
||||
base 33 of 10: a
|
||||
base 33 of 100: 31
|
||||
base 33 of 1000: ua
|
||||
base 33 of 4611686018427387904: 2p826a4q6ivi4
|
||||
base 34 of -10: 7orp63sh4dph8
|
||||
base 34 of -1: 7orp63sh4dphh
|
||||
base 34 of 0: 0
|
||||
base 34 of 10: a
|
||||
base 34 of 100: 2w
|
||||
base 34 of 1000: te
|
||||
base 34 of 4611686018427387904: 1vnvr0wl9ketu
|
||||
base 35 of -10: 5g24a25twkwf6
|
||||
base 35 of -1: 5g24a25twkwff
|
||||
base 35 of 0: 0
|
||||
base 35 of 10: a
|
||||
base 35 of 100: 2u
|
||||
base 35 of 1000: sk
|
||||
base 35 of 4611686018427387904: 1cqrb9a7gvgu4
|
||||
base 36 of -10: 3w5e11264sgs6
|
||||
base 36 of -1: 3w5e11264sgsf
|
||||
base 36 of 0: 0
|
||||
base 36 of 10: a
|
||||
base 36 of 100: 2s
|
||||
base 36 of 1000: rs
|
||||
base 36 of 4611686018427387904: z1ci99jj7474
|
||||
base 37 of -10: <error>
|
||||
base 37 of -1: <error>
|
||||
base 37 of 0: <error>
|
||||
base 37 of 10: <error>
|
||||
base 37 of 100: <error>
|
||||
base 37 of 1000: <error>
|
||||
base 37 of 4611686018427387904: <error>
|
||||
base 38 of -10: <error>
|
||||
base 38 of -1: <error>
|
||||
base 38 of 0: <error>
|
||||
base 38 of 10: <error>
|
||||
base 38 of 100: <error>
|
||||
base 38 of 1000: <error>
|
||||
base 38 of 4611686018427387904: <error>
|
||||
base 39 of -10: <error>
|
||||
base 39 of -1: <error>
|
||||
base 39 of 0: <error>
|
||||
base 39 of 10: <error>
|
||||
base 39 of 100: <error>
|
||||
base 39 of 1000: <error>
|
||||
base 39 of 4611686018427387904: <error>
|
||||
base 40 of -10: <error>
|
||||
base 40 of -1: <error>
|
||||
base 40 of 0: <error>
|
||||
base 40 of 10: <error>
|
||||
base 40 of 100: <error>
|
||||
base 40 of 1000: <error>
|
||||
base 40 of 4611686018427387904: <error>
|
||||
|
66
cmd/dtrace/test/tst/common/funcs/tst.tolower.d
Normal file
66
cmd/dtrace/test/tst/common/funcs/tst.tolower.d
Normal file
@ -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 (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
BEGIN
|
||||
{
|
||||
i = 0;
|
||||
|
||||
input[i] = "ahi";
|
||||
expected[i++] = "ahi";
|
||||
|
||||
input[i] = "MaHi!";
|
||||
expected[i++] = "mahi!";
|
||||
|
||||
input[i] = " Nase-5";
|
||||
expected[i++] = " nase-5";
|
||||
|
||||
input[i] = "!@#$%";
|
||||
expected[i++] = "!@#$%";
|
||||
|
||||
i = 0;
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/input[i] != NULL && (this->out = tolower(input[i])) != expected[i]/
|
||||
{
|
||||
printf("expected tolower(\"%s\") to be \"%s\"; found \"%s\"\n",
|
||||
input[i], expected[i], this->out);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/input[i] != NULL/
|
||||
{
|
||||
printf("tolower(\"%s\") is \"%s\", as expected\n",
|
||||
input[i], expected[i]);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/input[i++] == NULL/
|
||||
{
|
||||
exit(0);
|
||||
}
|
66
cmd/dtrace/test/tst/common/funcs/tst.toupper.d
Normal file
66
cmd/dtrace/test/tst/common/funcs/tst.toupper.d
Normal file
@ -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 (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
BEGIN
|
||||
{
|
||||
i = 0;
|
||||
|
||||
input[i] = "ahi";
|
||||
expected[i++] = "AHI";
|
||||
|
||||
input[i] = "MaHi!";
|
||||
expected[i++] = "MAHI!";
|
||||
|
||||
input[i] = " dace-9";
|
||||
expected[i++] = " DACE-9";
|
||||
|
||||
input[i] = "!@#$%";
|
||||
expected[i++] = "!@#$%";
|
||||
|
||||
i = 0;
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/input[i] != NULL && (this->out = toupper(input[i])) != expected[i]/
|
||||
{
|
||||
printf("expected toupper(\"%s\") to be \"%s\"; found \"%s\"\n",
|
||||
input[i], expected[i], this->out);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/input[i] != NULL/
|
||||
{
|
||||
printf("toupper(\"%s\") is \"%s\", as expected\n",
|
||||
input[i], expected[i]);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/input[i++] == NULL/
|
||||
{
|
||||
exit(0);
|
||||
}
|
76
cmd/dtrace/test/tst/common/include/tst.includefirst.ksh
Normal file
76
cmd/dtrace/test/tst/common/include/tst.includefirst.ksh
Normal file
@ -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 (c) 2011, Joyent Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
|
||||
#
|
||||
# This test verifies that we only use the first entry of a file with a given
|
||||
# name in the library path
|
||||
#
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo expected one argument: '<'dtrace-path'>'
|
||||
exit 2
|
||||
fi
|
||||
|
||||
firstinc=${TMPDIR:-/tmp}/firstinc.$$
|
||||
secondinc=${TMPDIR:-/tmp}/secondinc.$$
|
||||
expexit=23
|
||||
|
||||
setup_include()
|
||||
{
|
||||
mkdir $firstinc
|
||||
mkdir $secondinc
|
||||
cat > $firstinc/lib.d <<EOF
|
||||
inline int foobar = $expexit;
|
||||
#pragma D binding "1.0" foobar
|
||||
EOF
|
||||
cat > $secondinc/lib.d <<EOF
|
||||
inline int foobar = 42;
|
||||
#pragma D binding "1.0" foobar
|
||||
EOF
|
||||
}
|
||||
|
||||
clean()
|
||||
{
|
||||
rm -rf $firstinc
|
||||
rm -rf $secondinc
|
||||
}
|
||||
|
||||
fail()
|
||||
{
|
||||
echo "$@"
|
||||
clean
|
||||
exit 1
|
||||
}
|
||||
|
||||
setup_include
|
||||
|
||||
dtrace -L$firstinc -L$secondinc -e -n 'BEGIN{ exit(foobar) }'
|
||||
[[ $? != 0 ]] && fail "Failed to compile with same file in include path twice"
|
||||
dtrace -L$firstinc -L$secondinc -n 'BEGIN{ exit(foobar) }'
|
||||
status=$?
|
||||
[[ $status != $expexit ]] && fail "Exited with unexpected status code: $status"
|
||||
clean
|
||||
exit 0
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/perl -w
|
||||
#!/usr/perl5/bin/perl -w
|
||||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
@ -24,7 +24,6 @@
|
||||
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
#
|
||||
# get.ipv4remote.pl [tcpport]
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/perl -w
|
||||
#!/usr/perl5/bin/perl -w
|
||||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
@ -24,7 +24,6 @@
|
||||
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
#
|
||||
# get.ipv6remote.pl
|
||||
|
@ -75,7 +75,7 @@ cat > test.pl <<-EOPERL
|
||||
close \$s;
|
||||
EOPERL
|
||||
|
||||
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||
$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||
BEGIN
|
||||
{
|
||||
ipsend = tcpsend = ipreceive = tcpreceive = 0;
|
||||
|
@ -78,7 +78,7 @@ cat > test.pl <<-EOPERL
|
||||
close \$s;
|
||||
EOPERL
|
||||
|
||||
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||
$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||
BEGIN
|
||||
{
|
||||
ipsend = tcpsend = ipreceive = tcpreceive = 0;
|
||||
|
@ -81,7 +81,7 @@ cat > test.pl <<-EOPERL
|
||||
close \$s;
|
||||
EOPERL
|
||||
|
||||
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||
$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||
BEGIN
|
||||
{
|
||||
ipsend = tcpsend = ipreceive = tcpreceive = 0;
|
||||
|
@ -86,7 +86,7 @@ cat > test.pl <<-EOPERL
|
||||
close \$s;
|
||||
EOPERL
|
||||
|
||||
$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||
$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||
BEGIN
|
||||
{
|
||||
ipsend = tcpsend = ipreceive = tcpreceive = 0;
|
||||
|
@ -22,8 +22,6 @@
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* ident "%Z%%M% %I% %E% SMI"
|
||||
*/
|
||||
|
||||
import org.opensolaris.os.dtrace.*;
|
||||
@ -50,6 +48,7 @@ public class TestBean {
|
||||
"KernelStackRecord",
|
||||
"LogDistribution",
|
||||
"LinearDistribution",
|
||||
"LogLinearDistribution",
|
||||
"Option",
|
||||
"ProcessState",
|
||||
"ProbeDescription",
|
||||
@ -264,6 +263,50 @@ public class TestBean {
|
||||
return d;
|
||||
}
|
||||
|
||||
public static LogLinearDistribution
|
||||
getLogLinearDistribution()
|
||||
{
|
||||
Distribution.Bucket bucket;
|
||||
long next, step;
|
||||
long low = 0;
|
||||
long high = 6;
|
||||
long factor = 2;
|
||||
long nsteps = 2;
|
||||
int value = 1;
|
||||
int order;
|
||||
|
||||
List < Distribution.Bucket > buckets =
|
||||
new ArrayList < Distribution.Bucket > ();
|
||||
|
||||
for (order = 0; order < low; order++)
|
||||
value *= factor;
|
||||
|
||||
bucket = new Distribution.Bucket(Long.MIN_VALUE, (value - 1), 0);
|
||||
buckets.add(bucket);
|
||||
|
||||
next = value * factor;
|
||||
step = (next > nsteps) ? (next / nsteps) : 1;
|
||||
|
||||
while (order <= high) {
|
||||
bucket = new Distribution.Bucket(value, value + step - 1, 5);
|
||||
buckets.add(bucket);
|
||||
|
||||
if ((value += step) != next)
|
||||
continue;
|
||||
|
||||
next = value * factor;
|
||||
step = (next > nsteps) ? (next / nsteps) : 1;
|
||||
order++;
|
||||
}
|
||||
|
||||
bucket = new Distribution.Bucket(value, Long.MAX_VALUE, 0);
|
||||
buckets.add(bucket);
|
||||
|
||||
LogLinearDistribution d = new LogLinearDistribution(factor, low, high,
|
||||
nsteps, 0, buckets);
|
||||
return d;
|
||||
}
|
||||
|
||||
public static Option
|
||||
getOption()
|
||||
{
|
||||
|
@ -158,6 +158,12 @@ LinearDistribution:
|
||||
LinearDistribution:
|
||||
encoded: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]
|
||||
decoded: class org.opensolaris.os.dtrace.LinearDistribution[base = 1, step = 10, buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 10, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 11, max = 20, frequency = 1], org.opensolaris.os.dtrace.Distribution$Bucket[min = 21, max = 30, frequency = 2], org.opensolaris.os.dtrace.Distribution$Bucket[min = 31, max = 40, frequency = 3], org.opensolaris.os.dtrace.Distribution$Bucket[min = 41, max = 50, frequency = 4], org.opensolaris.os.dtrace.Distribution$Bucket[min = 51, max = 60, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 61, max = 70, frequency = 6], org.opensolaris.os.dtrace.Distribution$Bucket[min = 71, max = 80, frequency = 7], org.opensolaris.os.dtrace.Distribution$Bucket[min = 81, max = 90, frequency = 8], org.opensolaris.os.dtrace.Distribution$Bucket[min = 91, max = 100, frequency = 9], org.opensolaris.os.dtrace.Distribution$Bucket[min = 101, max = 9223372036854775807, frequency = 0]], total = 45.0]
|
||||
LogLinearDistribution:
|
||||
serialized: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -9223372036854775808, max = 0, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 9223372036854775807, frequency = 0]], total = 35.0]
|
||||
deserialized: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -9223372036854775808, max = 0, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 9223372036854775807, frequency = 0]], total = 35.0]
|
||||
LogLinearDistribution:
|
||||
encoded: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -9223372036854775808, max = 0, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 9223372036854775807, frequency = 0]], total = 35.0]
|
||||
decoded: org.opensolaris.os.dtrace.Distribution[buckets = [org.opensolaris.os.dtrace.Distribution$Bucket[min = -9223372036854775808, max = 0, frequency = 0], org.opensolaris.os.dtrace.Distribution$Bucket[min = 1, max = 1, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 2, max = 3, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 4, max = 7, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 8, max = 15, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 16, max = 31, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 32, max = 63, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 64, max = 127, frequency = 5], org.opensolaris.os.dtrace.Distribution$Bucket[min = 128, max = 9223372036854775807, frequency = 0]], total = 35.0]
|
||||
Option:
|
||||
serialized: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s]
|
||||
deserialized: org.opensolaris.os.dtrace.Option[name = aggrate, value = 1s]
|
||||
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, 0, 10, 25);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, 0, 10, 30);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, 0, 10, 10);
|
||||
@ = llquantize(0, 3, 0, 10, 81);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, 0, 10, 7);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 1, 0, 10, 10);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
this->doogle = 10;
|
||||
@ = llquantize(0, this->doogle, 0, 10, 10);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 65537, 0, 10, 10);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, 0, 10, 10);
|
||||
@ = llquantize(0, 10, 0, 11, 10);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
this->doogle = 10;
|
||||
@ = llquantize(0, 10, 0, this->doogle, 10);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, 0, -1, 10);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, 0, 10, 10);
|
||||
@ = llquantize(0, 10, 1, 10, 10);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
this->doogle = 0;
|
||||
@ = llquantize(0, 10, this->doogle, 10, 10);
|
||||
}
|
29
cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d
Normal file
29
cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_LOWVAL.d
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, -1, 10, 10);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, 10, 0, 10);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, 0, 100, 10);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(0, 10, 0, 10, 10);
|
||||
@ = llquantize(0, 10, 0, 10, 100);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
this->doogle = 10;
|
||||
@ = llquantize(0, 10, 0, 10, this->doogle);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = llquantize(123, 10, 0, 10, 123456);
|
||||
}
|
46
cmd/dtrace/test/tst/common/llquantize/tst.bases.d
Normal file
46
cmd/dtrace/test/tst/common/llquantize/tst.bases.d
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
tick-1ms
|
||||
/i++ <= 100/
|
||||
{
|
||||
@two = llquantize(i, 2, 0, 6, 2);
|
||||
@three = llquantize(i, 3, 0, 1, 9);
|
||||
@four = llquantize(i, 4, 0, 1, 4);
|
||||
@five = llquantize(i, 5, 0, 1, 25);
|
||||
@six = llquantize(i, 6, 0, 3, 12);
|
||||
@seven = llquantize(i, 7, 0, 1, 7);
|
||||
@eight = llquantize(i, 8, 0, 1, 16);
|
||||
@nine = llquantize(i, 9, 0, 1, 9);
|
||||
@ten = llquantize(i, 10, 0, 1, 10);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/i > 100/
|
||||
{
|
||||
exit(0);
|
||||
}
|
177
cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out
Normal file
177
cmd/dtrace/test/tst/common/llquantize/tst.bases.d.out
Normal file
@ -0,0 +1,177 @@
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 1
|
||||
2 |@ 2
|
||||
4 |@@ 4
|
||||
8 |@@@ 8
|
||||
16 |@@@@@@ 16
|
||||
32 |@@@@@@@@@@@@@ 32
|
||||
64 |@@@@@@@@@@@@@@@ 38
|
||||
>= 128 | 0
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 1
|
||||
2 | 1
|
||||
3 | 1
|
||||
4 | 1
|
||||
5 | 1
|
||||
6 | 1
|
||||
7 | 1
|
||||
8 | 1
|
||||
>= 9 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 93
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 1
|
||||
2 | 1
|
||||
3 | 1
|
||||
4 |@@ 4
|
||||
8 |@@ 4
|
||||
12 |@@ 4
|
||||
>= 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 86
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 1
|
||||
2 | 1
|
||||
3 | 1
|
||||
4 | 1
|
||||
5 | 1
|
||||
6 | 1
|
||||
7 | 1
|
||||
8 | 1
|
||||
9 | 1
|
||||
10 | 1
|
||||
11 | 1
|
||||
12 | 1
|
||||
13 | 1
|
||||
14 | 1
|
||||
15 | 1
|
||||
16 | 1
|
||||
17 | 1
|
||||
18 | 1
|
||||
19 | 1
|
||||
20 | 1
|
||||
21 | 1
|
||||
22 | 1
|
||||
23 | 1
|
||||
24 | 1
|
||||
>= 25 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 77
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 1
|
||||
2 | 1
|
||||
3 | 1
|
||||
4 | 1
|
||||
5 | 1
|
||||
6 |@ 3
|
||||
9 |@ 3
|
||||
12 |@ 3
|
||||
15 |@ 3
|
||||
18 |@ 3
|
||||
21 |@ 3
|
||||
24 |@ 3
|
||||
27 |@ 3
|
||||
30 |@ 3
|
||||
33 |@ 3
|
||||
36 |@@@@@@@ 18
|
||||
54 |@@@@@@@ 18
|
||||
72 |@@@@@@@ 18
|
||||
90 |@@@@@ 12
|
||||
108 | 0
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 1
|
||||
2 | 1
|
||||
3 | 1
|
||||
4 | 1
|
||||
5 | 1
|
||||
6 | 1
|
||||
7 |@@@ 7
|
||||
14 |@@@ 7
|
||||
21 |@@@ 7
|
||||
28 |@@@ 7
|
||||
35 |@@@ 7
|
||||
42 |@@@ 7
|
||||
>= 49 |@@@@@@@@@@@@@@@@@@@@@ 53
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 1
|
||||
2 | 1
|
||||
3 | 1
|
||||
4 | 1
|
||||
5 | 1
|
||||
6 | 1
|
||||
7 | 1
|
||||
8 |@@ 4
|
||||
12 |@@ 4
|
||||
16 |@@ 4
|
||||
20 |@@ 4
|
||||
24 |@@ 4
|
||||
28 |@@ 4
|
||||
32 |@@ 4
|
||||
36 |@@ 4
|
||||
40 |@@ 4
|
||||
44 |@@ 4
|
||||
48 |@@ 4
|
||||
52 |@@ 4
|
||||
56 |@@ 4
|
||||
60 |@@ 4
|
||||
>= 64 |@@@@@@@@@@@@@@@ 38
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 1
|
||||
2 | 1
|
||||
3 | 1
|
||||
4 | 1
|
||||
5 | 1
|
||||
6 | 1
|
||||
7 | 1
|
||||
8 | 1
|
||||
9 |@@@@ 9
|
||||
18 |@@@@ 9
|
||||
27 |@@@@ 9
|
||||
36 |@@@@ 9
|
||||
45 |@@@@ 9
|
||||
54 |@@@@ 9
|
||||
63 |@@@@ 9
|
||||
72 |@@@@ 9
|
||||
>= 81 |@@@@@@@@ 21
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 1
|
||||
2 | 1
|
||||
3 | 1
|
||||
4 | 1
|
||||
5 | 1
|
||||
6 | 1
|
||||
7 | 1
|
||||
8 | 1
|
||||
9 | 1
|
||||
10 |@@@@ 10
|
||||
20 |@@@@ 10
|
||||
30 |@@@@ 10
|
||||
40 |@@@@ 10
|
||||
50 |@@@@ 10
|
||||
60 |@@@@ 10
|
||||
70 |@@@@ 10
|
||||
80 |@@@@ 10
|
||||
90 |@@@@ 10
|
||||
>= 100 |@ 2
|
||||
|
38
cmd/dtrace/test/tst/common/llquantize/tst.basic.d
Normal file
38
cmd/dtrace/test/tst/common/llquantize/tst.basic.d
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
tick-1ms
|
||||
/i++ <= 100/
|
||||
{
|
||||
@ = llquantize(i, 10, 0, 10, 10);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/i > 100/
|
||||
{
|
||||
exit(0);
|
||||
}
|
25
cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out
Normal file
25
cmd/dtrace/test/tst/common/llquantize/tst.basic.d.out
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 1
|
||||
2 | 1
|
||||
3 | 1
|
||||
4 | 1
|
||||
5 | 1
|
||||
6 | 1
|
||||
7 | 1
|
||||
8 | 1
|
||||
9 | 1
|
||||
10 |@@@@ 10
|
||||
20 |@@@@ 10
|
||||
30 |@@@@ 10
|
||||
40 |@@@@ 10
|
||||
50 |@@@@ 10
|
||||
60 |@@@@ 10
|
||||
70 |@@@@ 10
|
||||
80 |@@@@ 10
|
||||
90 |@@@@ 10
|
||||
100 |@ 2
|
||||
200 | 0
|
||||
|
62
cmd/dtrace/test/tst/common/llquantize/tst.negorder.d
Normal file
62
cmd/dtrace/test/tst/common/llquantize/tst.negorder.d
Normal file
@ -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 (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
BEGIN
|
||||
{
|
||||
a = 7;
|
||||
b = 13;
|
||||
val = (-a * b) + a;
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
{
|
||||
incr = val % b;
|
||||
val += a;
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/val == 0/
|
||||
{
|
||||
val += a;
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/incr != 0/
|
||||
{
|
||||
i++;
|
||||
@llquanty[i] = llquantize(1, 10, 0, 10, 10, incr);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/incr == 0/
|
||||
{
|
||||
printf("Ordering of llquantize() with some negative weights:\n");
|
||||
printa(@llquanty);
|
||||
printf("\n");
|
||||
|
||||
exit(0);
|
||||
}
|
148
cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out
Normal file
148
cmd/dtrace/test/tst/common/llquantize/tst.negorder.d.out
Normal file
@ -0,0 +1,148 @@
|
||||
Ordering of llquantize() with some negative weights:
|
||||
|
||||
2
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -12
|
||||
2 | 0
|
||||
|
||||
4
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -11
|
||||
2 | 0
|
||||
|
||||
6
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -10
|
||||
2 | 0
|
||||
|
||||
8
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -9
|
||||
2 | 0
|
||||
|
||||
10
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -8
|
||||
2 | 0
|
||||
|
||||
12
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -7
|
||||
2 | 0
|
||||
|
||||
1
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -6
|
||||
2 | 0
|
||||
|
||||
3
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -5
|
||||
2 | 0
|
||||
|
||||
5
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -4
|
||||
2 | 0
|
||||
|
||||
7
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -3
|
||||
2 | 0
|
||||
|
||||
9
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -2
|
||||
2 | 0
|
||||
|
||||
11
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -1
|
||||
2 | 0
|
||||
|
||||
14
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
|
||||
2 | 0
|
||||
|
||||
16
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
|
||||
2 | 0
|
||||
|
||||
18
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
|
||||
2 | 0
|
||||
|
||||
20
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
|
||||
2 | 0
|
||||
|
||||
22
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
|
||||
2 | 0
|
||||
|
||||
24
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
|
||||
2 | 0
|
||||
|
||||
13
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7
|
||||
2 | 0
|
||||
|
||||
15
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
|
||||
2 | 0
|
||||
|
||||
17
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9
|
||||
2 | 0
|
||||
|
||||
19
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 10
|
||||
2 | 0
|
||||
|
||||
21
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 11
|
||||
2 | 0
|
||||
|
||||
23
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 12
|
||||
2 | 0
|
||||
|
||||
|
||||
|
38
cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d
Normal file
38
cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
tick-1ms
|
||||
/i++ <= 100/
|
||||
{
|
||||
@ = llquantize(i, 10, 0, 10, 10, 50 - i);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/i > 100/
|
||||
{
|
||||
exit(0);
|
||||
}
|
25
cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out
Normal file
25
cmd/dtrace/test/tst/common/llquantize/tst.negvalue.d.out
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 49
|
||||
2 | 48
|
||||
3 | 47
|
||||
4 | 46
|
||||
5 | 45
|
||||
6 | 44
|
||||
7 | 43
|
||||
8 | 42
|
||||
9 | 41
|
||||
10 |@@@ 355
|
||||
20 |@@ 255
|
||||
30 |@ 155
|
||||
40 | 55
|
||||
50 | -45
|
||||
60 @| -145
|
||||
70 @@| -245
|
||||
80 @@@| -345
|
||||
90 @@@| -445
|
||||
100 @| -101
|
||||
200 | 0
|
||||
|
40
cmd/dtrace/test/tst/common/llquantize/tst.normal.d
Normal file
40
cmd/dtrace/test/tst/common/llquantize/tst.normal.d
Normal file
@ -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 (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
tick-1ms
|
||||
/i++ <= 100/
|
||||
{
|
||||
@ = llquantize(i, 10, 0, 10, 10);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/i > 100/
|
||||
{
|
||||
normalize(@, 10);
|
||||
printa(@);
|
||||
exit(0);
|
||||
}
|
26
cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out
Normal file
26
cmd/dtrace/test/tst/common/llquantize/tst.normal.d.out
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
value ------------- Distribution ------------- count
|
||||
< 1 | 0
|
||||
1 | 0
|
||||
2 | 0
|
||||
3 | 0
|
||||
4 | 0
|
||||
5 | 0
|
||||
6 | 0
|
||||
7 | 0
|
||||
8 | 0
|
||||
9 | 0
|
||||
10 |@@@@ 1
|
||||
20 |@@@@ 1
|
||||
30 |@@@@ 1
|
||||
40 |@@@@ 1
|
||||
50 |@@@@ 1
|
||||
60 |@@@@ 1
|
||||
70 |@@@@ 1
|
||||
80 |@@@@ 1
|
||||
90 |@@@@ 1
|
||||
100 |@ 0
|
||||
200 | 0
|
||||
|
||||
|
38
cmd/dtrace/test/tst/common/llquantize/tst.range.d
Normal file
38
cmd/dtrace/test/tst/common/llquantize/tst.range.d
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@["Screven"] = llquantize(0, 10, 1, 2, 20, 25);
|
||||
@["Katz"] = llquantize(1, 10, 1, 2, 20, -100);
|
||||
@["Kurian"] = llquantize(7, 10, 1, 2, 20, 15);
|
||||
@["Rozwat"] = llquantize(49, 10, 1, 2, 20, 15);
|
||||
@["Fowler"] = llquantize(343, 10, 1, 2, 20, 150);
|
||||
|
||||
printa(@);
|
||||
exit(0);
|
||||
}
|
29
cmd/dtrace/test/tst/common/llquantize/tst.range.d.out
Normal file
29
cmd/dtrace/test/tst/common/llquantize/tst.range.d.out
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
Katz
|
||||
value ------------- Distribution ------------- count
|
||||
< 10 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100
|
||||
10 | 0
|
||||
|
||||
Kurian
|
||||
value ------------- Distribution ------------- count
|
||||
< 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 15
|
||||
10 | 0
|
||||
|
||||
Screven
|
||||
value ------------- Distribution ------------- count
|
||||
< 10 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 25
|
||||
10 | 0
|
||||
|
||||
Rozwat
|
||||
value ------------- Distribution ------------- count
|
||||
40 | 0
|
||||
45 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 15
|
||||
50 | 0
|
||||
|
||||
Fowler
|
||||
value ------------- Distribution ------------- count
|
||||
250 | 0
|
||||
300 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 150
|
||||
350 | 0
|
||||
|
||||
|
52
cmd/dtrace/test/tst/common/llquantize/tst.steps.d
Normal file
52
cmd/dtrace/test/tst/common/llquantize/tst.steps.d
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
tick-1ms
|
||||
/i++ <= 100/
|
||||
{
|
||||
@ = llquantize(i, 10, 0, 10, 20);
|
||||
@hunid = llquantize(i * 10, 10, 0, 10, 100);
|
||||
@large = llquantize(i * 100, 10, 0, 10, 1000);
|
||||
}
|
||||
|
||||
tick-1ms
|
||||
/i > 100/
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
END
|
||||
{
|
||||
printf("20 steps:\n");
|
||||
printa(@);
|
||||
|
||||
printf("100 steps:\n");
|
||||
printa(@hunid);
|
||||
|
||||
printf("1000 steps:\n");
|
||||
printa(@large);
|
||||
}
|
2033
cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out
Normal file
2033
cmd/dtrace/test/tst/common/llquantize/tst.steps.d.out
Normal file
File diff suppressed because it is too large
Load Diff
49
cmd/dtrace/test/tst/common/llquantize/tst.trunc.d
Normal file
49
cmd/dtrace/test/tst/common/llquantize/tst.trunc.d
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
int i;
|
||||
|
||||
tick-10ms
|
||||
/i < 100/
|
||||
{
|
||||
@[i] = llquantize(i, 10, 1, 2, 10, 150);
|
||||
@[i] = llquantize(i + 1, 10, 1, 2, 10, 150);
|
||||
@[i] = llquantize(i + 2, 10, 1, 2, 10, 150);
|
||||
@[i] = llquantize(i + 3, 10, 1, 2, 10, 150);
|
||||
i++;
|
||||
}
|
||||
|
||||
tick-10ms
|
||||
/i == 100/
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
END
|
||||
{
|
||||
trunc(@, 5);
|
||||
}
|
34
cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out
Normal file
34
cmd/dtrace/test/tst/common/llquantize/tst.trunc.d.out
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
95
|
||||
value ------------- Distribution ------------- count
|
||||
80 | 0
|
||||
90 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 600
|
||||
100 | 0
|
||||
|
||||
96
|
||||
value ------------- Distribution ------------- count
|
||||
80 | 0
|
||||
90 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 600
|
||||
100 | 0
|
||||
|
||||
97
|
||||
value ------------- Distribution ------------- count
|
||||
80 | 0
|
||||
90 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 450
|
||||
100 |@@@@@@@@@@ 150
|
||||
200 | 0
|
||||
|
||||
98
|
||||
value ------------- Distribution ------------- count
|
||||
80 | 0
|
||||
90 |@@@@@@@@@@@@@@@@@@@@ 300
|
||||
100 |@@@@@@@@@@@@@@@@@@@@ 300
|
||||
200 | 0
|
||||
|
||||
99
|
||||
value ------------- Distribution ------------- count
|
||||
80 | 0
|
||||
90 |@@@@@@@@@@ 150
|
||||
100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 450
|
||||
200 | 0
|
||||
|
@ -24,8 +24,6 @@
|
||||
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
#
|
||||
|
||||
#
|
||||
# This script primarily tests that the ::dtrace dcmd is not dumping
|
||||
@ -36,7 +34,7 @@
|
||||
|
||||
script()
|
||||
{
|
||||
$dtrace -o $dtraceout -s /dev/stdin <<EOF
|
||||
exec $dtrace -o $dtraceout -s /dev/stdin <<EOF
|
||||
syscall:::entry
|
||||
{
|
||||
@[probefunc] = count();
|
||||
|
@ -23,7 +23,6 @@
|
||||
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo expected one argument: '<'dtrace-path'>'
|
||||
@ -31,7 +30,7 @@ if [ $# != 1 ]; then
|
||||
fi
|
||||
|
||||
dtrace=$1
|
||||
CC=/usr/sfw/bin/gcc
|
||||
CC=`which gcc`
|
||||
CFLAGS=
|
||||
|
||||
doit()
|
||||
@ -83,13 +82,37 @@ files=/usr/include/sys/*.h
|
||||
# because they include static globals (!) or function bodies (!!) in the header
|
||||
# file. Hopefully these remain sufficiently few that the O(#files * #badfiles)
|
||||
# algorithm, below, doesn't become a problem. (And yes, writing scripts in
|
||||
# something other than ksh1888 would probably be a good idea.) If this script
|
||||
# something other than ksh would probably be a good idea.) If this script
|
||||
# becomes a problem, kindly fix it by reducing the number of bad files! (That
|
||||
# is, fix it by fixing the broken file, not the broken script.)
|
||||
#
|
||||
badfiles="ctype.h eri_msg.h ser_sync.h sbpro.h neti.h hook_event.h \
|
||||
bootconf.h bootstat.h dtrace.h dumphdr.h exacct_impl.h fasttrap.h \
|
||||
kobj.h kobj_impl.h ksyms.h lockstat.h smedia.h stat.h utsname.h"
|
||||
badfiles="\
|
||||
bootconf.h \
|
||||
bootstat.h \
|
||||
ctype.h \
|
||||
dtrace.h \
|
||||
dumphdr.h \
|
||||
exacct_impl.h \
|
||||
fasttrap.h \
|
||||
hook_event.h \
|
||||
iscsi_authclient.h \
|
||||
kiconv_ja.h \
|
||||
kiconv_ja_jis_to_unicode.h \
|
||||
kiconv_ja_unicode_to_jis.h \
|
||||
kobj.h \
|
||||
kobj_impl.h \
|
||||
ksyms.h \
|
||||
lockstat.h \
|
||||
neti.h \
|
||||
rds.h \
|
||||
ser_sync.h \
|
||||
smbios_impl.h \
|
||||
smedia.h \
|
||||
sockfilter.h \
|
||||
stat.h \
|
||||
u8_textprep_data.h \
|
||||
utsname.h \
|
||||
vnic.h"
|
||||
|
||||
for inc in $files; do
|
||||
file=`basename $inc`
|
||||
|
@ -4,12 +4,15 @@ read entry
|
||||
FUNCTION NAME
|
||||
read entry
|
||||
readlink entry
|
||||
readlinkat entry
|
||||
readv entry
|
||||
FUNCTION NAME
|
||||
read entry
|
||||
readlink entry
|
||||
readlinkat entry
|
||||
readv entry
|
||||
FUNCTION NAME
|
||||
readlink entry
|
||||
readlinkat entry
|
||||
FUNCTION NAME
|
||||
pread64 entry
|
||||
|
@ -23,7 +23,6 @@
|
||||
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
#ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo expected one argument: '<'dtrace-path'>'
|
||||
@ -33,13 +32,12 @@ fi
|
||||
dtrace=$1
|
||||
|
||||
#
|
||||
# /usr/ccs/bin/nm execs a 64-bit version of itself. DTrace uses libproc
|
||||
# (which uses /proc) to find out when the traced process exits, but a
|
||||
# 32-bit process can't examine a 64-bit one with libproc. The
|
||||
# LD_NOEXEC_64 variable prevents nm from re-execing itself.
|
||||
# Some variants of nm may exec a 64-bit version of themselves. DTrace uses
|
||||
# libproc (which uses /proc) to find out when the traced process exits, but a
|
||||
# 32-bit process can't examine a 64-bit one with libproc. The LD_NOEXEC_64
|
||||
# variable prevents nm from re-execing itself.
|
||||
#
|
||||
LD_NOEXEC_64=tomeeisrad $dtrace -F -s /dev/stdin -c \
|
||||
'/usr/ccs/bin/nm /bin/ls' stat <<EOF
|
||||
LD_NOEXEC_64=nono $dtrace -F -s /dev/stdin -c 'nm /bin/ls' stat <<EOF
|
||||
|
||||
pid\$target::\$1:entry
|
||||
{
|
||||
|
@ -24,7 +24,6 @@
|
||||
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
#
|
||||
# This test verifies that specifying a glob in a pid provider name
|
||||
@ -46,10 +45,10 @@ cat > Makefile <<EOF
|
||||
all: main
|
||||
|
||||
main: main.o
|
||||
cc -o main main.o
|
||||
gcc -o main main.o
|
||||
|
||||
main.o: main.c
|
||||
cc -c main.c
|
||||
gcc -c main.c
|
||||
EOF
|
||||
|
||||
cat > main.c <<EOF
|
||||
|
@ -24,7 +24,6 @@
|
||||
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
#
|
||||
# This test verifies that probes will be picked up after a dlopen(3C)
|
||||
@ -46,16 +45,16 @@ cat > Makefile <<EOF
|
||||
all: main altlib.so
|
||||
|
||||
main: main.o
|
||||
cc -o main main.o
|
||||
gcc -o main main.o
|
||||
|
||||
main.o: main.c
|
||||
cc -c main.c
|
||||
gcc -c main.c
|
||||
|
||||
altlib.so: altlib.o
|
||||
cc -z defs -G -o altlib.so altlib.o -lc
|
||||
gcc -shared -o altlib.so altlib.o -lc
|
||||
|
||||
altlib.o: altlib.c
|
||||
cc -c altlib.c
|
||||
gcc -c altlib.c
|
||||
EOF
|
||||
|
||||
cat > altlib.c <<EOF
|
||||
|
@ -24,7 +24,6 @@
|
||||
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
#
|
||||
# This test verifies that a regex in the provider name will match
|
||||
@ -44,13 +43,13 @@ mkdir $DIR
|
||||
cd $DIR
|
||||
|
||||
cat > Makefile <<EOF
|
||||
all: main
|
||||
all: main
|
||||
|
||||
main: main.o prov.o
|
||||
cc -o main main.o prov.o
|
||||
gcc -o main main.o prov.o
|
||||
|
||||
main.o: main.c prov.h
|
||||
cc -c main.c
|
||||
gcc -c main.c
|
||||
|
||||
prov.h: prov.d
|
||||
$dtrace -h -s prov.d
|
||||
|
@ -24,7 +24,6 @@
|
||||
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
#
|
||||
# This test verifies that USDT probes will be picked up after a dlopen(3C)
|
||||
@ -47,10 +46,10 @@ cat > Makefile <<EOF
|
||||
all: main altlib.so
|
||||
|
||||
main: main.o provmain.o
|
||||
cc -o main main.o provmain.o
|
||||
gcc -o main main.o provmain.o
|
||||
|
||||
main.o: main.c prov.h
|
||||
cc -c main.c
|
||||
gcc -c main.c
|
||||
|
||||
prov.h: prov.d
|
||||
$dtrace -h -s prov.d
|
||||
@ -59,10 +58,10 @@ provmain.o: prov.d main.o
|
||||
$dtrace -G -32 -o provmain.o -s prov.d main.o
|
||||
|
||||
altlib.so: altlib.o provalt.o
|
||||
cc -z defs -G -o altlib.so altlib.o provalt.o -lc
|
||||
gcc -shared -o altlib.so altlib.o provalt.o -lc
|
||||
|
||||
altlib.o: altlib.c prov.h
|
||||
cc -c altlib.c
|
||||
gcc -c altlib.c
|
||||
|
||||
provalt.o: prov.d altlib.o
|
||||
$dtrace -G -32 -o provalt.o -s prov.d altlib.o
|
||||
|
76
cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh
Normal file
76
cmd/dtrace/test/tst/common/pragma/tst.libdepsepdir.ksh
Normal file
@ -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 (c) 2011, Joyent Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
|
||||
#
|
||||
# Test to catch that we properly look for libraries dependencies in
|
||||
# our full library parth
|
||||
#
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo expected one argument: '<'dtrace-path'>'
|
||||
exit 2
|
||||
fi
|
||||
|
||||
libdira=${TMPDIR:-/tmp}/libdepa.$$
|
||||
libdirb=${TMPDIR:-/tmp}/libdepb.$$
|
||||
libdirc=${TMPDIR:-/tmp}/libdepc.$$
|
||||
dtrace=$1
|
||||
|
||||
setup_libs()
|
||||
{
|
||||
mkdir $libdira
|
||||
mkdir $libdirb
|
||||
mkdir $libdirc
|
||||
cat > $libdira/liba.$$.d <<EOF
|
||||
#pragma D depends_on library libb.$$.d
|
||||
#pragma D depends_on library libc.$$.d
|
||||
#pragma D depends_on library libd.$$.d
|
||||
EOF
|
||||
cat > $libdirb/libb.$$.d <<EOF
|
||||
#pragma D depends_on library libc.$$.d
|
||||
EOF
|
||||
cat > $libdirb/libc.$$.d <<EOF
|
||||
EOF
|
||||
cat > $libdirb/libd.$$.d <<EOF
|
||||
EOF
|
||||
cat > $libdirc/libe.$$.d <<EOF
|
||||
#pragma D depends_on library liba.$$.d
|
||||
EOF
|
||||
cat > $libdirc/libf.$$.d <<EOF
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
setup_libs
|
||||
|
||||
$dtrace -L$libdira -L$libdirb -L$libdirc -e
|
||||
|
||||
status=$?
|
||||
rm -rf $libdira
|
||||
rm -rf $libdirb
|
||||
rm -rf $libdirc
|
||||
return $status
|
||||
|
29
cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d
Normal file
29
cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
print(*curpsinfo);
|
||||
}
|
29
cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d
Normal file
29
cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
print((void)`p0);
|
||||
}
|
29
cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d
Normal file
29
cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
print();
|
||||
}
|
62
cmd/dtrace/test/tst/common/print/tst.array.d
Normal file
62
cmd/dtrace/test/tst/common/print/tst.array.d
Normal file
@ -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 (c) 2011 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
typedef struct bar {
|
||||
int alpha;
|
||||
} bar_t;
|
||||
|
||||
typedef struct foo {
|
||||
int a[3];
|
||||
char b[30];
|
||||
bar_t c[2];
|
||||
char d[3];
|
||||
} foo_t;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
this->f = (foo_t *)alloca(sizeof (foo_t));
|
||||
|
||||
this->f->a[0] = 1;
|
||||
this->f->a[1] = 2;
|
||||
this->f->a[2] = 3;
|
||||
this->f->b[0] = 'a';
|
||||
this->f->b[1] = 'b';
|
||||
this->f->b[2] = 0;
|
||||
this->f->c[0].alpha = 5;
|
||||
this->f->c[1].alpha = 6;
|
||||
this->f->c[2].alpha = 7;
|
||||
this->f->d[0] = 4;
|
||||
this->f->d[1] = 0;
|
||||
this->f->d[2] = 0;
|
||||
|
||||
print(this->f->a);
|
||||
print(this->f->b);
|
||||
print(this->f->c);
|
||||
print(*this->f);
|
||||
|
||||
exit(0);
|
||||
}
|
23
cmd/dtrace/test/tst/common/print/tst.array.d.out
Normal file
23
cmd/dtrace/test/tst/common/print/tst.array.d.out
Normal file
@ -0,0 +1,23 @@
|
||||
int [3] [ 0x1, 0x2, 0x3 ]
|
||||
char [30] "ab"
|
||||
bar_t [2] [
|
||||
bar_t {
|
||||
int alpha = 0x5
|
||||
},
|
||||
bar_t {
|
||||
int alpha = 0x6
|
||||
}
|
||||
]
|
||||
foo_t {
|
||||
int [3] a = [ 0x1, 0x2, 0x3 ]
|
||||
char [30] b = [ "ab" ]
|
||||
bar_t [2] c = [
|
||||
bar_t {
|
||||
int alpha = 0x5
|
||||
},
|
||||
bar_t {
|
||||
int alpha = 0x6
|
||||
}
|
||||
]
|
||||
char [3] d = [ '\004', '\0', '\0' ]
|
||||
}
|
49
cmd/dtrace/test/tst/common/print/tst.bitfield.d
Normal file
49
cmd/dtrace/test/tst/common/print/tst.bitfield.d
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
typedef struct forward forward_t;
|
||||
|
||||
typedef struct foo {
|
||||
int a:4;
|
||||
int b:7;
|
||||
int c:1;
|
||||
int d:2;
|
||||
} foo_t;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
this->s = (foo_t *)alloca(sizeof (foo_t));
|
||||
|
||||
this->s->a = 1;
|
||||
this->s->b = 5;
|
||||
this->s->c = 0;
|
||||
this->s->d = 2;
|
||||
|
||||
print(*this->s);
|
||||
|
||||
exit(0);
|
||||
}
|
6
cmd/dtrace/test/tst/common/print/tst.bitfield.d.out
Normal file
6
cmd/dtrace/test/tst/common/print/tst.bitfield.d.out
Normal file
@ -0,0 +1,6 @@
|
||||
foo_t {
|
||||
int a :4 = 0x1
|
||||
int b :7 = 0x5
|
||||
int c :1 = 0
|
||||
int d :2 = 0x2
|
||||
}
|
45
cmd/dtrace/test/tst/common/print/tst.primitive.d
Normal file
45
cmd/dtrace/test/tst/common/print/tst.primitive.d
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
BEGIN
|
||||
{
|
||||
i = (int)'a';
|
||||
|
||||
printf("\n");
|
||||
|
||||
print((char)'a');
|
||||
print((int)-1);
|
||||
print((unsigned int)23);
|
||||
print((short)456);
|
||||
print((unsigned short)789);
|
||||
print((long)1234);
|
||||
print((ulong_t)56789);
|
||||
print((void *)0x1234);
|
||||
print("hello");
|
||||
|
||||
exit(0);
|
||||
}
|
11
cmd/dtrace/test/tst/common/print/tst.primitive.d.out
Normal file
11
cmd/dtrace/test/tst/common/print/tst.primitive.d.out
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
char 'a'
|
||||
int 0xffffffff
|
||||
unsigned int 0x17
|
||||
short 0x1c8
|
||||
unsigned short 0x315
|
||||
long 0x4d2
|
||||
ulong_t 0xddd5
|
||||
void * 0x1234
|
||||
string "hello"
|
||||
|
59
cmd/dtrace/test/tst/common/print/tst.struct.d
Normal file
59
cmd/dtrace/test/tst/common/print/tst.struct.d
Normal file
@ -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 (c) 2011 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
typedef struct forward forward_t;
|
||||
|
||||
typedef struct foo {
|
||||
int a;
|
||||
void *b;
|
||||
struct {
|
||||
uint64_t alpha;
|
||||
uint64_t beta;
|
||||
} c;
|
||||
ushort_t d;
|
||||
int e;
|
||||
forward_t *f;
|
||||
void (*g)();
|
||||
} foo_t;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
this->s = (foo_t *)alloca(sizeof (foo_t));
|
||||
|
||||
this->s->a = 1;
|
||||
this->s->b = (void *)2;
|
||||
this->s->c.alpha = 3;
|
||||
this->s->c.beta = 4;
|
||||
this->s->d = 5;
|
||||
this->s->e = 6;
|
||||
this->s->f = (void *)7;
|
||||
this->s->g = (void *)8;
|
||||
|
||||
print(*this->s);
|
||||
|
||||
exit(0);
|
||||
}
|
12
cmd/dtrace/test/tst/common/print/tst.struct.d.out
Normal file
12
cmd/dtrace/test/tst/common/print/tst.struct.d.out
Normal file
@ -0,0 +1,12 @@
|
||||
foo_t {
|
||||
int a = 0x1
|
||||
void *b = 0x2
|
||||
struct c = {
|
||||
uint64_t alpha = 0x3
|
||||
uint64_t beta = 0x4
|
||||
}
|
||||
ushort_t d = 0x5
|
||||
int e = 0x6
|
||||
forward_t *f = 0x7
|
||||
int (*)() g = 0x8
|
||||
}
|
@ -50,7 +50,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
EOF
|
||||
|
||||
cc -o test test.c
|
||||
gcc -o test test.c
|
||||
if [ $? -ne 0 ]; then
|
||||
print -u2 "failed to compile test.c"
|
||||
exit 1
|
||||
|
72
cmd/dtrace/test/tst/common/privs/tst.noprivdrop.ksh
Executable file
72
cmd/dtrace/test/tst/common/privs/tst.noprivdrop.ksh
Executable file
@ -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 (c) 2011, Joyent, Inc. All rights reserved.
|
||||
#
|
||||
|
||||
ppriv -s A=basic,dtrace_user $$
|
||||
|
||||
#
|
||||
# We expect some number of these profile probes to be silently dropped.
|
||||
# Note that this test will fail if something is stuck on all CPUs that
|
||||
# whomever is running the test happens to own.
|
||||
#
|
||||
count=$(/usr/sbin/dtrace -q -s /dev/stdin <<EOF
|
||||
BEGIN
|
||||
{
|
||||
start = timestamp;
|
||||
@ = count();
|
||||
}
|
||||
|
||||
ERROR
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
|
||||
profile-1000hz
|
||||
{
|
||||
@ = count();
|
||||
}
|
||||
|
||||
tick-10ms
|
||||
{
|
||||
ticks++;
|
||||
}
|
||||
|
||||
tick-10ms
|
||||
/ticks > 100/
|
||||
{
|
||||
printa("%@d", @);
|
||||
exit(0);
|
||||
}
|
||||
EOF)
|
||||
|
||||
cpus=`psrinfo | grep -- on-line | wc -l`
|
||||
max=`expr $cpus \* 500`
|
||||
|
||||
if [[ $count -gt $max ]]; then
|
||||
echo "count ($count) is greater than allowed max ($max)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "count ($count) is within allowed max ($max)"
|
||||
exit 0
|
61
cmd/dtrace/test/tst/common/privs/tst.noprivrestrict.ksh
Executable file
61
cmd/dtrace/test/tst/common/privs/tst.noprivrestrict.ksh
Executable file
@ -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 (c) 2011, Joyent, Inc. All rights reserved.
|
||||
#
|
||||
|
||||
ppriv -s A=basic,dtrace_user $$
|
||||
|
||||
#
|
||||
# We expect at least one of these tick probes to error out because only
|
||||
# dtrace_user is set, and we are attempting to access arguments. Note that
|
||||
# this test will fail if something is stuck on CPU that whomever is running
|
||||
# the test happens to own.
|
||||
#
|
||||
/usr/sbin/dtrace -q -s /dev/stdin <<EOF
|
||||
BEGIN
|
||||
{
|
||||
start = timestamp;
|
||||
}
|
||||
|
||||
tick-1000hz
|
||||
{
|
||||
@[arg0] = count();
|
||||
}
|
||||
|
||||
ERROR
|
||||
{
|
||||
errcnt++;
|
||||
}
|
||||
|
||||
tick-10ms
|
||||
{
|
||||
ticks++;
|
||||
}
|
||||
|
||||
tick-10ms
|
||||
/ticks > 100/
|
||||
{
|
||||
printf("error count is %d\n", errcnt);
|
||||
exit(errcnt != 0 ? 0 : 1);
|
||||
}
|
||||
EOF
|
55
cmd/dtrace/test/tst/common/privs/tst.tick.ksh
Executable file
55
cmd/dtrace/test/tst/common/privs/tst.tick.ksh
Executable file
@ -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 (c) 2011, Joyent, Inc. All rights reserved.
|
||||
#
|
||||
|
||||
ppriv -s A=basic,dtrace_user $$
|
||||
|
||||
#
|
||||
# We expect tick probes to fire if dtrace_user is set
|
||||
#
|
||||
/usr/sbin/dtrace -q -s /dev/stdin <<EOF
|
||||
BEGIN
|
||||
{
|
||||
start = timestamp;
|
||||
}
|
||||
|
||||
tick-10ms
|
||||
{
|
||||
ticks++;
|
||||
}
|
||||
|
||||
tick-10ms
|
||||
/ticks > 10 && (this->ms = (timestamp - start) / 1000000) > 2000/
|
||||
{
|
||||
printf("expected completion in 100 ms, found %d!\n", this->ms);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
tick-10ms
|
||||
/ticks > 10/
|
||||
{
|
||||
printf("completed in %d ms\n", this->ms);
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
@ -23,7 +23,6 @@
|
||||
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
script()
|
||||
{
|
||||
@ -61,10 +60,9 @@ child=$!
|
||||
|
||||
#
|
||||
# The only thing we can be sure of here is that we caught some function in
|
||||
# ksh doing work. (This actually goes one step further and assumes that we
|
||||
# catch some non-static function in ksh.)
|
||||
# ksh doing work.
|
||||
#
|
||||
script | tee /dev/fd/2 | grep 'ksh`[a-zA-Z_]' > /dev/null
|
||||
script | tee /dev/fd/2 | egrep '(ksh|libshell\.so\.[0-9])`[a-zA-Z_]' > /dev/null
|
||||
status=$?
|
||||
|
||||
kill $child
|
||||
|
@ -23,7 +23,6 @@
|
||||
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
script()
|
||||
{
|
||||
@ -62,7 +61,7 @@ child=$!
|
||||
#
|
||||
# The only thing we can be sure of here is that ksh is doing some work.
|
||||
#
|
||||
script | tee /dev/fd/2 | grep -w ksh > /dev/null
|
||||
script | tee /dev/fd/2 | egrep '(ksh|libshell)' > /dev/null
|
||||
status=$?
|
||||
|
||||
kill $child
|
||||
|
@ -23,7 +23,6 @@
|
||||
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
script()
|
||||
{
|
||||
@ -63,7 +62,7 @@ child=$!
|
||||
# This test is essentially the same as that in the ufunc test; see that
|
||||
# test for the rationale.
|
||||
#
|
||||
script | tee /dev/fd/2 | grep 'ksh`[a-zA-Z_]' > /dev/null
|
||||
script | tee /dev/fd/2 | egrep '(ksh|libshell\.so\.[0-9])`[a-zA-Z_]' > /dev/null
|
||||
status=$?
|
||||
|
||||
kill $child
|
||||
|
@ -23,11 +23,10 @@
|
||||
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
script()
|
||||
{
|
||||
$dtrace -x bufpolicy=ring -x bufsize=1k -s /dev/stdin <<EOF
|
||||
exec $dtrace -x bufpolicy=ring -x bufsize=1k -s /dev/stdin <<EOF
|
||||
fbt:::
|
||||
{}
|
||||
EOF
|
||||
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace(sizeof (struct suckitlarry));
|
||||
exit(0);
|
||||
}
|
29
cmd/dtrace/test/tst/common/trace/err.D_TRACE_DYN.bad.d
Normal file
29
cmd/dtrace/test/tst/common/trace/err.D_TRACE_DYN.bad.d
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace(*curpsinfo);
|
||||
}
|
29
cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d
Normal file
29
cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_ARGS.d
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
tracemem(`dtrace_zero, 256, 0, "fishpong");
|
||||
}
|
30
cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d
Normal file
30
cmd/dtrace/test/tst/common/tracemem/err.D_TRACEMEM_DYNSIZE.d
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
tracemem(`dtrace_zero, 256, "fishpong");
|
||||
exit(0);
|
||||
}
|
45
cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d
Normal file
45
cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
BEGIN
|
||||
{
|
||||
i = -10;
|
||||
}
|
||||
|
||||
tick-10ms
|
||||
/i++ < 150/
|
||||
{
|
||||
printf("%d:", i);
|
||||
tracemem(`dtrace_zero, 128, i);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
tick-10ms
|
||||
/i >= 150/
|
||||
{
|
||||
exit(0);
|
||||
}
|
1313
cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out
Normal file
1313
cmd/dtrace/test/tst/common/tracemem/tst.dynsize.d.out
Normal file
File diff suppressed because it is too large
Load Diff
32
cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d
Normal file
32
cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
BEGIN
|
||||
{
|
||||
tracemem(`utsname.sysname, 5);
|
||||
exit(0);
|
||||
}
|
4
cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d.out
Normal file
4
cmd/dtrace/test/tst/common/tracemem/tst.smallsize.d.out
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
|
||||
0: 53 75 6e 4f 53 SunOS
|
||||
|
@ -23,7 +23,6 @@
|
||||
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo expected one argument: '<'dtrace-path'>'
|
||||
@ -61,12 +60,12 @@ main(int argc, char **argv)
|
||||
}
|
||||
EOF
|
||||
|
||||
cc -xarch=generic64 -c -o test64.o test.c
|
||||
gcc -m64 -c -o test64.o test.c
|
||||
if [ $? -ne 0 ]; then
|
||||
print -u2 "failed to compile test.c 64-bit"
|
||||
exit 1
|
||||
fi
|
||||
cc -xarch=generic -c -o test32.o test.c
|
||||
gcc -m32 -c -o test32.o test.c
|
||||
if [ $? -ne 0 ]; then
|
||||
print -u2 "failed to compile test.c 32-bit"
|
||||
exit 1
|
||||
|
@ -60,10 +60,10 @@ cat > Makefile <<EOF
|
||||
all: main
|
||||
|
||||
main: main.o prov.o
|
||||
\$(CC) -o main main.o prov.o
|
||||
gcc -o main main.o prov.o
|
||||
|
||||
main.o: main.c prov.h
|
||||
\$(CC) -c main.c
|
||||
gcc -c main.c
|
||||
|
||||
prov.h: prov.d
|
||||
$dtrace -h -s prov.d
|
||||
|
@ -24,7 +24,6 @@
|
||||
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
#
|
||||
# This test verifies that USDT providers are removed when its associated
|
||||
@ -46,17 +45,17 @@ cat > Makefile <<EOF
|
||||
all: main livelib.so deadlib.so
|
||||
|
||||
main: main.o prov.o
|
||||
cc -o main main.o
|
||||
gcc -o main main.o
|
||||
|
||||
main.o: main.c
|
||||
cc -c main.c
|
||||
gcc -c main.c
|
||||
|
||||
|
||||
livelib.so: livelib.o prov.o
|
||||
cc -z defs -G -o livelib.so livelib.o prov.o -lc
|
||||
gcc -shared -o livelib.so livelib.o prov.o -lc
|
||||
|
||||
livelib.o: livelib.c prov.h
|
||||
cc -c livelib.c
|
||||
gcc -c livelib.c
|
||||
|
||||
prov.o: livelib.o prov.d
|
||||
$dtrace -G -s prov.d livelib.o
|
||||
@ -66,10 +65,10 @@ prov.h: prov.d
|
||||
|
||||
|
||||
deadlib.so: deadlib.o
|
||||
cc -z defs -G -o deadlib.so deadlib.o -lc
|
||||
gcc -shared -o deadlib.so deadlib.o -lc
|
||||
|
||||
deadlib.o: deadlib.c
|
||||
cc -c deadlib.c
|
||||
gcc -c deadlib.c
|
||||
|
||||
clean:
|
||||
rm -f main.o livelib.o prov.o prov.h deadlib.o
|
||||
@ -125,7 +124,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
EOF
|
||||
|
||||
/usr/ccs/bin/make > /dev/null
|
||||
make > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
print -u2 "failed to build"
|
||||
exit 1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user