cpp=''
csh=''
date=''
+dtrace=''
echo=''
egrep=''
emacs=''
useithreads=''
usereentrant=''
usethreads=''
+usedtrace=''
incpath=''
mips_type=''
usrinc=''
set usefaststdio
eval $setvar
+: DTrace support
+dflt_dtrace='/usr/sbin/dtrace'
+cat <<EOM
+
+Perl can be built to support DTrace on platforms that support it.
+DTrace is a diagnosis and performance analysis tool from Sun.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+
+while test 1 ; do
+ case "$usedtrace" in
+ $define|true|[yY]*)
+ dflt='y'
+ ;;
+ ?*)
+ dflt='y'
+ dflt_dtrace=$usedtrace
+ ;;
+ *)
+ dflt='n'
+ ;;
+ esac
+
+ rp='Support DTrace if available?'
+ . ./myread
+ case "$ans" in
+ y|Y) val="$define" ;;
+ *) val="$undef" ;;
+ esac
+ set usedtrace
+ eval $setvar
+
+ test "X$usedtrace" != "X$define" && break
+
+ echo " "
+ rp='Where is the dtrace executable?'
+ dflt=$dflt_dtrace
+ . ./getfile
+ val="$ans"
+ set dtrace
+ eval $setvar
+
+ if test -f $dtrace
+ then
+ if ! $dtrace -h -s ../perldtrace.d \
+ -o perldtrace.tmp >/dev/null 2>&1 \
+ && rm -f perldtrace.tmp
+ then
+ cat >&2 <<EOM
+
+*** $me: Fatal Error: $dtrace doesn't support -h flag
+***
+*** Your installed dtrace doesn't support the -h switch to compile a D
+*** program into a C header. Can't continue.
+
+EOM
+ exit 1
+ fi
+ break;
+ fi
+
+ echo "$dtrace was not found."
+ echo " "
+done
: define an is-a-typedef? function
typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
doublesize='$doublesize'
drand01='$drand01'
drand48_r_proto='$drand48_r_proto'
+dtrace='$dtrace'
dynamic_ext='$dynamic_ext'
eagain='$eagain'
ebcdic='$ebcdic'
use64bitint='$use64bitint'
usecrosscompile='$usecrosscompile'
usedl='$usedl'
+usedtrace='$usedtrace'
usefaststdio='$usefaststdio'
useithreads='$useithreads'
uselargefiles='$uselargefiles'
doublesize='8'
drand01='drand48()'
drand48_r_proto='0'
+dtrace=''
dynamic_ext='B ByteLoader Cwd Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Time/HiRes Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared'
eagain='EAGAIN'
ebcdic='undef'
use64bitint='undef'
usecrosscompile='undef'
usedl='define'
+usedtrace='undef'
usefaststdio='define'
useithreads='undef'
uselargefiles='define'
mpeix/relink MPE/iX port
mro.c Method Resolution Order code
myconfig.SH Prints summary of the current configuration
+mydtrace.h Support for optional DTrace probes
NetWare/bat/Buildtype.bat NetWare port
NetWare/bat/SetCodeWar.bat NetWare port
NetWare/bat/Setnlmsdk.bat NetWare port
patchlevel.h The current patch level of perl
perlapi.c Perl API functions
perlapi.h Perl API function declarations
+perldtrace.d D script for Perl probes
perl.c main()
perl.h Global declarations
perlio.c C code for PerlIO abstraction
nonxs_list="$nonxs_list ext/$f/pm_to_blib"
done
+dtrace_h=''
+dtrace_o=''
+case "$usedtrace" in
+define|true)
+ dtrace_h='perldtrace.h'
+ $dtrace -G -s perldtrace.d -o perldtrace.tmp >/dev/null 2>&1 \
+ && rm -f perldtrace.tmp && dtrace_o='perldtrace$(OBJ_EXT)'
+ ;;
+esac
+
echo "Extracting Makefile (with variable substitutions)"
$spitshell >Makefile <<!GROK!THIS!
# Makefile.SH
# then you'll need to change this, or override it on the make command line.
VALGRIND=valgrind
+DTRACE = $dtrace
+DTRACE_H = $dtrace_h
+DTRACE_O = $dtrace_o
+
FIRSTMAKEFILE = $firstmakefile
# Any special object files needed by this architecture, e.g. os2/os2.obj
h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h opcode.h
h3 = pad.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h
h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h
-h5 = utf8.h warnings.h
+h5 = utf8.h warnings.h mydtrace.h
h = $(h1) $(h2) $(h3) $(h4) $(h5)
c1 = av.c scope.c op.c doop.c doio.c dump.c gv.c hv.c mg.c reentr.c mro.c perl.c
obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) perl$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) xsutils$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT)
-obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
+ndt_obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
+obj = $(ndt_obj) $(DTRACE_O)
lintflags = \
-b \
Makefile: $Makefile_s
!GROK!THIS!
else
+ case "$dtrace_h" in
+ ?*)
+ $spitshell >>Makefile <<'!NO!SUBS!'
+$(DTRACE_H): perldtrace.d
+ $(DTRACE) -h -s perldtrace.d -o $(DTRACE_H)
+
+mydtrace.h: $(DTRACE_H)
+
+!NO!SUBS!
+ ;;
+ esac
+ case "$dtrace_o" in
+ ?*)
+ $spitshell >>Makefile <<'!NO!SUBS!'
+$(DTRACE_O): perldtrace.d
+ $(DTRACE) -G -s perldtrace.d -o $(DTRACE_O) $(ndt_obj)
+
+!NO!SUBS!
+ ;;
+ esac
$spitshell >>Makefile <<'!NO!SUBS!'
$(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT)
!NO!SUBS!
-rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
-rm -f perl$(EXE_EXT) suidperl$(EXE_EXT) miniperl$(EXE_EXT) $(LIBPERL) libperl.* microperl
-rm -f opcode.h-old opnames.h-old pp.sym-old pp_proto.h-old
- -rm -f config.over
+ -rm -f config.over $(DTRACE_H)
# Do not 'make _tidy' directly.
_tidy:
doublesize='8'
drand01='(rand()/(double)((unsigned)1<<RANDBITS))'
drand48_r_proto='0'
+dtrace=''
dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs'
eagain='EAGAIN'
ebcdic='undef'
use64bitint='undef'
usecrosscompile='undef'
usedl='define'
+usedtrace='undef'
usefaststdio='undef'
useithreads='define'
uselargefiles='undef'
This variable holds a list of XS extension files we want to
link dynamically into the package. It is used by Makefile.
+dtrace (dtrace.U):
+ This variable holds the location of the dtrace executable.
+
eagain (nblock_io.U):
This variable bears the symbolic errno code set by read() when no
data is present on the file and non-blocking I/O was enabled (otherwise,
This variable indicates if the system supports dynamic
loading of some sort. See also dlsrc and dlobj.
+usedtrace (trace.U):
+ This variable indicates whether we are compiling with dtrace support.
+ See also dtrace.
+
usefaststdio (usefaststdio.U):
This variable conditionally defines the USE_FAST_STDIO symbol,
and indicates that Perl should be built to use 'fast stdio'.
#$d_oldpthreads OLD_PTHREADS_API /**/
#$usereentrant USE_REENTRANT_API /**/
+/* USE_DTRACE
+ * This symbol, if defined, indicates that Perl should
+ * be built with support for DTrace.
+ */
+#$usedtrace USE_DTRACE /**/
+
/* PERL_VENDORARCH:
* If defined, this symbol contains the name of a private library.
* The library is private in the sense that it needn't be in anyone's
$ WC "dlsrc='dl_vms.c'"
$ WC "doublesize='" + doublesize + "'"
$ WC "drand01='" + drand01 + "'"
+$ WC "dtrace=''"
$!
$! The extensions symbol may be quite long
$!
$ WC "usedefaulttypes='" + usedefaulttypes + "'" ! VMS-specific
$ WC "usecrosscompile='undef'"
$ WC "usedl='" + usedl + "'"
+$ WC "usedtrace='undef'"
$ WC "usefaststdio='" + usefaststdio + "'"
$ WC "useieee='" + useieee + "'" ! VMS-specific
$ WC "useithreads='" + useithreads + "'"
#define CATCH_SET(v) (PL_top_env->je_mustcatch = (v))
+#include "mydtrace.h"
struct cop {
BASEOP
* decremented by LEAVESUB, the other by LEAVE. */
#define PUSHSUB_BASE(cx) \
+ ENTRY_PROBE(GvENAME(CvGV(cv)), \
+ CopFILE((COP*)CvSTART(cv)), \
+ CopLINE((COP*)CvSTART(cv))); \
+ \
cx->blk_sub.cv = cv; \
cx->blk_sub.olddepth = CvDEPTH(cv); \
cx->blk_sub.hasargs = hasargs; \
#define POPSUB(cx,sv) \
STMT_START { \
+ RETURN_PROBE(GvENAME(CvGV((CV*)cx->blk_sub.cv)), \
+ CopFILE((COP*)CvSTART((CV*)cx->blk_sub.cv)), \
+ CopLINE((COP*)CvSTART((CV*)cx->blk_sub.cv))); \
+ \
if (cx->blk_sub.hasargs) { \
POP_SAVEARRAY(); \
/* abandon @_ if it got reified */ \
doublesize='8'
drand01='(rand()/(double)(1U<<RANDBITS))'
drand48_r_proto='0'
+dtrace=''
dynamic_ext=''
eagain='EAGAIN'
ebcdic='undef'
use64bitint='undef'
usecrosscompile='define'
usedl='undef'
+usedtrace='undef'
usefaststdio='undef'
uselargefiles='undef'
uselongdouble='undef'
--- /dev/null
+/* mydtrace.h
+ *
+ * Copyright (C) 2008, by Larry Wall and others
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ *
+ * Provides macros that wrap the various DTrace probes we use. We add
+ * an extra level of wrapping to encapsulate the _ENABLED tests.
+ */
+
+#if defined(USE_DTRACE) && defined(PERL_CORE)
+
+# include "perldtrace.h"
+
+# define ENTRY_PROBE(func, file, line) \
+ if (PERL_SUB_ENTRY_ENABLED()) { \
+ PERL_SUB_ENTRY(func, file, line); \
+ }
+
+# define RETURN_PROBE(func, file, line) \
+ if (PERL_SUB_RETURN_ENABLED()) { \
+ PERL_SUB_RETURN(func, file, line); \
+ }
+
+#else
+
+/* NOPs */
+# define ENTRY_PROBE(func, file, line)
+# define RETURN_PROBE(func, file, line)
+
+#endif
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ *
+ * ex: set ts=8 sts=4 sw=4 noet:
+ */
--- /dev/null
+/*
+ * Written by Alan Burlinson -- taken from his blog post
+ * at <http://blogs.sun.com/alanbur/date/20050909>.
+ */
+
+provider perl {
+ probe sub__entry(char *, char *, int);
+ probe sub__return(char *, char *, int);
+};
doublesize='8'
drand01='(rand() / (double) ((unsigned long)1 << 15))'
drand48_r_proto='0'
+dtrace=''
dynamic_ext=''
eagain='EAGAIN'
ebcdic='undef'
use64bitint='undef'
usecrosscompile='undef'
usedl='undef'
+usedtrace='undef'
usefaststdio='undef'
useithreads='undef'
uselargefiles='define'
doublesize='8'
drand01="((rand() & 0x7FFF) / (double) ((unsigned long)1 << 15))"
drand48_r_proto='0'
+dtrace=''
eagain='EAGAIN'
ebcdic='undef'
endgrent_r_proto='0'
use64bitint='undef'
usecrosscompile='undef'
usedl='undef'
+usedtrace='undef'
usefaststdio='undef'
useithreads='undef'
uselargefiles='undef'
/*#define OLD_PTHREADS_API / **/
/*#define USE_REENTRANT_API / **/
+/* USE_DTRACE
+ * This symbol, if defined, indicates that Perl should
+ * be built with support for DTrace.
+ */
+/*#define USE_DTRACE / **/
+
/* PERL_VENDORARCH:
* If defined, this symbol contains the name of a private library.
* The library is private in the sense that it needn't be in anyone's
doublesize='8'
drand01="((rand() & 0x7FFF) / (double) ((unsigned long)1 << 15))"
drand48_r_proto='0'
+dtrace=''
eagain='EAGAIN'
ebcdic='undef'
endgrent_r_proto='0'
use64bitint='undef'
usecrosscompile='undef'
usedl='undef'
+usedtrace='undef'
usefaststdio='undef'
useithreads='undef'
uselargefiles='undef'
doublesize='8'
drand01='(rand()/(double)((unsigned)1<<RANDBITS))'
drand48_r_proto='0'
+dtrace=''
dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs'
eagain='EAGAIN'
ebcdic='undef'
use64bitint='undef'
usecrosscompile='undef'
usedl='define'
+usedtrace='undef'
usefaststdio='undef'
useithreads='undef'
uselargefiles='undef'
doublesize='8'
drand01='(rand()/(double)((unsigned)1<<RANDBITS))'
drand48_r_proto='0'
+dtrace=''
dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs'
eagain='EAGAIN'
ebcdic='undef'
use64bitint='undef'
usecrosscompile='define'
usedl='define'
+usedtrace='undef'
usefaststdio='undef'
useithreads='~USE_ITHREADS~'
uselargefiles='undef'
doublesize='8'
drand01='(rand()/(double)((unsigned)1<<RANDBITS))'
drand48_r_proto='0'
+dtrace=''
dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs'
eagain='EAGAIN'
ebcdic='undef'
use64bitint='undef'
usecrosscompile='undef'
usedl='define'
+usedtrace='undef'
usefaststdio='undef'
useithreads='undef'
uselargefiles='undef'
doublesize='8'
drand01='(rand()/(double)((unsigned)1<<RANDBITS))'
drand48_r_proto='0'
+dtrace=''
dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs'
eagain='EAGAIN'
ebcdic='undef'
use64bitint='undef'
usecrosscompile='undef'
usedl='define'
+usedtrace='undef'
usefaststdio='undef'
useithreads='undef'
uselargefiles='undef'
doublesize='8'
drand01='(rand()/(double)((unsigned)1<<RANDBITS))'
drand48_r_proto='0'
+dtrace=''
dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs'
eagain='EAGAIN'
ebcdic='undef'
use64bitint='define'
usecrosscompile='undef'
usedl='define'
+usedtrace='undef'
usefaststdio='undef'
useithreads='undef'
uselargefiles='undef'
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
+/* USE_DTRACE
+ * This symbol, if defined, indicates that Perl should
+ * be built with support for DTrace.
+ */
+/*#define USE_DTRACE / **/
+
/* PERL_VENDORARCH:
* If defined, this symbol contains the name of a private library.
* The library is private in the sense that it needn't be in anyone's
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
+/* USE_DTRACE
+ * This symbol, if defined, indicates that Perl should
+ * be built with support for DTrace.
+ */
+/*#define USE_DTRACE / **/
+
/* PERL_VENDORARCH:
* If defined, this symbol contains the name of a private library.
* The library is private in the sense that it needn't be in anyone's
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
+/* USE_DTRACE
+ * This symbol, if defined, indicates that Perl should
+ * be built with support for DTrace.
+ */
+/*#define USE_DTRACE / **/
+
/* PERL_VENDORARCH:
* If defined, this symbol contains the name of a private library.
* The library is private in the sense that it needn't be in anyone's
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
+/* USE_DTRACE
+ * This symbol, if defined, indicates that Perl should
+ * be built with support for DTrace.
+ */
+/*#define USE_DTRACE / **/
+
/* PERL_VENDORARCH:
* If defined, this symbol contains the name of a private library.
* The library is private in the sense that it needn't be in anyone's
/*#define OLD_PTHREADS_API /**/
/*#define USE_REENTRANT_API /**/
+/* USE_DTRACE
+ * This symbol, if defined, indicates that Perl should
+ * be built with support for DTrace.
+ */
+/*#define USE_DTRACE / **/
+
/* PERL_VENDORARCH:
* If defined, this symbol contains the name of a private library.
* The library is private in the sense that it needn't be in anyone's