summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index b0f1c1b601..8800788117 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -96,6 +96,10 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS;
# include "openssl/applink.c"
#endif
+#ifdef HAVE_VALGRIND
+# include "valgrind/callgrind.h"
+#endif
+
#ifndef PHP_WIN32
/* XXX this will need to change later when threaded fastcgi is implemented. shane */
struct sigaction act, old_term, old_quit, old_int;
@@ -1824,16 +1828,6 @@ int main(int argc, char *argv[])
char *decoded_query_string;
int skip_getopt = 0;
-#if 0 && defined(PHP_DEBUG)
- /* IIS is always making things more difficult. This allows
- * us to stop PHP and attach a debugger before much gets started */
- {
- char szMessage [256];
- wsprintf (szMessage, "Please attach a debugger to the process 0x%X [%d] (%s) and click OK", GetCurrentProcessId(), GetCurrentProcessId(), argv[0]);
- MessageBox(NULL, szMessage, "CGI Debug Time!", MB_OK|MB_SERVICE_NOTIFICATION);
- }
-#endif
-
#ifdef HAVE_SIGNAL_H
#if defined(SIGPIPE) && defined(SIG_IGN)
signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so
@@ -2306,6 +2300,11 @@ consult the installation file that came with this distribution, or visit \n\
if (comma) {
warmup_repeats = atoi(php_optarg);
repeats = atoi(comma + 1);
+#ifdef HAVE_VALGRIND
+ if (warmup_repeats > 0) {
+ CALLGRIND_STOP_INSTRUMENTATION;
+ }
+#endif
} else {
repeats = atoi(php_optarg);
}
@@ -2517,7 +2516,7 @@ consult the installation file that came with this distribution, or visit \n\
file_handle.filename = SG(request_info).path_translated;
file_handle.handle.fp = NULL;
} else {
- file_handle.filename = "-";
+ file_handle.filename = "Standard input code";
file_handle.type = ZEND_HANDLE_FP;
file_handle.handle.fp = stdin;
}
@@ -2728,6 +2727,9 @@ fastcgi_request_done:
#else
time(&start);
#endif
+#ifdef HAVE_VALGRIND
+ CALLGRIND_START_INSTRUMENTATION;
+#endif
}
continue;
} else {