Port these test files to work under FreeBSD.

This commit is contained in:
John Birrell 2008-04-26 03:32:20 +00:00
parent 4bc1fa7662
commit f8ac9d32d3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=178534
30 changed files with 296 additions and 183 deletions

View File

@ -40,3 +40,8 @@ BEGIN
x[123] = `kmem_flags;
x[456] = *`rootvp;
}
ERROR
{
exit(1);
}

View File

@ -40,3 +40,8 @@ BEGIN
self->x[123] = `kmem_flags;
self->x[456] = *`rootvp;
}
ERROR
{
exit(1);
}

View File

@ -53,3 +53,8 @@ tick-10ms
printf("address of process = %u\n", curpsinfo->pr_addr);
exit (0);
}
ERROR
{
exit(1);
}

View File

@ -49,3 +49,8 @@ BEGIN
printf("address of process = %u\n", curpsinfo->pr_addr);
exit (0);
}
ERROR
{
exit(1);
}

View File

@ -46,7 +46,7 @@ fi
dtrace=$1
$dtrace -qZm wassup'{printf("Iamkool");}' \
-qm unix'{printf("I am done"); exit(0);}'
-qm BEGIN'{printf("I am done"); exit(0);}'
status=$?

View File

@ -30,7 +30,9 @@
* ASSERTION: Test network byte-ordering routines.
*/
#include <sys/isa_defs.h>
#if defined(__amd64__) || defined(__i386__)
#define _LITTLE_ENDIAN
#endif
BEGIN
{

View File

@ -28,17 +28,17 @@
#pragma D option quiet
ipaddr_t *ip4a;
ipaddr_t *ip4b;
ipaddr_t *ip4c;
ipaddr_t *ip4d;
in_addr_t *ip4a;
in_addr_t *ip4b;
in_addr_t *ip4c;
in_addr_t *ip4d;
BEGIN
{
this->buf4a = alloca(sizeof (ipaddr_t));
this->buf4b = alloca(sizeof (ipaddr_t));
this->buf4c = alloca(sizeof (ipaddr_t));
this->buf4d = alloca(sizeof (ipaddr_t));
this->buf4a = alloca(sizeof (in_addr_t));
this->buf4b = alloca(sizeof (in_addr_t));
this->buf4c = alloca(sizeof (in_addr_t));
this->buf4d = alloca(sizeof (in_addr_t));
ip4a = this->buf4a;
ip4b = this->buf4b;
ip4c = this->buf4c;

View File

@ -53,35 +53,35 @@ BEGIN
ip6f = this->buf6f;
ip6g = this->buf6g;
ip6a->_S6_un._S6_u8[0] = 0xfe;
ip6a->_S6_un._S6_u8[1] = 0x80;
ip6a->_S6_un._S6_u8[8] = 0x02;
ip6a->_S6_un._S6_u8[9] = 0x14;
ip6a->_S6_un._S6_u8[10] = 0x4f;
ip6a->_S6_un._S6_u8[11] = 0xff;
ip6a->_S6_un._S6_u8[12] = 0xfe;
ip6a->_S6_un._S6_u8[13] = 0x0b;
ip6a->_S6_un._S6_u8[14] = 0x76;
ip6a->_S6_un._S6_u8[15] = 0xc8;
ip6b->_S6_un._S6_u8[0] = 0x10;
ip6b->_S6_un._S6_u8[1] = 0x80;
ip6b->_S6_un._S6_u8[10] = 0x08;
ip6b->_S6_un._S6_u8[11] = 0x08;
ip6b->_S6_un._S6_u8[13] = 0x20;
ip6b->_S6_un._S6_u8[13] = 0x0c;
ip6b->_S6_un._S6_u8[14] = 0x41;
ip6b->_S6_un._S6_u8[15] = 0x7a;
ip6c->_S6_un._S6_u8[15] = 0x01;
ip6e->_S6_un._S6_u8[12] = 0x7f;
ip6e->_S6_un._S6_u8[15] = 0x01;
ip6f->_S6_un._S6_u8[10] = 0xff;
ip6f->_S6_un._S6_u8[11] = 0xff;
ip6f->_S6_un._S6_u8[12] = 0x7f;
ip6f->_S6_un._S6_u8[15] = 0x01;
ip6g->_S6_un._S6_u8[10] = 0xff;
ip6g->_S6_un._S6_u8[11] = 0xfe;
ip6g->_S6_un._S6_u8[12] = 0x7f;
ip6g->_S6_un._S6_u8[15] = 0x01;
ip6a->__u6_addr.__u6_addr8[0] = 0xfe;
ip6a->__u6_addr.__u6_addr8[1] = 0x80;
ip6a->__u6_addr.__u6_addr8[8] = 0x02;
ip6a->__u6_addr.__u6_addr8[9] = 0x14;
ip6a->__u6_addr.__u6_addr8[10] = 0x4f;
ip6a->__u6_addr.__u6_addr8[11] = 0xff;
ip6a->__u6_addr.__u6_addr8[12] = 0xfe;
ip6a->__u6_addr.__u6_addr8[13] = 0x0b;
ip6a->__u6_addr.__u6_addr8[14] = 0x76;
ip6a->__u6_addr.__u6_addr8[15] = 0xc8;
ip6b->__u6_addr.__u6_addr8[0] = 0x10;
ip6b->__u6_addr.__u6_addr8[1] = 0x80;
ip6b->__u6_addr.__u6_addr8[10] = 0x08;
ip6b->__u6_addr.__u6_addr8[11] = 0x08;
ip6b->__u6_addr.__u6_addr8[13] = 0x20;
ip6b->__u6_addr.__u6_addr8[13] = 0x0c;
ip6b->__u6_addr.__u6_addr8[14] = 0x41;
ip6b->__u6_addr.__u6_addr8[15] = 0x7a;
ip6c->__u6_addr.__u6_addr8[15] = 0x01;
ip6e->__u6_addr.__u6_addr8[12] = 0x7f;
ip6e->__u6_addr.__u6_addr8[15] = 0x01;
ip6f->__u6_addr.__u6_addr8[10] = 0xff;
ip6f->__u6_addr.__u6_addr8[11] = 0xff;
ip6f->__u6_addr.__u6_addr8[12] = 0x7f;
ip6f->__u6_addr.__u6_addr8[15] = 0x01;
ip6g->__u6_addr.__u6_addr8[10] = 0xff;
ip6g->__u6_addr.__u6_addr8[11] = 0xfe;
ip6g->__u6_addr.__u6_addr8[12] = 0x7f;
ip6g->__u6_addr.__u6_addr8[15] = 0x01;
printf("%s\n", inet_ntoa6(ip6a));
printf("%s\n", inet_ntoa6(ip6b));

View File

@ -28,10 +28,13 @@
#pragma D option quiet
ipaddr_t *ip4a;
ipaddr_t *ip4b;
ipaddr_t *ip4c;
ipaddr_t *ip4d;
inline int AF_INET = 2;
inline int AF_INET6 = 28;
in_addr_t *ip4a;
in_addr_t *ip4b;
in_addr_t *ip4c;
in_addr_t *ip4d;
struct in6_addr *ip6a;
struct in6_addr *ip6b;
struct in6_addr *ip6c;
@ -43,10 +46,10 @@ struct in6_addr *ip6h;
BEGIN
{
this->buf4a = alloca(sizeof (ipaddr_t));
this->buf4b = alloca(sizeof (ipaddr_t));
this->buf4c = alloca(sizeof (ipaddr_t));
this->buf4d = alloca(sizeof (ipaddr_t));
this->buf4a = alloca(sizeof (in_addr_t));
this->buf4b = alloca(sizeof (in_addr_t));
this->buf4c = alloca(sizeof (in_addr_t));
this->buf4d = alloca(sizeof (in_addr_t));
this->buf6a = alloca(sizeof (struct in6_addr));
this->buf6b = alloca(sizeof (struct in6_addr));
this->buf6c = alloca(sizeof (struct in6_addr));
@ -72,51 +75,51 @@ BEGIN
*ip4b = htonl(0x7f000001);
*ip4c = htonl(0xffffffff);
*ip4d = htonl(0x00000000);
ip6a->_S6_un._S6_u8[0] = 0xfe;
ip6a->_S6_un._S6_u8[1] = 0x80;
ip6a->_S6_un._S6_u8[8] = 0x02;
ip6a->_S6_un._S6_u8[9] = 0x14;
ip6a->_S6_un._S6_u8[10] = 0x4f;
ip6a->_S6_un._S6_u8[11] = 0xff;
ip6a->_S6_un._S6_u8[12] = 0xfe;
ip6a->_S6_un._S6_u8[13] = 0x0b;
ip6a->_S6_un._S6_u8[14] = 0x76;
ip6a->_S6_un._S6_u8[15] = 0xc8;
ip6b->_S6_un._S6_u8[0] = 0x10;
ip6b->_S6_un._S6_u8[1] = 0x80;
ip6b->_S6_un._S6_u8[10] = 0x08;
ip6b->_S6_un._S6_u8[11] = 0x08;
ip6b->_S6_un._S6_u8[13] = 0x20;
ip6b->_S6_un._S6_u8[13] = 0x0c;
ip6b->_S6_un._S6_u8[14] = 0x41;
ip6b->_S6_un._S6_u8[15] = 0x7a;
ip6c->_S6_un._S6_u8[15] = 0x01;
ip6e->_S6_un._S6_u8[12] = 0x7f;
ip6e->_S6_un._S6_u8[15] = 0x01;
ip6f->_S6_un._S6_u8[10] = 0xff;
ip6f->_S6_un._S6_u8[11] = 0xff;
ip6f->_S6_un._S6_u8[12] = 0x7f;
ip6f->_S6_un._S6_u8[15] = 0x01;
ip6g->_S6_un._S6_u8[10] = 0xff;
ip6g->_S6_un._S6_u8[11] = 0xfe;
ip6g->_S6_un._S6_u8[12] = 0x7f;
ip6g->_S6_un._S6_u8[15] = 0x01;
ip6h->_S6_un._S6_u8[0] = 0xff;
ip6h->_S6_un._S6_u8[1] = 0xff;
ip6h->_S6_un._S6_u8[2] = 0xff;
ip6h->_S6_un._S6_u8[3] = 0xff;
ip6h->_S6_un._S6_u8[4] = 0xff;
ip6h->_S6_un._S6_u8[5] = 0xff;
ip6h->_S6_un._S6_u8[6] = 0xff;
ip6h->_S6_un._S6_u8[7] = 0xff;
ip6h->_S6_un._S6_u8[8] = 0xff;
ip6h->_S6_un._S6_u8[9] = 0xff;
ip6h->_S6_un._S6_u8[10] = 0xff;
ip6h->_S6_un._S6_u8[11] = 0xff;
ip6h->_S6_un._S6_u8[12] = 0xff;
ip6h->_S6_un._S6_u8[13] = 0xff;
ip6h->_S6_un._S6_u8[14] = 0xff;
ip6h->_S6_un._S6_u8[15] = 0xff;
ip6a->__u6_addr.__u6_addr8[0] = 0xfe;
ip6a->__u6_addr.__u6_addr8[1] = 0x80;
ip6a->__u6_addr.__u6_addr8[8] = 0x02;
ip6a->__u6_addr.__u6_addr8[9] = 0x14;
ip6a->__u6_addr.__u6_addr8[10] = 0x4f;
ip6a->__u6_addr.__u6_addr8[11] = 0xff;
ip6a->__u6_addr.__u6_addr8[12] = 0xfe;
ip6a->__u6_addr.__u6_addr8[13] = 0x0b;
ip6a->__u6_addr.__u6_addr8[14] = 0x76;
ip6a->__u6_addr.__u6_addr8[15] = 0xc8;
ip6b->__u6_addr.__u6_addr8[0] = 0x10;
ip6b->__u6_addr.__u6_addr8[1] = 0x80;
ip6b->__u6_addr.__u6_addr8[10] = 0x08;
ip6b->__u6_addr.__u6_addr8[11] = 0x08;
ip6b->__u6_addr.__u6_addr8[13] = 0x20;
ip6b->__u6_addr.__u6_addr8[13] = 0x0c;
ip6b->__u6_addr.__u6_addr8[14] = 0x41;
ip6b->__u6_addr.__u6_addr8[15] = 0x7a;
ip6c->__u6_addr.__u6_addr8[15] = 0x01;
ip6e->__u6_addr.__u6_addr8[12] = 0x7f;
ip6e->__u6_addr.__u6_addr8[15] = 0x01;
ip6f->__u6_addr.__u6_addr8[10] = 0xff;
ip6f->__u6_addr.__u6_addr8[11] = 0xff;
ip6f->__u6_addr.__u6_addr8[12] = 0x7f;
ip6f->__u6_addr.__u6_addr8[15] = 0x01;
ip6g->__u6_addr.__u6_addr8[10] = 0xff;
ip6g->__u6_addr.__u6_addr8[11] = 0xfe;
ip6g->__u6_addr.__u6_addr8[12] = 0x7f;
ip6g->__u6_addr.__u6_addr8[15] = 0x01;
ip6h->__u6_addr.__u6_addr8[0] = 0xff;
ip6h->__u6_addr.__u6_addr8[1] = 0xff;
ip6h->__u6_addr.__u6_addr8[2] = 0xff;
ip6h->__u6_addr.__u6_addr8[3] = 0xff;
ip6h->__u6_addr.__u6_addr8[4] = 0xff;
ip6h->__u6_addr.__u6_addr8[5] = 0xff;
ip6h->__u6_addr.__u6_addr8[6] = 0xff;
ip6h->__u6_addr.__u6_addr8[7] = 0xff;
ip6h->__u6_addr.__u6_addr8[8] = 0xff;
ip6h->__u6_addr.__u6_addr8[9] = 0xff;
ip6h->__u6_addr.__u6_addr8[10] = 0xff;
ip6h->__u6_addr.__u6_addr8[11] = 0xff;
ip6h->__u6_addr.__u6_addr8[12] = 0xff;
ip6h->__u6_addr.__u6_addr8[13] = 0xff;
ip6h->__u6_addr.__u6_addr8[14] = 0xff;
ip6h->__u6_addr.__u6_addr8[15] = 0xff;
printf("%s\n", inet_ntop(AF_INET, ip4a));
printf("%s\n", inet_ntop(AF_INET, ip4b));

View File

@ -38,8 +38,8 @@
lockstat:::adaptive-acquire
{
this->owned = mutex_owned((kmutex_t *)arg0);
this->owner = mutex_owner((kmutex_t *)arg0);
this->owned = mutex_owned((struct mtx *)arg0);
this->owner = mutex_owner((struct mtx *)arg0);
}
lockstat:::adaptive-acquire

View File

@ -41,17 +41,17 @@
#pragma D option quiet
kthread_t *ptr;
struct thread *ptr;
BEGIN
{
i = 0;
}
lockstat:genunix:mutex_enter:adaptive-acquire
lockstat::mtx_lock:adaptive-acquire
{
ptr = mutex_owner((kmutex_t *)arg0);
ptr = mutex_owner((struct mtx *)arg0);
i++;
}

View File

@ -44,9 +44,9 @@ BEGIN
ret = -99;
}
mutex_enter:adaptive-acquire
mtx_lock:adaptive-acquire
{
ret = mutex_type_adaptive((kmutex_t *)arg0);
ret = mutex_type_adaptive((struct mtx *)arg0);
i++;
}

View File

@ -20,18 +20,20 @@
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#pragma D option quiet
#pragma D option strsize=32
struct {
int index;
int length;
int nolen;
int alt;
} command[int];
int i;
@ -39,6 +41,9 @@ int i;
BEGIN
{
str = "foobarbazbop";
str2 = "";
altstr = "CRAIG: Positioned them, I don't ";
altstr2 = "know... I'm fairly wide guy.";
command[i].index = 3;
command[i].nolen = 1;
@ -108,6 +113,18 @@ BEGIN
command[i].length = -1;
i++;
command[i].index = 3;
command[i].length = -4;
i++;
command[i].index = 3;
command[i].length = -20;
i++;
command[i].index = -10;
command[i].length = -5;
i++;
command[i].index = 0;
command[i].length = 400;
i++;
@ -144,6 +161,16 @@ BEGIN
command[i].length = strlen(str) - 1;
i++;
command[i].index = 100;
command[i].length = 10;
command[i].alt = 1;
i++;
command[i].index = 100;
command[i].nolen = 1;
command[i].alt = 1;
i++;
end = i;
i = 0;
printf("#!/usr/perl5/bin/perl\n\nBEGIN {\n");
@ -153,17 +180,21 @@ BEGIN
tick-1ms
/i < end && command[i].nolen/
{
this->result = substr(str, command[i].index);
this->str = command[i].alt ? altstr : str;
this->str2 = command[i].alt ? altstr2 : str2;
this->result = substr(command[i].alt ?
"CRAIG: Positioned them, I don't know... I'm fairly wide guy." :
str, command[i].index);
printf("\tif (substr(\"%s\", %d) != \"%s\") {\n",
str, command[i].index, this->result);
printf("\tif (substr(\"%s%s\", %d) ne \"%s\") {\n",
this->str, this->str2, command[i].index, this->result);
printf("\t\tprintf(\"perl => substr(\\\"%s\\\", %d) = ",
str, command[i].index);
printf("\\\"%%s\\\"\\n\",\n\t\t substr(\"%s\", %d));\n",
str, command[i].index);
printf("\t\tprintf(\" D => substr(\\\"%s\\\", %d) = ",
str, command[i].index);
printf("\t\tprintf(\"perl => substr(\\\"%s%s\\\", %d) = ",
this->str, this->str2, command[i].index);
printf("\\\"%%s\\\"\\n\",\n\t\t substr(\"%s%s\", %d));\n",
this->str, this->str2, command[i].index);
printf("\t\tprintf(\" D => substr(\\\"%s%s\\\", %d) = ",
this->str, this->str2, command[i].index);
printf("\\\"%%s\\\"\\n\",\n\t\t \"%s\");\n", this->result);
printf("\t\t$failed++;\n");
printf("\t}\n\n");
@ -172,16 +203,21 @@ tick-1ms
tick-1ms
/i < end && !command[i].nolen/
{
this->result = substr(str, command[i].index, command[i].length);
this->str = command[i].alt ? altstr : str;
this->str2 = command[i].alt ? altstr2 : str2;
this->result = substr(command[i].alt ?
"CRAIG: Positioned them, I don't know... I'm fairly wide guy." :
str, command[i].index, command[i].length);
printf("\tif (substr(\"%s\", %d, %d) != \"%s\") {\n",
str, command[i].index, command[i].length, this->result);
printf("\t\tprintf(\"perl => substr(\\\"%s\\\", %d, %d) = ",
str, command[i].index, command[i].length);
printf("\\\"%%s\\\"\\n\",\n\t\t substr(\"%s\", %d, %d));\n",
str, command[i].index, command[i].length);
printf("\t\tprintf(\" D => substr(\\\"%s\\\", %d, %d) = ",
str, command[i].index, command[i].length);
printf("\tif (substr(\"%s%s\", %d, %d) ne \"%s\") {\n",
this->str, this->str2, command[i].index, command[i].length,
this->result);
printf("\t\tprintf(\"perl => substr(\\\"%s%s\\\", %d, %d) = ",
this->str, this->str2, command[i].index, command[i].length);
printf("\\\"%%s\\\"\\n\",\n\t\t substr(\"%s%s\", %d, %d));\n",
this->str, this->str2, command[i].index, command[i].length);
printf("\t\tprintf(\" D => substr(\\\"%s%s\\\", %d, %d) = ",
this->str, this->str2, command[i].index, command[i].length);
printf("\\\"%%s\\\"\\n\",\n\t\t \"%s\");\n", this->result);
printf("\t\t$failed++;\n");
printf("\t}\n\n");

View File

@ -1,7 +1,7 @@
#!/usr/perl5/bin/perl
BEGIN {
if (substr("foobarbazbop", 3) != "barbazbop") {
if (substr("foobarbazbop", 3) ne "barbazbop") {
printf("perl => substr(\"foobarbazbop\", 3) = \"%s\"\n",
substr("foobarbazbop", 3));
printf(" D => substr(\"foobarbazbop\", 3) = \"%s\"\n",
@ -9,7 +9,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 300) != "") {
if (substr("foobarbazbop", 300) ne "") {
printf("perl => substr(\"foobarbazbop\", 300) = \"%s\"\n",
substr("foobarbazbop", 300));
printf(" D => substr(\"foobarbazbop\", 300) = \"%s\"\n",
@ -17,7 +17,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", -10) != "obarbazbop") {
if (substr("foobarbazbop", -10) ne "obarbazbop") {
printf("perl => substr(\"foobarbazbop\", -10) = \"%s\"\n",
substr("foobarbazbop", -10));
printf(" D => substr(\"foobarbazbop\", -10) = \"%s\"\n",
@ -25,7 +25,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 0) != "foobarbazbop") {
if (substr("foobarbazbop", 0) ne "foobarbazbop") {
printf("perl => substr(\"foobarbazbop\", 0) = \"%s\"\n",
substr("foobarbazbop", 0));
printf(" D => substr(\"foobarbazbop\", 0) = \"%s\"\n",
@ -33,7 +33,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 1) != "oobarbazbop") {
if (substr("foobarbazbop", 1) ne "oobarbazbop") {
printf("perl => substr(\"foobarbazbop\", 1) = \"%s\"\n",
substr("foobarbazbop", 1));
printf(" D => substr(\"foobarbazbop\", 1) = \"%s\"\n",
@ -41,7 +41,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 11) != "p") {
if (substr("foobarbazbop", 11) ne "p") {
printf("perl => substr(\"foobarbazbop\", 11) = \"%s\"\n",
substr("foobarbazbop", 11));
printf(" D => substr(\"foobarbazbop\", 11) = \"%s\"\n",
@ -49,7 +49,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 12) != "") {
if (substr("foobarbazbop", 12) ne "") {
printf("perl => substr(\"foobarbazbop\", 12) = \"%s\"\n",
substr("foobarbazbop", 12));
printf(" D => substr(\"foobarbazbop\", 12) = \"%s\"\n",
@ -57,7 +57,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 13) != "") {
if (substr("foobarbazbop", 13) ne "") {
printf("perl => substr(\"foobarbazbop\", 13) = \"%s\"\n",
substr("foobarbazbop", 13));
printf(" D => substr(\"foobarbazbop\", 13) = \"%s\"\n",
@ -65,7 +65,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 8, 20) != "zbop") {
if (substr("foobarbazbop", 8, 20) ne "zbop") {
printf("perl => substr(\"foobarbazbop\", 8, 20) = \"%s\"\n",
substr("foobarbazbop", 8, 20));
printf(" D => substr(\"foobarbazbop\", 8, 20) = \"%s\"\n",
@ -73,7 +73,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 4, 4) != "arba") {
if (substr("foobarbazbop", 4, 4) ne "arba") {
printf("perl => substr(\"foobarbazbop\", 4, 4) = \"%s\"\n",
substr("foobarbazbop", 4, 4));
printf(" D => substr(\"foobarbazbop\", 4, 4) = \"%s\"\n",
@ -81,7 +81,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 5, 8) != "rbazbop") {
if (substr("foobarbazbop", 5, 8) ne "rbazbop") {
printf("perl => substr(\"foobarbazbop\", 5, 8) = \"%s\"\n",
substr("foobarbazbop", 5, 8));
printf(" D => substr(\"foobarbazbop\", 5, 8) = \"%s\"\n",
@ -89,7 +89,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 5, 9) != "rbazbop") {
if (substr("foobarbazbop", 5, 9) ne "rbazbop") {
printf("perl => substr(\"foobarbazbop\", 5, 9) = \"%s\"\n",
substr("foobarbazbop", 5, 9));
printf(" D => substr(\"foobarbazbop\", 5, 9) = \"%s\"\n",
@ -97,7 +97,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 400, 20) != "") {
if (substr("foobarbazbop", 400, 20) ne "") {
printf("perl => substr(\"foobarbazbop\", 400, 20) = \"%s\"\n",
substr("foobarbazbop", 400, 20));
printf(" D => substr(\"foobarbazbop\", 400, 20) = \"%s\"\n",
@ -105,7 +105,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 400, 0) != "") {
if (substr("foobarbazbop", 400, 0) ne "") {
printf("perl => substr(\"foobarbazbop\", 400, 0) = \"%s\"\n",
substr("foobarbazbop", 400, 0));
printf(" D => substr(\"foobarbazbop\", 400, 0) = \"%s\"\n",
@ -113,7 +113,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 400, -1) != "") {
if (substr("foobarbazbop", 400, -1) ne "") {
printf("perl => substr(\"foobarbazbop\", 400, -1) = \"%s\"\n",
substr("foobarbazbop", 400, -1));
printf(" D => substr(\"foobarbazbop\", 400, -1) = \"%s\"\n",
@ -121,7 +121,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 3, 0) != "") {
if (substr("foobarbazbop", 3, 0) ne "") {
printf("perl => substr(\"foobarbazbop\", 3, 0) = \"%s\"\n",
substr("foobarbazbop", 3, 0));
printf(" D => substr(\"foobarbazbop\", 3, 0) = \"%s\"\n",
@ -129,15 +129,39 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", 3, -1) != "") {
if (substr("foobarbazbop", 3, -1) ne "barbazbo") {
printf("perl => substr(\"foobarbazbop\", 3, -1) = \"%s\"\n",
substr("foobarbazbop", 3, -1));
printf(" D => substr(\"foobarbazbop\", 3, -1) = \"%s\"\n",
"barbazbo");
$failed++;
}
if (substr("foobarbazbop", 3, -4) ne "barba") {
printf("perl => substr(\"foobarbazbop\", 3, -4) = \"%s\"\n",
substr("foobarbazbop", 3, -4));
printf(" D => substr(\"foobarbazbop\", 3, -4) = \"%s\"\n",
"barba");
$failed++;
}
if (substr("foobarbazbop", 3, -20) ne "") {
printf("perl => substr(\"foobarbazbop\", 3, -20) = \"%s\"\n",
substr("foobarbazbop", 3, -20));
printf(" D => substr(\"foobarbazbop\", 3, -20) = \"%s\"\n",
"");
$failed++;
}
if (substr("foobarbazbop", 0, 400) != "foobarbazbop") {
if (substr("foobarbazbop", -10, -5) ne "obarb") {
printf("perl => substr(\"foobarbazbop\", -10, -5) = \"%s\"\n",
substr("foobarbazbop", -10, -5));
printf(" D => substr(\"foobarbazbop\", -10, -5) = \"%s\"\n",
"obarb");
$failed++;
}
if (substr("foobarbazbop", 0, 400) ne "foobarbazbop") {
printf("perl => substr(\"foobarbazbop\", 0, 400) = \"%s\"\n",
substr("foobarbazbop", 0, 400));
printf(" D => substr(\"foobarbazbop\", 0, 400) = \"%s\"\n",
@ -145,7 +169,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", -1, 400) != "p") {
if (substr("foobarbazbop", -1, 400) ne "p") {
printf("perl => substr(\"foobarbazbop\", -1, 400) = \"%s\"\n",
substr("foobarbazbop", -1, 400));
printf(" D => substr(\"foobarbazbop\", -1, 400) = \"%s\"\n",
@ -153,7 +177,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", -1, 0) != "") {
if (substr("foobarbazbop", -1, 0) ne "") {
printf("perl => substr(\"foobarbazbop\", -1, 0) = \"%s\"\n",
substr("foobarbazbop", -1, 0));
printf(" D => substr(\"foobarbazbop\", -1, 0) = \"%s\"\n",
@ -161,7 +185,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", -1, -1) != "") {
if (substr("foobarbazbop", -1, -1) ne "") {
printf("perl => substr(\"foobarbazbop\", -1, -1) = \"%s\"\n",
substr("foobarbazbop", -1, -1));
printf(" D => substr(\"foobarbazbop\", -1, -1) = \"%s\"\n",
@ -169,7 +193,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", -24, 24) != "foobarbazbop") {
if (substr("foobarbazbop", -24, 24) ne "foobarbazbop") {
printf("perl => substr(\"foobarbazbop\", -24, 24) = \"%s\"\n",
substr("foobarbazbop", -24, 24));
printf(" D => substr(\"foobarbazbop\", -24, 24) = \"%s\"\n",
@ -177,7 +201,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", -24, 12) != "") {
if (substr("foobarbazbop", -24, 12) ne "") {
printf("perl => substr(\"foobarbazbop\", -24, 12) = \"%s\"\n",
substr("foobarbazbop", -24, 12));
printf(" D => substr(\"foobarbazbop\", -24, 12) = \"%s\"\n",
@ -185,7 +209,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", -24, 13) != "f") {
if (substr("foobarbazbop", -24, 13) ne "f") {
printf("perl => substr(\"foobarbazbop\", -24, 13) = \"%s\"\n",
substr("foobarbazbop", -24, 13));
printf(" D => substr(\"foobarbazbop\", -24, 13) = \"%s\"\n",
@ -193,7 +217,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", -12, 12) != "foobarbazbop") {
if (substr("foobarbazbop", -12, 12) ne "foobarbazbop") {
printf("perl => substr(\"foobarbazbop\", -12, 12) = \"%s\"\n",
substr("foobarbazbop", -12, 12));
printf(" D => substr(\"foobarbazbop\", -12, 12) = \"%s\"\n",
@ -201,7 +225,7 @@ BEGIN {
$failed++;
}
if (substr("foobarbazbop", -12, 11) != "foobarbazbo") {
if (substr("foobarbazbop", -12, 11) ne "foobarbazbo") {
printf("perl => substr(\"foobarbazbop\", -12, 11) = \"%s\"\n",
substr("foobarbazbop", -12, 11));
printf(" D => substr(\"foobarbazbop\", -12, 11) = \"%s\"\n",
@ -209,6 +233,22 @@ BEGIN {
$failed++;
}
if (substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100, 10) ne "") {
printf("perl => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100, 10) = \"%s\"\n",
substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100, 10));
printf(" D => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100, 10) = \"%s\"\n",
"");
$failed++;
}
if (substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100) ne "") {
printf("perl => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100) = \"%s\"\n",
substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100));
printf(" D => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100) = \"%s\"\n",
"");
$failed++;
}
exit($failed);
}

View File

@ -36,7 +36,7 @@ script()
{
$dtrace -s /dev/stdin <<EOF
proc:::create
/args[0]->pr_ppid == $child && pid == $child/
/args[0]->p_pptr->p_pid == $child && pid == $child/
{
exit(0);
}
@ -46,7 +46,7 @@ EOF
sleeper()
{
while true; do
/usr/bin/sleep 1
/bin/sleep 1
done
}

View File

@ -36,12 +36,12 @@ script()
{
$dtrace -s /dev/stdin <<EOF
proc:::exec
/curpsinfo->pr_ppid == $child && args[0] == "/usr/bin/sleep"/
/curpsinfo->pr_ppid == $child && args[0] == "/bin/sleep"/
{
self->exec = 1;
}
proc:::exec-success
proc:::exec_success
/self->exec/
{
exit(0);
@ -52,7 +52,7 @@ EOF
sleeper()
{
while true; do
/usr/bin/sleep 1
/bin/sleep 1
done
}

View File

@ -42,7 +42,7 @@ script()
self->exec = 1;
}
proc:::exec-failure
proc:::exec_failure
/self->exec && args[0] == ENOENT/
{
exit(0);
@ -53,7 +53,7 @@ EOF
sleeper()
{
while true; do
/usr/bin/sleep 1
/bin/sleep 1
$badexec
done
}

View File

@ -45,7 +45,7 @@ script()
self->exec = 1;
}
proc:::exec-failure
proc:::exec_failure
/self->exec/
{
exit(0);
@ -56,7 +56,7 @@ EOF
sleeper()
{
while true; do
/usr/bin/sleep 1
/bin/sleep 1
$badexec
done
}

View File

@ -43,18 +43,16 @@ script()
$dtrace -s /dev/stdin <<EOF
proc:::exit
/curpsinfo->pr_ppid == $child &&
curpsinfo->pr_psargs == "$longsleep" && args[0] == CLD_DUMPED/
execargs == "$longsleep" && args[0] == CLD_DUMPED/
{
exit(0);
}
proc:::exit
/curpsinfo->pr_ppid == $child &&
curpsinfo->pr_psargs == "$longsleep" && args[0] != CLD_DUMPED/
execargs == "$longsleep" && args[0] != CLD_DUMPED/
{
printf("Child process could not dump core. Check coreadm(1M)");
printf(" settings; either per-process or global core dumps ");
printf("must be enabled for this test to work properly.");
printf("Child process could did dump core.");
exit(1);
}
EOF
@ -62,13 +60,12 @@ EOF
sleeper()
{
/usr/bin/coreadm -p $corefile
while true; do
$longsleep &
/usr/bin/sleep 1
/bin/sleep 1
kill -SEGV $!
done
/usr/bin/rm -f $corefile
/bin/rm -f $corefile
}
if [ $# != 1 ]; then
@ -77,8 +74,8 @@ if [ $# != 1 ]; then
fi
dtrace=$1
longsleep="/usr/bin/sleep 10000"
corefile=/tmp/core.$$
longsleep="/bin/sleep 10000"
corefile=/tmp/sleep.core
sleeper &
child=$!
@ -86,10 +83,10 @@ child=$!
script
status=$?
pstop $child
pkill -P $child
#pstop $child
#pkill -P $child
kill $child
prun $child
#prun $child
/usr/bin/rm -f $corefile
/bin/rm -f $corefile
exit $status

View File

@ -46,7 +46,7 @@ EOF
sleeper()
{
while true; do
/usr/bin/sleep 1
/bin/sleep 1
done
}

View File

@ -33,6 +33,8 @@
#include <errno.h>
#include <string.h>
#define NANOSEC 1000000000
int
main(int argc, char **argv)
{
@ -41,6 +43,7 @@ main(int argc, char **argv)
sigset_t set;
timer_t tid;
char *cmd = argv[0];
int sig;
ev.sigev_notify = SIGEV_SIGNAL;
ev.sigev_signo = SIGUSR1;
@ -66,9 +69,9 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
for (;;) {
(void) sigwait(&set);
}
do {
(void) sigwait(&set, &sig);
} while(sig != SIGUSR1);
/*NOTREACHED*/
return (0);

View File

@ -28,13 +28,13 @@
#pragma D option destructive
proc:::signal-send
/pid == 0 && args[1]->pr_pid == $1 && args[2] == SIGUSR1/
proc:::signal_send
/args[1]->p_pid == $1 && args[2] == SIGUSR1/
{
sent = 1;
}
proc:::signal-clear
proc:::signal_clear
/pid == $1 && args[0] == SIGUSR1 && sent/
{
exit(0);

View File

@ -54,7 +54,7 @@ syscall::getpid:entry
timeout = timestamp + 500000000;
}
syscall::rexit:entry
syscall::exit:entry
{
exit(0);
}

View File

@ -28,6 +28,7 @@
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
static void
handle(int sig)

View File

@ -54,7 +54,7 @@ syscall::getpid:return
timeout = timestamp + 500000000;
}
syscall::rexit:entry
syscall::exit:entry
{
exit(0);
}

View File

@ -28,6 +28,7 @@
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
static void
handle(int sig)

View File

@ -54,7 +54,7 @@ syscall::getpid:entry
timeout = timestamp + 500000000;
}
syscall::rexit:entry
syscall::exit:entry
{
exit(0);
}

View File

@ -38,22 +38,22 @@ fbt:::
fbt:::
/on/
{
@[rw_read_held((krwlock_t *)&`clock)] = count();
@[rw_read_held((krwlock_t *)rand())] = count();
@[rw_read_held((struct rwlock *)&`unp_global_rwlock)] = count();
@[rw_read_held((struct rwlock *)rand())] = count();
}
fbt:::
/on/
{
@[rw_write_held((krwlock_t *)&`clock)] = count();
@[rw_write_held((krwlock_t *)rand())] = count();
@[rw_write_held((struct rwlock *)&`unp_global_rwlock)] = count();
@[rw_write_held((struct rwlock *)rand())] = count();
}
fbt:::
/on/
{
@[rw_iswriter((krwlock_t *)&`clock)] = count();
@[rw_iswriter((krwlock_t *)rand())] = count();
@[rw_iswriter((struct rwlock *)&`unp_global_rwlock)] = count();
@[rw_iswriter((struct rwlock *)rand())] = count();
}
tick-1sec

View File

@ -61,3 +61,8 @@ tick-1
{
exit(0);
}
ERROR
{
exit(1);
}

View File

@ -52,3 +52,8 @@ tick-1
{
exit(0);
}
ERROR
{
exit(1);
}