--- php-5.3.10/Zend/zend_API.c_orig Sun Jan 1 05:15:04 2012
+++ php-5.3.10/Zend/zend_API.c Wed Feb 8 11:25:25 2012
@@ -27,11 +27,16 @@
#include "zend_constants.h"
#include "zend_exceptions.h"
#include "zend_closures.h"
+#include "zend_dtrace.h"
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
+#ifdef HAVE_DTRACE
+extern char* dtrace_get_executed_filename(TSRMLS_D);
+#endif
+
/* these variables are true statics/globals, and have to be mutex'ed on every access */
static int module_count=0;
ZEND_API HashTable module_registry;
@@ -1073,6 +1078,17 @@
zend_error(E_ERROR, "Cannot instantiate %s %s", what, class_type->name);
}
+#ifdef HAVE_DTRACE
+ if (DTRACE_OBJECT_CREATE_ENABLED()) {
+ char *filename;
+ int lineno;
+
+ filename = dtrace_get_executed_filename(TSRMLS_C);
+ lineno = zend_get_executed_lineno(TSRMLS_C);
+ DTRACE_OBJECT_CREATE(class_type->name, filename, lineno);
+ }
+#endif /* HAVE_DTRACE */
+
zend_update_class_constants(class_type TSRMLS_CC);
Z_TYPE_P(arg) = IS_OBJECT;