]> granicus.if.org Git - php/commitdiff
Fix Windows build with dtrace and add missing $Id$'s to files
authorKalle Sommer Nielsen <kalle@php.net>
Mon, 20 Jul 2009 08:05:04 +0000 (08:05 +0000)
committerKalle Sommer Nielsen <kalle@php.net>
Mon, 20 Jul 2009 08:05:04 +0000 (08:05 +0000)
Zend/zend_dtrace.c
Zend/zend_dtrace.d
Zend/zend_dtrace.h

index 41bc0ef12ba8c95f543fc3bc72dae32c4008b21d..7824d8b114c26cba10ee019a8ea357068ae95c3f 100644 (file)
-/*
-   +----------------------------------------------------------------------+
-   | Zend Engine                                                          |
-   +----------------------------------------------------------------------+
-   | Copyright (c) 1998-2009 Zend Technologies Ltd. (http://www.zend.com) |
-   +----------------------------------------------------------------------+
-   | This source file is subject to version 2.00 of the Zend license,     |
-   | that is bundled with this package in the file LICENSE, and is        |
-   | available through the world-wide-web at the following url:           |
-   | http://www.zend.com/license/2_00.txt.                                |
-   | If you did not receive a copy of the Zend license and are unable to  |
-   | obtain it through the world-wide-web, please send a note to          |
-   | license@zend.com so we can mail you a copy immediately.              |
-   +----------------------------------------------------------------------+
-   | Authors: David Soria Parra <david.soriaparra@sun.com>                |
-   +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#include "zend.h"
-#include "zend_API.h"
-#include "zend_dtrace.h"
-
-#ifdef HAVE_SYS_SDT_H
-/* PHP DTrace probes {{{ */
-static inline char *dtrace_get_executed_filename(TSRMLS_D)
-{
-       if (EG(current_execute_data) && EG(current_execute_data)->op_array) {
-               return EG(current_execute_data)->op_array->filename;
-       } else {
-               return zend_get_executed_filename(TSRMLS_C);
-       }
-}
-
-ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
-{
-       zend_op_array *res;
-       DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, file_handle->filename);
-       res = compile_file(file_handle, type TSRMLS_CC);
-       DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, file_handle->filename);
-
-       return res;
-}
-
-/* We wrap the execute function to have fire the execute-entry/return and function-entry/return probes */
-ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC)
-{
-       int lineno, s_funcname_len, s_classname_len;
-       char *scope, *filename, *s_funcname, *s_classname;
-       zstr classname, funcname;
-
-       scope = filename = s_funcname = s_classname = NULL;
-       classname = funcname = EMPTY_ZSTR;
-
-       /* we need filename and lineno for both execute and function probes */
-       if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()
-               || DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {
-               filename = dtrace_get_executed_filename(TSRMLS_C);
-               lineno = zend_get_executed_lineno(TSRMLS_C);
-       }
-
-       if (DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {
-               funcname = get_active_function_name(TSRMLS_C);
-               classname = get_active_class_name(&scope TSRMLS_CC);
-
-               /* We encode everything to utf8 so that we have a predictable output */
-               if (funcname.u != NULL)
-                       zend_unicode_to_string(ZEND_U_CONVERTER(UG(utf8_conv)), &s_funcname, &s_funcname_len, funcname.u, u_strlen(funcname.u) TSRMLS_CC);
-
-               /* classname might be EMPTY_STR, in that case we have pass NULL to the probe, so that
-                  we use appropriate predicates in our dtrace scripts to detect if we are in class context */
-               if (u_strlen(classname.u) > 0)
-                       zend_unicode_to_string(ZEND_U_CONVERTER(UG(utf8_conv)), &s_classname, &s_classname_len, classname.u, u_strlen(classname.u) TSRMLS_CC);
-       }
-
-       if (DTRACE_EXECUTE_ENTRY_ENABLED()) {
-               DTRACE_EXECUTE_ENTRY(filename, lineno);
-       }
-
-       if (DTRACE_FUNCTION_ENTRY_ENABLED() && funcname.u != NULL) {
-               DTRACE_FUNCTION_ENTRY(s_funcname, filename, lineno, s_classname, scope);
-       }
-
-       execute(op_array TSRMLS_CC);
-
-       if (DTRACE_FUNCTION_RETURN_ENABLED() && funcname.u != NULL) {
-               DTRACE_FUNCTION_RETURN(s_funcname, filename, lineno, s_classname, scope);
-       }
-
-       if (DTRACE_EXECUTE_RETURN_ENABLED()) {
-               DTRACE_EXECUTE_RETURN(filename, lineno);
-       }
-
-       if (DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {
-               /* s_funcname and s_classname were allocated by zend_unicode_to_string */
-               if (s_funcname != NULL)
-                       efree(s_funcname);
-               if (s_classname != NULL)
-                       efree(s_classname);
-       }
-}
-
-ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC)
-{
-       int lineno;
-       char *filename;
-       if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) {
-               filename = dtrace_get_executed_filename(TSRMLS_C);
-               lineno = zend_get_executed_lineno(TSRMLS_C);
-       }
-
-       DTRACE_EXECUTE_ENTRY(filename, lineno);
-
-       execute_internal(execute_data_ptr, return_value_used TSRMLS_CC);
-
-       DTRACE_EXECUTE_RETURN(filename, lineno);
-}
-
-/* }}} */
-#endif
-
+/*\r
+   +----------------------------------------------------------------------+\r
+   | Zend Engine                                                          |\r
+   +----------------------------------------------------------------------+\r
+   | Copyright (c) 1998-2009 Zend Technologies Ltd. (http://www.zend.com) |\r
+   +----------------------------------------------------------------------+\r
+   | This source file is subject to version 2.00 of the Zend license,     |\r
+   | that is bundled with this package in the file LICENSE, and is        |\r
+   | available through the world-wide-web at the following url:           |\r
+   | http://www.zend.com/license/2_00.txt.                                |\r
+   | If you did not receive a copy of the Zend license and are unable to  |\r
+   | obtain it through the world-wide-web, please send a note to          |\r
+   | license@zend.com so we can mail you a copy immediately.              |\r
+   +----------------------------------------------------------------------+\r
+   | Authors: David Soria Parra <david.soriaparra@sun.com>                |\r
+   +----------------------------------------------------------------------+\r
+*/\r
+\r
+/* $Id: $ */\r
+\r
+#include "zend.h"\r
+#include "zend_API.h"\r
+#include "zend_dtrace.h"\r
+\r
+#ifdef HAVE_SYS_SDT_H\r
+/* PHP DTrace probes {{{ */\r
+static inline char *dtrace_get_executed_filename(TSRMLS_D)\r
+{\r
+       if (EG(current_execute_data) && EG(current_execute_data)->op_array) {\r
+               return EG(current_execute_data)->op_array->filename;\r
+       } else {\r
+               return zend_get_executed_filename(TSRMLS_C);\r
+       }\r
+}\r
+\r
+ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)\r
+{\r
+       zend_op_array *res;\r
+       DTRACE_COMPILE_FILE_ENTRY(file_handle->opened_path, file_handle->filename);\r
+       res = compile_file(file_handle, type TSRMLS_CC);\r
+       DTRACE_COMPILE_FILE_RETURN(file_handle->opened_path, file_handle->filename);\r
+\r
+       return res;\r
+}\r
+\r
+/* We wrap the execute function to have fire the execute-entry/return and function-entry/return probes */\r
+ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC)\r
+{\r
+       int lineno, s_funcname_len, s_classname_len;\r
+       char *scope, *filename, *s_funcname, *s_classname;\r
+       zstr classname, funcname;\r
+\r
+       scope = filename = s_funcname = s_classname = NULL;\r
+       classname = funcname = EMPTY_ZSTR;\r
+\r
+       /* we need filename and lineno for both execute and function probes */\r
+       if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()\r
+               || DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {\r
+               filename = dtrace_get_executed_filename(TSRMLS_C);\r
+               lineno = zend_get_executed_lineno(TSRMLS_C);\r
+       }\r
+\r
+       if (DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {\r
+               funcname = get_active_function_name(TSRMLS_C);\r
+               classname = get_active_class_name(&scope TSRMLS_CC);\r
+\r
+               /* We encode everything to utf8 so that we have a predictable output */\r
+               if (funcname.u != NULL)\r
+                       zend_unicode_to_string(ZEND_U_CONVERTER(UG(utf8_conv)), &s_funcname, &s_funcname_len, funcname.u, u_strlen(funcname.u) TSRMLS_CC);\r
+\r
+               /* classname might be EMPTY_STR, in that case we have pass NULL to the probe, so that\r
+                  we use appropriate predicates in our dtrace scripts to detect if we are in class context */\r
+               if (u_strlen(classname.u) > 0)\r
+                       zend_unicode_to_string(ZEND_U_CONVERTER(UG(utf8_conv)), &s_classname, &s_classname_len, classname.u, u_strlen(classname.u) TSRMLS_CC);\r
+       }\r
+\r
+       if (DTRACE_EXECUTE_ENTRY_ENABLED()) {\r
+               DTRACE_EXECUTE_ENTRY(filename, lineno);\r
+       }\r
+\r
+       if (DTRACE_FUNCTION_ENTRY_ENABLED() && funcname.u != NULL) {\r
+               DTRACE_FUNCTION_ENTRY(s_funcname, filename, lineno, s_classname, scope);\r
+       }\r
+\r
+       execute(op_array TSRMLS_CC);\r
+\r
+       if (DTRACE_FUNCTION_RETURN_ENABLED() && funcname.u != NULL) {\r
+               DTRACE_FUNCTION_RETURN(s_funcname, filename, lineno, s_classname, scope);\r
+       }\r
+\r
+       if (DTRACE_EXECUTE_RETURN_ENABLED()) {\r
+               DTRACE_EXECUTE_RETURN(filename, lineno);\r
+       }\r
+\r
+       if (DTRACE_FUNCTION_ENTRY_ENABLED() || DTRACE_FUNCTION_RETURN_ENABLED()) {\r
+               /* s_funcname and s_classname were allocated by zend_unicode_to_string */\r
+               if (s_funcname != NULL)\r
+                       efree(s_funcname);\r
+               if (s_classname != NULL)\r
+                       efree(s_classname);\r
+       }\r
+}\r
+\r
+ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC)\r
+{\r
+       int lineno;\r
+       char *filename;\r
+       if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) {\r
+               filename = dtrace_get_executed_filename(TSRMLS_C);\r
+               lineno = zend_get_executed_lineno(TSRMLS_C);\r
+       }\r
+\r
+       DTRACE_EXECUTE_ENTRY(filename, lineno);\r
+\r
+       execute_internal(execute_data_ptr, return_value_used TSRMLS_CC);\r
+\r
+       DTRACE_EXECUTE_RETURN(filename, lineno);\r
+}\r
+\r
+/* }}} */\r
+#endif\r
+\r
index f58a9087bbbd3d0885bd48b65ad313db46e4268f..ed9a08eac5b04e5b8eff99ee55fba0ac9bc4cee2 100644 (file)
@@ -1,34 +1,37 @@
-/*
-   +----------------------------------------------------------------------+
-   | Zend Engine                                                          |
-   +----------------------------------------------------------------------+
-   | Copyright (c) 1998-2009 Zend Technologies Ltd. (http://www.zend.com) |
-   +----------------------------------------------------------------------+
-   | This source file is subject to version 2.00 of the Zend license,     |
-   | that is bundled with this package in the file LICENSE, and is        |
-   | available through the world-wide-web at the following url:           |
-   | http://www.zend.com/license/2_00.txt.                                |
-   | If you did not receive a copy of the Zend license and are unable to  |
-   | obtain it through the world-wide-web, please send a note to          |
-   | license@zend.com so we can mail you a copy immediately.              |
-   +----------------------------------------------------------------------+
-   | Authors: David Soria Parra <david.soriaparra@sun.com>                |
-   +----------------------------------------------------------------------+
-*/
-provider php {
-       probe exception__caught(char *classname);
-       probe exception__thrown(char* classname);
-       probe request__startup(char* request_file, char* request_uri, char* request_method);
-       probe request__shutdown(char* request_file, char* request_uri, char* request_method);
-       probe compile__file__entry(char * compile_file, char *compile_file_translated);
-       probe compile__file__return(char *compile_file, char *compile_file_translated);
-       probe error(char *errormsg, char *request_file, int lineno);
-       probe execute__entry(char* request_file, int lineno);
-       probe execute__return(char* request_file, int lineno);
-       probe function__entry(char* function_name, char* request_file, int lineno, char* classname, char* scope);
-       probe function__return(char* function_name, char* request_file, int lineno, char* classname, char* scope);
-};
-
-#pragma D attributes Evolving/Evolving/Common provider php provider
-#pragma D attributes Private/Private/Unknown provider php module
-#pragma D attributes Private/Private/Unknown provider php function
+/*\r
+   +----------------------------------------------------------------------+\r
+   | Zend Engine                                                          |\r
+   +----------------------------------------------------------------------+\r
+   | Copyright (c) 1998-2009 Zend Technologies Ltd. (http://www.zend.com) |\r
+   +----------------------------------------------------------------------+\r
+   | This source file is subject to version 2.00 of the Zend license,     |\r
+   | that is bundled with this package in the file LICENSE, and is        |\r
+   | available through the world-wide-web at the following url:           |\r
+   | http://www.zend.com/license/2_00.txt.                                |\r
+   | If you did not receive a copy of the Zend license and are unable to  |\r
+   | obtain it through the world-wide-web, please send a note to          |\r
+   | license@zend.com so we can mail you a copy immediately.              |\r
+   +----------------------------------------------------------------------+\r
+   | Authors: David Soria Parra <david.soriaparra@sun.com>                |\r
+   +----------------------------------------------------------------------+\r
+*/\r
+\r
+/* $Id: $ */\r
+\r
+provider php {\r
+       probe exception__caught(char *classname);\r
+       probe exception__thrown(char* classname);\r
+       probe request__startup(char* request_file, char* request_uri, char* request_method);\r
+       probe request__shutdown(char* request_file, char* request_uri, char* request_method);\r
+       probe compile__file__entry(char * compile_file, char *compile_file_translated);\r
+       probe compile__file__return(char *compile_file, char *compile_file_translated);\r
+       probe error(char *errormsg, char *request_file, int lineno);\r
+       probe execute__entry(char* request_file, int lineno);\r
+       probe execute__return(char* request_file, int lineno);\r
+       probe function__entry(char* function_name, char* request_file, int lineno, char* classname, char* scope);\r
+       probe function__return(char* function_name, char* request_file, int lineno, char* classname, char* scope);\r
+};\r
+\r
+#pragma D attributes Evolving/Evolving/Common provider php provider\r
+#pragma D attributes Private/Private/Unknown provider php module\r
+#pragma D attributes Private/Private/Unknown provider php function\r
index 6e101279be3cc7537c4160bd9d0552b991307f49..01639fbd12ed80f8a19545e3c12b9ff20eb19916 100644 (file)
@@ -1,68 +1,73 @@
-/*
-   +----------------------------------------------------------------------+
-   | Zend Engine                                                          |
-   +----------------------------------------------------------------------+
-   | Copyright (c) 1998-2009 Zend Technologies Ltd. (http://www.zend.com) |
-   +----------------------------------------------------------------------+
-   | This source file is subject to version 2.00 of the Zend license,     |
-   | that is bundled with this package in the file LICENSE, and is        |
-   | available through the world-wide-web at the following url:           |
-   | http://www.zend.com/license/2_00.txt.                                |
-   | If you did not receive a copy of the Zend license and are unable to  |
-   | obtain it through the world-wide-web, please send a note to          |
-   | license@zend.com so we can mail you a copy immediately.              |
-   +----------------------------------------------------------------------+
-   | Authors: David Soria Parra <david.soriaparra@sun.com>                |
-   +----------------------------------------------------------------------+
-*/
-#ifndef        _ZEND_DTRACE_H
-#define        _ZEND_DTRACE_H
-
-#include <unistd.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef HAVE_SYS_SDT_H
-ZEND_API zend_op_array *(*zend_dtrace_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
-ZEND_API void (*zend_dtrace_execute)(zend_op_array *op_array TSRMLS_DC);
-ZEND_API void (*zend_dtrace_execute_internal)(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC);
-
-ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
-ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC);
-ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC);
-#include <zend_dtrace_gen.h>
-
-#else
-
-#define DTRACE_COMPILE_FILE_ENTRY(arg0, arg1)
-#define DTRACE_COMPILE_FILE_ENTRY_ENABLED() (0)
-#define DTRACE_COMPILE_FILE_RETURN(arg0, arg1)
-#define DTRACE_COMPILE_FILE_RETURN_ENABLED() (0)
-#define DTRACE_ERROR(arg0, arg1, arg2)
-#define DTRACE_ERROR_ENABLED() (0)
-#define DTRACE_EXCEPTION_CAUGHT(arg0)
-#define DTRACE_EXCEPTION_CAUGHT_ENABLED() (0)
-#define DTRACE_EXCEPTION_THROWN(arg0)
-#define DTRACE_EXCEPTION_THROWN_ENABLED() (0)
-#define DTRACE_EXECUTE_ENTRY(arg0, arg1)
-#define DTRACE_EXECUTE_ENTRY_ENABLED() (0)
-#define DTRACE_EXECUTE_RETURN(arg0, arg1)
-#define DTRACE_EXECUTE_RETURN_ENABLED() (0)
-#define DTRACE_FUNCTION_ENTRY(arg0, arg1, arg2, arg3, arg4)
-#define DTRACE_FUNCTION_ENTRY_ENABLED() (0)
-#define DTRACE_FUNCTION_RETURN(arg0, arg1, arg2, arg3, arg4)
-#define DTRACE_FUNCTION_RETURN_ENABLED() (0)
-#define DTRACE_REQUEST_SHUTDOWN(arg0, arg1, arg2)
-#define DTRACE_REQUEST_SHUTDOWN_ENABLED() (0)
-#define DTRACE_REQUEST_STARTUP(arg0, arg1, arg2)
-#define DTRACE_REQUEST_STARTUP_ENABLED() (0)
-
-#endif /* HAVE_SYS_SDT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ZEND_DTRACE_H */
+/*\r
+   +----------------------------------------------------------------------+\r
+   | Zend Engine                                                          |\r
+   +----------------------------------------------------------------------+\r
+   | Copyright (c) 1998-2009 Zend Technologies Ltd. (http://www.zend.com) |\r
+   +----------------------------------------------------------------------+\r
+   | This source file is subject to version 2.00 of the Zend license,     |\r
+   | that is bundled with this package in the file LICENSE, and is        |\r
+   | available through the world-wide-web at the following url:           |\r
+   | http://www.zend.com/license/2_00.txt.                                |\r
+   | If you did not receive a copy of the Zend license and are unable to  |\r
+   | obtain it through the world-wide-web, please send a note to          |\r
+   | license@zend.com so we can mail you a copy immediately.              |\r
+   +----------------------------------------------------------------------+\r
+   | Authors: David Soria Parra <david.soriaparra@sun.com>                |\r
+   +----------------------------------------------------------------------+\r
+*/\r
+\r
+/* $Id: $ */\r
+\r
+#ifndef        _ZEND_DTRACE_H\r
+#define        _ZEND_DTRACE_H\r
+\r
+#ifndef ZEND_WIN32\r
+# include <unistd.h>\r
+#endif\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#ifdef HAVE_SYS_SDT_H\r
+ZEND_API zend_op_array *(*zend_dtrace_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);\r
+ZEND_API void (*zend_dtrace_execute)(zend_op_array *op_array TSRMLS_DC);\r
+ZEND_API void (*zend_dtrace_execute_internal)(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC);\r
+\r
+ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);\r
+ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC);\r
+ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC);\r
+#include <zend_dtrace_gen.h>\r
+\r
+#else\r
+\r
+#define DTRACE_COMPILE_FILE_ENTRY(arg0, arg1)\r
+#define DTRACE_COMPILE_FILE_ENTRY_ENABLED() (0)\r
+#define DTRACE_COMPILE_FILE_RETURN(arg0, arg1)\r
+#define DTRACE_COMPILE_FILE_RETURN_ENABLED() (0)\r
+#define DTRACE_ERROR(arg0, arg1, arg2)\r
+#define DTRACE_ERROR_ENABLED() (0)\r
+#define DTRACE_EXCEPTION_CAUGHT(arg0)\r
+#define DTRACE_EXCEPTION_CAUGHT_ENABLED() (0)\r
+#define DTRACE_EXCEPTION_THROWN(arg0)\r
+#define DTRACE_EXCEPTION_THROWN_ENABLED() (0)\r
+#define DTRACE_EXECUTE_ENTRY(arg0, arg1)\r
+#define DTRACE_EXECUTE_ENTRY_ENABLED() (0)\r
+#define DTRACE_EXECUTE_RETURN(arg0, arg1)\r
+#define DTRACE_EXECUTE_RETURN_ENABLED() (0)\r
+#define DTRACE_FUNCTION_ENTRY(arg0, arg1, arg2, arg3, arg4)\r
+#define DTRACE_FUNCTION_ENTRY_ENABLED() (0)\r
+#define DTRACE_FUNCTION_RETURN(arg0, arg1, arg2, arg3, arg4)\r
+#define DTRACE_FUNCTION_RETURN_ENABLED() (0)\r
+#define DTRACE_REQUEST_SHUTDOWN(arg0, arg1, arg2)\r
+#define DTRACE_REQUEST_SHUTDOWN_ENABLED() (0)\r
+#define DTRACE_REQUEST_STARTUP(arg0, arg1, arg2)\r
+#define DTRACE_REQUEST_STARTUP_ENABLED() (0)\r
+\r
+#endif /* HAVE_SYS_SDT */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* _ZEND_DTRACE_H */\r