forked from eaccelerator/eaccelerator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
debug.h
102 lines (89 loc) · 4.03 KB
/
debug.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
+----------------------------------------------------------------------+
| eAccelerator project |
+----------------------------------------------------------------------+
| Copyright (c) 2004 - 2012 eAccelerator |
| http://eaccelerator.net |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of the GNU General Public License |
| along with this program; if not, write to the Free Software |
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
| MA 02111-1307, USA. |
| |
| A copy is availble at http://www.gnu.org/copyleft/gpl.txt |
+----------------------------------------------------------------------+
$Id: debug.h 375 2010-01-19 15:49:13Z bart $
*/
#ifndef INCLUDED_DEBUG_H
#define INCLUDED_DEBUG_H
#include "eaccelerator.h"
#include "zend.h"
#include "zend_API.h"
#include "zend_extensions.h"
#ifdef ZEND_WIN32
#include "win32/time.h"
#endif
/*
* This macro is used to make sure debug code is not included in a non-debug build,
* without swamping the code with ifdef statements. This approach (as opposed to the
* previous empty-function-if-no-debug-build) also makes sure debug function arguments
* such as the tons of getpid()'s don't get compiled in and executed in a non-debug build.
*
* It takes the debug function as first arg and the arguments as the second, like this:
*
* DBG(ea_debug_printf, ("Hello %s", world));
*
* The reason why the function arguments are passed by one macro variable is to prevent
* the use of variadic macros, keeping the win32 VC 6.0 folks happy
*/
#ifdef DEBUG
#define DBG(func, list) func list
#else
#define DBG(func, list)
#endif
/* print information about the file that's loaded or cached */
#define EA_LOG (1<<0L)
/* print debugging information, mostly about the storing and restoring of a
* script's data structures. Gives you detailed information about what eA is
* doing
*/
#define EA_DEBUG (1<<1L)
/* profile php opcodes */
#define EA_PROFILE_OPCODES (1<<2L)
/* print out performance data (start - end time) */
#define EA_TEST_PERFORMANCE (1<<3L)
/* log the hashkeys used to cache scripts */
#define EA_LOG_HASHKEYS (1<<4L)
void ea_debug_init (TSRMLS_D);
void ea_debug_shutdown ();
void ea_debug_printf (long debug_level, char *format, ...);
void ea_debug_error (char *format, ...);
void ea_debug_pad (long debug_level TSRMLS_DC);
void ea_debug_log (char *format, ...);
void ea_debug_binary_print (long debug_level, const char *p, int len);
void ea_debug_put (long debug_level, char *message);
void ea_debug_log_hashkeys (char *p, HashTable * ht);
void ea_debug_start_time (struct timeval *tvstart);
long ea_debug_elapsed_time (struct timeval *tvstart);
void ea_debug_hash_display(HashTable * ht);
void ea_debug_dump_ea_class_entry(ea_class_entry *ce);
void ea_debug_dump_zend_class_entry(zend_class_entry *ce);
#endif /* INCLUDED_DEBUG_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
* vim<600: expandtab sw=4 ts=4 sts=4
*/