summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_debug.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-12-28 15:16:21 +0000
committerAndrey Hristov <andrey@php.net>2010-12-28 15:16:21 +0000
commitcfac5f5b674a038a35043018145bc61584695fdb (patch)
tree88d0db8340a1ccc42800ee93da48732d5df73c6b /ext/mysqlnd/mysqlnd_debug.c
parent874954ed97e0328adf57470230f7f16552ba225c (diff)
downloadphp-git-cfac5f5b674a038a35043018145bc61584695fdb.tar.gz
extending the API interface - plugins can register
themselves with a structure and can be searched. Every plugin can have statistics and they are shown under the statistics of mysqlnd in MINFO.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_debug.c')
-rw-r--r--ext/mysqlnd/mysqlnd_debug.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c
index d54ae01098..acd8be308e 100644
--- a/ext/mysqlnd/mysqlnd_debug.c
+++ b/ext/mysqlnd/mysqlnd_debug.c
@@ -1856,6 +1856,39 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC)
return res;
}
+
+static struct st_mysqlnd_plugin_trace_log mysqlnd_plugin_trace_log_plugin =
+{
+ {
+ MYSQLND_PLUGIN_API_VERSION,
+ "debug_trace",
+ MYSQLND_VERSION_ID,
+ MYSQLND_VERSION,
+ "PHP License 3.01",
+ "Andrey Hristov <andrey@mysql.com>, Ulf Wendel <uwendel@mysql.com>, Georg Richter <georg@mysql.com>",
+ {
+ NULL, /* no statistics , will be filled later if there are some */
+ NULL, /* no statistics */
+ },
+ {
+ NULL /* plugin shutdown */
+ }
+ },
+ {/* methods */
+ mysqlnd_debug_init,
+ mysqlnd_get_backtrace
+ }
+};
+
+/* {{{ mysqlnd_debug_trace_plugin_register */
+void
+mysqlnd_debug_trace_plugin_register(TSRMLS_D)
+{
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_trace_log_plugin TSRMLS_CC);
+}
+/* }}} */
+
+
/*
* Local variables:
* tab-width: 4