-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphp_prof.h
47 lines (35 loc) · 969 Bytes
/
php_prof.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
/* prof extension for PHP */
#ifndef PHP_PROF_H
# define PHP_PROF_H
#include "php.h"
#include "prof_config.h"
extern zend_module_entry prof_module_entry;
# define phpext_prof_ptr &prof_module_entry
# define PHP_PROF_VERSION "0.1.0"
# if defined(ZTS) && defined(COMPILE_DL_PROF)
ZEND_TSRMLS_CACHE_EXTERN()
# endif
typedef struct {
zend_ulong wall;
zend_ulong cpu;
zend_ulong memory;
} prof_unit;
ZEND_BEGIN_MODULE_GLOBALS(prof)
prof_config config;
zend_array errors;
zend_ulong start_time; // wall time in nanoseconds
bool sampling_enabled;
HashTable sampling_units;
zend_stack func_start_units;
HashTable func_units;
zend_string *opcode_last_file;
uint32_t opcode_last_lineno;
zend_ulong opcode_last_time;
HashTable opcode_timings;
ZEND_END_MODULE_GLOBALS(prof)
#ifdef ZTS
#define PROF_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(prof, v)
#else
#define PROF_G(v) (prof_globals.v)
#endif
#endif /* PHP_PROF_H */