com php-src: Introduced zend.enable_dtrace INI directiv e to enable/disable PHP call tracing: NEWS Zend /zend.c Zend/zend_globals.h
| From: | Dmitry Stogov | Date: | Fri, 18 Nov 2016 09:23:10 +0000 |
| Subject: | com php-src: Introduced zend.enable_dtrace INI directiv e to enable/disable PHP call tracing: NEWS Zend /zend.c Zend/zend_globals.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95860@lists.php.net to get a copy of this message | ||
Commit: 01239b0effbc1839aca6d03cdd4c3a0c1a509798
Author: Dmitry Stogov <dmitry@zend.com> Fri, 18 Nov 2016 12:23:10 +0300
Parents: 79d9c12bf91384b96e1cee1c166b294834c78b79
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=01239b0effbc1839aca6d03cdd4c3a0c1a509798
Log:
Introduced zend.enable_dtrace INI directive to enable/disable PHP call tracing
Changed paths:
M NEWS
M Zend/zend.c
M Zend/zend_globals.h
Diff:
diff --git a/NEWS b/NEWS
index 9482654..a96d1c6 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,10 @@ PHP NEWS
- Date:
. Fixed bug #69587 (DateInterval properties and isset). (jhdxr)
+- DTrace
+ . Introduced zend.enable_dtrace INI directive to enable/disable PHP
+ call tracing. It's disabled by default. (Dmitry)
+
- Mbstring:
. Fixed bug #73532 (Null pointer dereference in mb_eregi). (Laruence)
diff --git a/Zend/zend.c b/Zend/zend.c
index 12801c8..8d221e8 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -134,6 +134,9 @@ ZEND_INI_BEGIN()
STD_ZEND_INI_BOOLEAN("zend.multibyte", "0", ZEND_INI_PERDIR, OnUpdateBool,
multibyte, zend_compiler_globals, compiler_globals)
ZEND_INI_ENTRY("zend.script_encoding", NULL, ZEND_INI_ALL, OnUpdateScriptEncoding)
STD_ZEND_INI_BOOLEAN("zend.detect_unicode", "1", ZEND_INI_ALL, OnUpdateBool,
detect_unicode, zend_compiler_globals, compiler_globals)
+#if HAVE_DTRACE
+ STD_ZEND_INI_BOOLEAN("zend.enable_dtrace", "0", ZEND_INI_SYSTEM, OnUpdateBool,
dtrace_enable, zend_executor_globals, executor_globals)
+#endif
#ifdef ZEND_SIGNALS
STD_ZEND_INI_BOOLEAN("zend.signal_check", "0", ZEND_INI_SYSTEM, OnUpdateBool,
check, zend_signal_globals_t, zend_signal_globals)
#endif
@@ -691,16 +694,9 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions)
/
zend_interrupt_function = NULL;
-#if HAVE_DTRACE
-/* build with dtrace support */
- zend_compile_file = dtrace_compile_file;
- zend_execute_ex = dtrace_execute_ex;
- zend_execute_internal = dtrace_execute_internal;
-#else
zend_compile_file = compile_file;
zend_execute_ex = execute_ex;
zend_execute_internal = NULL;
-#endif /* HAVE_SYS_SDT_H */
zend_compile_string = compile_string;
zend_throw_exception_hook = NULL;
@@ -826,6 +822,14 @@ void zend_post_startup(void) /* {{{ */
#else
virtual_cwd_deactivate();
#endif
+#if HAVE_DTRACE
+ /* build with dtrace support */
+ if (EG(dtrace_enable)) {
+ zend_compile_file = dtrace_compile_file;
+ zend_execute_ex = dtrace_execute_ex;
+ zend_execute_internal = dtrace_execute_internal;
+ }
+#endif
}
/* }}} */
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h
index fbbf503..4609c26 100644
--- a/Zend/zend_globals.h
+++ b/Zend/zend_globals.h
@@ -217,6 +217,10 @@ struct _zend_executor_globals {
zend_bool active;
zend_bool valid_symbol_table;
+#if HAVE_DTRACE
+ zend_bool dtrace_enable;
+#endif
+
zend_long assertions;
uint32_t ht_iterators_count; /* number of allocatd slots */