-
Notifications
You must be signed in to change notification settings - Fork 52
/
php_memprof.h
79 lines (65 loc) · 2.38 KB
/
php_memprof.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
/*
+----------------------------------------------------------------------+
| Memprof |
+----------------------------------------------------------------------+
| Copyright (c) 2012-2013 Arnaud Le Blanc |
+----------------------------------------------------------------------+
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+----------------------------------------------------------------------+
| Author: Arnaud Le Blanc <[email protected]> |
+----------------------------------------------------------------------+
*/
#ifndef PHP_MEMPROF_H
#define PHP_MEMPROF_H
#define MEMPROF_NAME "memprof"
#define PHP_MEMPROF_VERSION "3.0.2"
extern zend_module_entry memprof_module_entry;
#define phpext_memprof_ptr &memprof_module_entry
#ifdef PHP_WIN32
# define PHP_MEMPROF_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_MEMPROF_API __attribute__ ((visibility("default")))
#else
# define PHP_MEMPROF_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
#ifndef PHP_FE_END
# define PHP_FE_END { NULL, NULL, NULL, 0, 0 }
#endif
typedef enum {
FORMAT_CALLGRIND = 0,
FORMAT_PPROF = 1,
} memprof_output_format;
typedef struct _memprof_profile_flags {
zend_bool enabled;
zend_bool native;
zend_bool dump_on_limit;
} memprof_profile_flags;
ZEND_BEGIN_MODULE_GLOBALS(memprof)
const char * output_dir;
memprof_output_format output_format;
memprof_profile_flags profile_flags;
ZEND_END_MODULE_GLOBALS(memprof)
#define MEMPROF_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(memprof, v)
#define MEMPROF_OUTPUT_FORMAT_CALLGRIND "callgrind"
#define MEMPROF_OUTPUT_FORMAT_PPROF "pprof"
PHP_MINIT_FUNCTION(memprof);
PHP_MSHUTDOWN_FUNCTION(memprof);
PHP_RINIT_FUNCTION(memprof);
PHP_RSHUTDOWN_FUNCTION(memprof);
PHP_MINFO_FUNCTION(memprof);
PHP_GINIT_FUNCTION(memprof);
PHP_FUNCTION(memprof_dump_callgrind);
PHP_FUNCTION(memprof_dump_pprof);
PHP_FUNCTION(memprof_dump_array);
PHP_FUNCTION(memprof_memory_get_usage);
PHP_FUNCTION(memprof_memory_get_peak_usage);
PHP_FUNCTION(memprof_enable);
PHP_FUNCTION(memprof_disable);
PHP_FUNCTION(memprof_enabled);
PHP_FUNCTION(memprof_enabled_flags);
#endif /* PHP_MEMPROF_H */