root/eaccelerator/branches/new-cache/debug.h

Revision 288, 3.8 kB (checked in by bart, 2 years ago)

* Added a function to dump an eaccelerator class entry in debug.c
* Changed include order in mm.c because of eaccelerator.h include in debug.h

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