root/eaccelerator/tags/0.9.5-beta2/debug.h

Revision 182, 3.7 kB (checked in by bart, 3 years ago)

Set the svn keywords property to some files

  • Property svn:eol-style set to native
  • Property svn:keywords set to svn:eol-style
Line 
1 /*
2    +----------------------------------------------------------------------+
3    | eAccelerator project                                                 |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 2004 - 2006 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: debug.h 176 2006-03-05 12:18:54Z bart $
26 */
27
28 #ifndef INCLUDED_DEBUG_H
29 #define INCLUDED_DEBUG_H
30
31 #include "zend.h"
32 #include "zend_API.h"
33 #include "zend_extensions.h"
34 #ifdef ZEND_WIN32
35 #include "win32/time.h"
36 #endif
37
38 /*
39  * This macro is used to make sure debug code is not included in a non-debug build,
40  * without swamping the code with ifdef statements. This approach (as opposed to the
41  * previous empty-function-if-no-debug-build) also makes sure debug function arguments
42  * such as the tons of getpid()'s don't get compiled in and executed in a non-debug build.
43  *
44  * It takes the debug function as first arg and the arguments as the second, like this:
45  *
46  * DBG(ea_debug_printf, ("Hello %s", world));
47  *
48  * The reason why the function arguments are passed by one macro variable is to prevent
49  * the use of variadic macros, keeping the win32 VC 6.0 folks happy
50  */
51 #ifdef DEBUG
52 #define DBG(func, list) func list
53 #else
54 #define DBG(func, list)
55 #endif
56
57 /* print information about the file that's loaded or cached */
58 #define EA_LOG                  (1<<0L)
59
60 /* print debugging information, mostly about the storing and restoring of a
61  * script's data structures. Gives you detailed information about what eA is
62  * doing
63  */
64 #define EA_DEBUG                (1<<1L)
65
66 /* profile php opcodes */
67 #define EA_PROFILE_OPCODES      (1<<2L)
68
69 /* print out performance data (start - end time) */
70
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
91 #endif /* INCLUDED_DEBUG_H */
Note: See TracBrowser for help on using the browser.