0
  1   #ˆl–Ým_J	õ4Ÿº‚ œP.\lW ê˜´o�þ@³ŽÉ c-ùÉ0ÐÃÍ  #   %ˆÒÑÐ‚hAÏa–Ðz¾”d
i?u8 EpÜ”Å£Î ¥    %‹      µ“QkÛ0Çßû)nzØ[}	M¬²FgH“�zŒ2ö [Š-j[Fº&Ë>ýäØ£´ŒÂö¤“ôÓýï’ø»t�d÷›9Üd·KØ|ù¼\$ÀÎ¿^$ˆi–³h2Eœ¯°Š¨ûˆx8¢ÃEd]‰Ù+jêzr¦ H‘bâŒ÷kâx¥¥
#p2Tk±h•þvhÉ¥Ã¹£G¥÷¦Ð¾�I7ØèÆºã8Lgl­Ò“qþáýc>’Ê™½vžã�>â¨Ès«Ž}!Óÿ'rŸ¬Éü¤Ý‡Npª`/kS¶1#Û1ÁMS‚wEÌÐ¶õ˜×²}ˆJ³c kŠÙ·E²þ8¤ª?-¸„Êé]Ì>%ñêj§L¬d£9Ê—™ÛÀ\3±”ž ±ÊìŒV¯Âw|g~¾ž0˜TûÂ™ŽŒmŸPŸ[-lí;¼^•{Nˆú[7dñG36×Ûù*KÛ¡%ªOñTÝ?ºB&6Òé– 5N¶G‡ƒÜû6÷ÝÕï)Œõ;SVÄÀ9¼H¾¥58>Ž§wÊqø0¿ ­×t“    A   'ˆl–Ãa¾”Ò~êq@µp¸Û*bÑ¿�þDìm,ã€�±Ê9q ?Ë„ã_Ò_ˆI|¥�+y,ÀÐ '´    '/*
  +----------------------------------------------------------------------+
  | PHP Version 5                                                        |
  +----------------------------------------------------------------------+
  | Copyright (c) 2006-2016 The PHP Group                                |
  +----------------------------------------------------------------------+
  | This source file is subject to version 3.01 of the PHP 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.php.net/license/3_01.txt                                  |
  | If you did not receive a copy of the PHP license and are unable to   |
  | obtain it through the world-wide-web, please send a note to          |
  | license@php.net so we can mail you a copy immediately.               |
  +----------------------------------------------------------------------+
  | Authors: Georg Richter <georg@mysql.com>                             |
  |          Andrey Hristov <andrey@mysql.com>                           |
  |          Ulf Wendel <uwendel@mysql.com>                              |
  +----------------------------------------------------------------------+
*/

/* $Id$ */

#ifndef MYSQLND_DEBUG_H
#define MYSQLND_DEBUG_H

#include "mysqlnd_alloc.h"
#include "zend_stack.h"

struct st_mysqlnd_debug_methods
{
	enum_func_status (*open)(MYSQLND_DEBUG * self, zend_bool reopen);
	void			 (*set_mode)(MYSQLND_DEBUG * self, const char * const mode);
	enum_func_status (*log)(MYSQLND_DEBUG * self, unsigned int line, const char * const file,
							unsigned int level, const char * type, const char *message);
	enum_func_status (*log_va)(MYSQLND_DEBUG * self, unsigned int line, const char * const file,
							   unsigned int level, const char * type, const char *format, ...);
	zend_bool (*func_enter)(MYSQLND_DEBUG * self, unsigned int line, const char * const file,
							const char * const func_name, unsigned int func_name_len);
	enum_func_status (*func_leave)(MYSQLND_DEBUG * self, unsigned int line, const char * const file, uint64_t call_time);
	enum_func_status (*close)(MYSQLND_DEBUG * self);
	enum_func_status (*free_handle)(MYSQLND_DEBUG * self);
};


struct st_mysqlnd_debug
{
	php_stream	*stream;
#ifdef ZTS
	TSRMLS_D;
#endif
	unsigned int flags;
	unsigned int nest_level_limit;
	int pid;
	char * file_name;
	zend_stack call_stack;
	zend_stack call_time_stack;	
	HashTable not_filtered_functions;
	HashTable function_profiles;
	struct st_mysqlnd_debug_methods *m;
	const char ** skip_functions;
};

struct st_mysqlnd_plugin_trace_log
{
	struct st_mysqlnd_plugin_header plugin_header;
	struct
	{
		MYSQLND_DEBUG * (*trace_instance_init)(const char * skip_functions[] TSRMLS_DC);
		char * (*get_backtrace)(uint max_levels, size_t * length TSRMLS_DC);
	} methods;
};

void mysqlnd_debug_trace_plugin_register(TSRMLS_D);

PHPAPI MYSQLND_DEBUG * mysqlnd_debug_init(const char * skip_functions[] TSRMLS_DC);

PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC);

#if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1400))
#ifdef PHP_WIN32
#include "win32/time.h"
#elif defined(NETWARE)
#include <sys/timeval.h>
#include <sys/time.h>
#else
#include <sys/time.h>
#endif

#ifndef MYSQLND_PROFILING_DISABLED
#define DBG_PROFILE_TIMEVAL_TO_DOUBLE(tp)	((tp.tv_sec * 1000000LL)+ tp.tv_usec)
#define DBG_PROFILE_START_TIME()		g