Date: Wed, 19 Apr 2006 00:41:08 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95567 for review Message-ID: <200604190041.k3J0f890007714@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95567 Change 95567 by jb@jb_freebsd2 on 2006/04/19 00:40:30 Use FreeBSD /dev/ names created by the device file system when the devices are initialised. Leave a few printfs in here to remember things that need to be looked at. We actually don't get put of dt_vopen yet due to yacc/lex issues. Affected files ... .. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_open.c#3 edit Differences ... ==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_open.c#3 (text) ==== @@ -824,10 +824,18 @@ */ dt_provmod_open(&provmod, &df); +#if defined(sun) dtfd = open("/dev/dtrace/dtrace", O_RDWR); +#else + dtfd = open("/dev/dtrace", O_RDWR); +#endif err = errno; /* save errno from opening dtfd */ +#if defined(sun) ftfd = open("/dev/dtrace/provider/fasttrap", O_RDWR); +#else + ftfd = open("/dev/fasttrap", O_RDWR); +#endif fterr = ftfd == -1 ? errno : 0; /* save errno from open ftfd */ while (df.df_ents-- != 0) @@ -907,11 +915,10 @@ (void) snprintf(isadef, sizeof (isadef), "-D__SUNW_D_%u", (uint_t)(sizeof (void *) * NBBY)); -#ifdef DOODAD +#if defined(sun) (void) snprintf(utsdef, sizeof (utsdef), "-D__%s_%s", dt_get_sysinfo(SI_SYSNAME, s1, sizeof (s1)), dt_get_sysinfo(SI_RELEASE, s2, sizeof (s2))); -#endif if (dt_cpp_add_arg(dtp, "-D__sun") == NULL || dt_cpp_add_arg(dtp, "-D__unix") == NULL || @@ -920,6 +927,9 @@ dt_cpp_add_arg(dtp, isadef) == NULL || dt_cpp_add_arg(dtp, utsdef) == NULL) return (set_open_errno(dtp, errp, EDT_NOMEM)); +#else +printf("%s:%s(%d): need to set FreeBSD specific CPP defines\n",__FUNCTION__,__FILE__,__LINE__); +#endif if (flags & DTRACE_O_NODEV) bcopy(&_dtrace_conf, &dtp->dt_conf, sizeof (_dtrace_conf)); @@ -1213,6 +1223,7 @@ if (flags & DTRACE_O_NODEV) dtp->dt_cflags |= DTRACE_C_ZDEFS; +printf("%s:%s(%d): call dtrace_program_strcompile\n",__FUNCTION__,__FILE__,__LINE__); /* * Load hard-wired inlines into the definition cache by calling the * compiler on the raw definition string defined above. @@ -1221,9 +1232,11 @@ DTRACE_PROBESPEC_NONE, DTRACE_C_EMPTY, 0, NULL)) == NULL) { dt_dprintf("failed to load hard-wired definitions: %s\n", dtrace_errmsg(dtp, dtrace_errno(dtp))); +printf("%s:%s(%d): dtrace_program_strcompile error\n",__FUNCTION__,__FILE__,__LINE__); return (set_open_errno(dtp, errp, EDT_HARDWIRE)); } +printf("%s:%s(%d): call dt_program_destroy\n",__FUNCTION__,__FILE__,__LINE__); dt_program_destroy(dtp, pgp); /* @@ -1233,9 +1246,11 @@ * compile, and to provide better error reporting (because the full * reporting of compiler errors requires dtrace_open() to succeed). */ +printf("%s:%s(%d): dtrace_setopt libdir\n",__FUNCTION__,__FILE__,__LINE__); if (dtrace_setopt(dtp, "libdir", _dtrace_libdir) != 0) return (set_open_errno(dtp, errp, dtp->dt_errno)); +printf("%s:%s(%d): return\n",__FUNCTION__,__FILE__,__LINE__); return (dtp); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604190041.k3J0f890007714>