[patch] perl.gprof control
authorDoug MacEachern <dougm@covalent.net>
Tue, 12 Jun 2001 23:05:44 +0000 (16:05 -0700)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 13 Jun 2001 12:53:18 +0000 (12:53 +0000)
Message-ID: <Pine.LNX.4.21.0106122247380.24181-100000@mako.covalent.net>

p4raw-id: //depot/perl@10559

miniperlmain.c
perl.h

index 2994440..ed28f47 100644 (file)
@@ -42,6 +42,10 @@ main(int argc, char **argv, char **env)
 #undef PERLVARIC
 #endif
 
+    /* if user wants control of gprof profiling off by default */
+    /* noop unless Configure is given -Accflags=-DPERL_GPROF_CONTROL */
+    PERL_GPROF_MONCONTROL(0);
+
     PERL_SYS_INIT3(&argc,&argv,&env);
 
     if (!PL_do_undump) {
diff --git a/perl.h b/perl.h
index 1673da9..fd22a06 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -3745,6 +3745,14 @@ int flock(int fd, int op);
 
 #define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
 
+/* to let user control profiling */
+#ifdef PERL_GPROF_CONTROL
+extern void moncontrol(int);
+#define PERL_GPROF_MONCONTROL(x) moncontrol(x)
+#else
+#define PERL_GPROF_MONCONTROL(x)
+#endif
+
 /* and finally... */
 #define PERL_PATCHLEVEL_H_IMPLICIT
 #include "patchlevel.h"