Date: Sat, 26 Apr 2008 05:45:12 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 140658 for review Message-ID: <200804260545.m3Q5jCeo021433@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=140658 Change 140658 by jb@freebsd3 on 2008/04/26 05:44:27 IFC Affected files ... .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl#6 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.hton.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owned.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.create.ksh#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exec.ksh#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitexit.ksh#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.rw.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.misc.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/tracemem/tst.rootvp.d#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/mdb/tools/common/die.c#4 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/mdb/tools/common/util.h#4 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/sgs/include/alist.h#4 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/sgs/include/debug.h#4 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/sgs/include/sgs.h#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/sgs/tools/common/findprime.c#4 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libctf/common/ctf_subr.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_work.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libgen/common/gmatch.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/common/list.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/common/memory.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/alist.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/alist.h#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/ctfconvert.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/fixup_tdescs.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/hash.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/iidesc.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/input.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/output.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/stabs.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/strtab.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/strtab.h#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/traverse.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/traverse.h#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/cvt/util.c#5 integrate .. //depot/projects/dtrace/src/cddl/contrib/opensolaris/tools/ctf/dump/dump.c#5 integrate Differences ... ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c#5 (text) ==== @@ -34,15 +34,20 @@ #include <stdlib.h> #include <stdarg.h> #include <stdio.h> +#include <string.h> #include <strings.h> #include <unistd.h> #include <limits.h> #include <fcntl.h> #include <errno.h> #include <signal.h> +#if defined(sun) #include <alloca.h> +#endif #include <libgen.h> +#if defined(sun) #include <libproc.h> +#endif typedef struct dtrace_cmd { void (*dc_func)(struct dtrace_cmd *); /* function to compile arg */ @@ -92,8 +97,9 @@ static int g_status = E_SUCCESS; static int g_grabanon = 0; static const char *g_ofile = NULL; -static FILE *g_ofp = stdout; +static FILE *g_ofp; static dtrace_hdl_t *g_dtp; +#if defined(sun) static char *g_etcfile = "/etc/system"; static const char *g_etcbegin = "* vvvv Added by DTrace"; static const char *g_etcend = "* ^^^^ Added by DTrace"; @@ -108,6 +114,7 @@ "* chapter of the Solaris Dynamic Tracing Guide for details.", "*", NULL }; +#endif static int usage(FILE *fp) @@ -195,6 +202,10 @@ static void dfatal(const char *fmt, ...) { +#if !defined(sun) && defined(NEED_ERRLOC) + char *p_errfile = NULL; + int errline = 0; +#endif va_list ap; va_start(ap, fmt); @@ -212,6 +223,11 @@ (void) fprintf(stderr, "%s\n", dtrace_errmsg(g_dtp, dtrace_errno(g_dtp))); } +#if !defined(sun) && defined(NEED_ERRLOC) + dt_get_errloc(g_dtp, &p_errfile, &errline); + if (p_errfile != NULL) + printf("File '%s', line %d\n", p_errfile, errline); +#endif /* * Close the DTrace handle to ensure that any controlled processes are @@ -372,6 +388,7 @@ free(buf); } +#if defined(sun) static void etcsystem_prune(void) { @@ -482,6 +499,7 @@ error("added forceload directives to %s\n", g_ofile); } +#endif static void print_probe_info(const dtrace_probeinfo_t *p) @@ -611,12 +629,26 @@ p = (uchar_t *)dof; q = p + dof->dofh_loadsz; +#if defined(sun) oprintf("dof-data-%d=0x%x", n, *p++); while (p < q) oprintf(",0x%x", *p++); oprintf(";\n"); +#else + /* + * On FreeBSD, the DOF data is handled as a kernel environment (kenv) + * string. We use two hex characters per DOF byte. + */ + oprintf("dof-data-%d=%02x", n, *p++); + + while (p < q) + oprintf("%02x", *p++); + + oprintf("\n"); +#endif + dtrace_dof_destroy(g_dtp, dof); } @@ -741,6 +773,8 @@ static void prochandler(struct ps_prochandle *P, const char *msg, void *arg) { +fatal("DOODAD in function %s, file %s, line %d\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD const psinfo_t *prp = Ppsinfo(P); int pid = Pstatus(P)->pr_pid; char name[SIG2STR_MAX]; @@ -778,6 +812,7 @@ g_pslive--; break; } +#endif } /*ARGSUSED*/ @@ -1159,9 +1194,10 @@ dtrace_optval_t opt; dtrace_cmd_t *dcp; + g_ofp = stdout; int done = 0, mode = 0; - int err, i; - char c, *p, **v; + int err, i, c; + char *p, **v; struct ps_prochandle *P; pid_t pid; @@ -1188,7 +1224,7 @@ * options into g_argv[], and abort if any invalid options are found. */ for (optind = 1; optind < argc; optind++) { - while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != EOF) { + while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != -1) { switch (c) { case '3': if (strcmp(optarg, "2") != 0) { @@ -1337,8 +1373,14 @@ dtrace_errmsg(NULL, err)); } +#if defined(__i386__) + /* XXX The 32-bit seems to need more buffer space by default -sson */ + (void) dtrace_setopt(g_dtp, "bufsize", "12m"); + (void) dtrace_setopt(g_dtp, "aggsize", "12m"); +#else (void) dtrace_setopt(g_dtp, "bufsize", "4m"); (void) dtrace_setopt(g_dtp, "aggsize", "4m"); +#endif /* * If -G is specified, enable -xlink=dynamic and -xunodefs to permit @@ -1371,7 +1413,7 @@ * this time; these will compiled as part of the fourth processing pass. */ for (optind = 1; optind < argc; optind++) { - while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != EOF) { + while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != -1) { switch (c) { case 'a': if (dtrace_setopt(g_dtp, "grabanon", 0) != 0) @@ -1528,7 +1570,7 @@ * may been affected by any library options set by the second pass. */ for (optind = 1; optind < argc; optind++) { - while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != EOF) { + while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != -1) { switch (c) { case 'c': if ((v = make_argv(optarg)) == NULL) @@ -1616,10 +1658,21 @@ case DMODE_ANON: if (g_ofile == NULL) +#if defined(sun) g_ofile = "/kernel/drv/dtrace.conf"; +#else + /* + * On FreeBSD, anonymous DOF data is written to + * the DTrace DOF file that the boot loader will + * read if booting with the DTrace option. + */ + g_ofile = "/boot/dtrace.dof"; +#endif dof_prune(g_ofile); /* strip out any old DOF directives */ +#if defined(sun) etcsystem_prune(); /* string out any forceload directives */ +#endif if (g_cmdc == 0) { dtrace_close(g_dtp); @@ -1650,8 +1703,10 @@ * that itself contains a #pragma D option quiet. */ error("saved anonymous enabling in %s\n", g_ofile); +#if defined(sun) etcsystem_add(); error("run update_drv(1M) or reboot to enable changes\n"); +#endif dtrace_close(g_dtp); return (g_status); @@ -1780,6 +1835,11 @@ if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGTERM, &act, NULL); +#if !defined(sun) + if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) + (void) sigaction(SIGUSR1, &act, NULL); +#endif + /* * Now that tracing is active and we are ready to consume trace data, * continue any grabbed or created processes, setting them running ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl#5 (text+ko) ==== @@ -1,4 +1,4 @@ -#!/usr/perl5/bin/perl +#!/usr/local/bin/perl # # CDDL HEADER START # ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl#6 (xtext) ==== @@ -1,4 +1,4 @@ -#!/usr/perl5/bin/perl +#!/usr/local/bin/perl # # CDDL HEADER START # @@ -43,7 +43,7 @@ @dtrace_argv = (); -$ksh_path = '/usr/bin/ksh'; +$ksh_path = '/bin/sh'; @files = (); %exceptions = (); @@ -273,7 +273,7 @@ } $fullname = "$dir/$name"; - $exe = "$dir/$base.exe"; + $exe = "./$base.exe"; $exe_pid = -1; if ($opt_a && ($status != 0 || $tag != 0 || $droptag != 0 || @@ -592,7 +592,7 @@ # 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'; +#$ENV{'PATH'} = $ENV{'PATH'} . ':/ws/onnv-tools/SUNWspro/SS11/bin'; if ($opt_b) { logmsg("badioctl'ing ... "); ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d#5 (text+ko) ==== @@ -40,3 +40,8 @@ x[123] = `kmem_flags; x[456] = *`rootvp; } + +ERROR +{ + exit(1); +} ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d#5 (text+ko) ==== @@ -40,3 +40,8 @@ self->x[123] = `kmem_flags; self->x[456] = *`rootvp; } + +ERROR +{ + exit(1); +} ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo.d#5 (text+ko) ==== @@ -53,3 +53,8 @@ printf("address of process = %u\n", curpsinfo->pr_addr); exit (0); } + +ERROR +{ + exit(1); +} ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/builtinvar/tst.psinfo1.d#5 (text+ko) ==== @@ -49,3 +49,8 @@ printf("address of process = %u\n", curpsinfo->pr_addr); exit (0); } + +ERROR +{ + exit(1); +} ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh#5 (text+ko) ==== @@ -46,7 +46,7 @@ dtrace=$1 $dtrace -qZm wassup'{printf("Iamkool");}' \ --qm unix'{printf("I am done"); exit(0);}' +-qm BEGIN'{printf("I am done"); exit(0);}' status=$? ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.hton.d#5 (text+ko) ==== @@ -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 { ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa.d#5 (text+ko) ==== @@ -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; ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntoa6.d#5 (text+ko) ==== @@ -53,35 +53,35 @@ 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)); ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d#5 (text+ko) ==== @@ -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 @@ 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 @@ *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)); ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owned.d#5 (text+ko) ==== @@ -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 ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d#5 (text+ko) ==== @@ -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++; } ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d#5 (text+ko) ==== @@ -44,9 +44,9 @@ 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++; } ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d#5 (text+ko) ==== @@ -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 @@ 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 @@ 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 @@ 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 @@ 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 /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"); ==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out#5 (text+ko) ==== @@ -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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $failed++; } - if (substr("foobarbazbop", 3, -1) != "") { + if (substr("foobarbazbop", 3, -1) ne "barbazbo") { >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804260545.m3Q5jCeo021433>