blob: 34fb7ee819b688445826aaf70f2b720f49890aae [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001#ifndef LPC_DEBUG_INFO_H_
2#define LPC_DEBUG_INFO_H_ 1
3
4#include "/sys/driver_info.h"
5
6/* Request values for efun debug_info().
7 */
8
9#define DINFO_OBJECT 0 /* Print information about an object */
10#define DINFO_MEMORY 1 /* Print memory usage of an object */
11#define DINFO_OBJLIST 2 /* Return an object from the global list */
12#define DINFO_MALLOC 3 /* Print the information from the 'malloc' cmd */
13#define DINFO_STATUS 4 /* Return the 'status' information */
14#define DINFO_DUMP 5 /* Dump some special information into files */
15#define DINFO_DATA 6 /* Return internal information */
16#define DINFO_TRACE 7 /* Return the current call trace */
17#define DINFO_EVAL_NUMBER 8 /* Return the current eval number */
18
19/* Sub-request values for debug_info(DINFO_DATA) */
20
21#define DID_STATUS 0 /* Return the 'status' and 'status tables' information */
22#define DID_SWAP 1 /* Return the 'status swap' information */
23#define DID_MEMORY 2 /* Return the 'status malloc' information */
24
25/* Sub-request values for debug_info(DINFO_TRACE) */
26
27#define DIT_CURRENT 0 /* Return the current call chain as an array */
28#define DIT_ERROR 1 /* Return the last error call chain as an array */
29#define DIT_UNCAUGHT_ERROR 2 /* Return the last uncaught error call chain */
30#define DIT_STR_CURRENT 3 /* Return the current call chain as a string */
31#define DIT_CURRENT_DEPTH 4 /* Return the current control stack depth */
32
33/* Indices into the array resulting from debug_info(DINFO_DATA, DID_STATUS)
34 */
35
36#define DID_ST_ACTIONS 0
37#define DID_ST_ACTIONS_SIZE 1
38#define DID_ST_SHADOWS 2
39#define DID_ST_SHADOWS_SIZE 3
40
41#define DID_ST_OBJECTS 4
42#define DID_ST_OBJECTS_SIZE 5
43#define DID_ST_OBJECTS_SWAPPED 6
44#define DID_ST_OBJECTS_SWAP_SIZE 7
45#define DID_ST_OBJECTS_LIST 8
46#define DID_ST_OBJECTS_NEWLY_DEST 9
47#define DID_ST_OBJECTS_DESTRUCTED 10
48#define DID_ST_OBJECTS_PROCESSED 11
49#define DID_ST_OBJECTS_AVG_PROC 12
50
51#define DID_ST_OTABLE 13
52#define DID_ST_OTABLE_SLOTS 14
53#define DID_ST_OTABLE_SIZE 15
54
55#define DID_ST_HBEAT_OBJS 16
56#define DID_ST_HBEAT_CALLS 17
57#define DID_ST_HBEAT_CALLS_TOTAL 18
58#define DID_ST_HBEAT_SLOTS 19
59#define DID_ST_HBEAT_SIZE 20
60#define DID_ST_HBEAT_PROCESSED 21
61#define DID_ST_HBEAT_AVG_PROC 22
62
63#define DID_ST_CALLOUTS 23
64#define DID_ST_CALLOUT_SIZE 24
65
66#define DID_ST_ARRAYS 25
67#define DID_ST_ARRAYS_SIZE 26
68
69#define DID_ST_MAPPINGS 27
70#define DID_ST_MAPPINGS_SIZE 28
71#define DID_ST_HYBRID_MAPPINGS 51
72#define DID_ST_HASH_MAPPINGS 54
73
74#define DID_ST_STRUCTS 29
75#define DID_ST_STRUCTS_SIZE 30
76#define DID_ST_STRUCT_TYPES 31
77#define DID_ST_STRUCT_TYPES_SIZE 32
78
79#define DID_ST_PROGS 33
80#define DID_ST_PROGS_SIZE 34
81
82#define DID_ST_PROGS_SWAPPED 35
83#define DID_ST_PROGS_SWAP_SIZE 36
84
85#define DID_ST_USER_RESERVE 37
86#define DID_ST_MASTER_RESERVE 38
87#define DID_ST_SYSTEM_RESERVE 39
88
89#define DID_ST_ADD_MESSAGE 40
90#define DID_ST_PACKETS 41
91#define DID_ST_PACKET_SIZE 42
92#define DID_ST_PACKETS_IN 43
93#define DID_ST_PACKET_SIZE_IN 44
94
95#define DID_ST_APPLY 45
96#define DID_ST_APPLY_HITS 46
97
98#define DID_ST_STRINGS 47
99#define DID_ST_STRING_SIZE 48
100#define DID_ST_STR_TABLE_SIZE 49
101#define DID_ST_STR_OVERHEAD 50
102#define DID_ST_UNTABLED 52
103#define DID_ST_UNTABLED_SIZE 53
104#define DID_ST_UNUSED54 54 /* UNUSED */
105#define DID_ST_UNUSED55 55 /* UNUSED */
106#define DID_ST_TABLED 56
107#define DID_ST_TABLED_SIZE 57
108#define DID_ST_STR_SEARCHES 58
109#define DID_ST_STR_SEARCHLEN 59
110#define DID_ST_STR_SEARCHES_BYVALUE 60
111#define DID_ST_STR_SEARCHLEN_BYVALUE 61
112#define DID_ST_STR_CHAINS 62
113#define DID_ST_STR_ADDED 63
114#define DID_ST_STR_DELETED 64
115#define DID_ST_STR_COLLISIONS 65
116#define DID_ST_STR_FOUND 66
117#define DID_ST_STR_FOUND_BYVALUE 67
118
119#define DID_ST_RX_CACHED 68
120#define DID_ST_RX_TABLE 69
121#define DID_ST_RX_TABLE_SIZE 70
122#define DID_ST_RX_REQUESTS 71
123#define DID_ST_RX_REQ_FOUND 72
124#define DID_ST_RX_REQ_COLL 73
125
126#define DID_ST_MB_FILE 74
127#define DID_ST_MB_SWAP 75
128
129#define DID_ST_BOOT_TIME 76
130
131#define DID_STATUS_MAX 77 /* Total number of entries */
132
133
134/* Indices into the array resulting from debug_info(DINFO_DATA, DID_SWAP)
135 */
136
137#define DID_SW_PROGS 0
138#define DID_SW_PROG_SIZE 1
139#define DID_SW_PROG_UNSWAPPED 2
140#define DID_SW_PROG_U_SIZE 3
141#define DID_SW_VARS 4
142#define DID_SW_VAR_SIZE 5
143#define DID_SW_FREE 6
144#define DID_SW_FREE_SIZE 7
145#define DID_SW_FILE_SIZE 8
146#define DID_SW_REUSED 9
147#define DID_SW_SEARCHES 10
148#define DID_SW_SEARCH_LEN 11
149#define DID_SW_F_SEARCHES 12
150#define DID_SW_F_SEARCH_LEN 13
151#define DID_SW_COMPACT 14
152#define DID_SW_RECYCLE_FREE 15
153
154#define DID_SWAP_MAX 16
155
156
157/* Indices into the array resulting from debug_info(DINFO_DATA, DID_MEMORY)
158 */
159
160#define DID_MEM_NAME 0
161#define DID_MEM_SBRK 1
162#define DID_MEM_SBRK_SIZE 2
163#define DID_MEM_LARGE 3
164#define DID_MEM_LARGE_SIZE 4
165#define DID_MEM_LFREE 5
166#define DID_MEM_LFREE_SIZE 6
167#define DID_MEM_LWASTED 7
168#define DID_MEM_LWASTED_SIZE 8
169#define DID_MEM_CHUNK 9
170#define DID_MEM_CHUNK_SIZE 10
171#define DID_MEM_SLAB (DID_MEM_CHUNK)
172#define DID_MEM_SLAB_SIZE (DID_MEM_CHUNK_SIZE)
173#define DID_MEM_SMALL 11
174#define DID_MEM_SMALL_SIZE 12
175#define DID_MEM_SFREE 13
176#define DID_MEM_SFREE_SIZE 14
177#define DID_MEM_SWASTED 15
178#define DID_MEM_SWASTED_SIZE 16
179#define DID_MEM_SMALL_OVERHEAD_SIZE (DID_MEM_SWASTED_SIZE)
180#define DID_MEM_MINC_CALLS 17
181#define DID_MEM_MINC_SUCCESS 19
182#define DID_MEM_MINC_SIZE 19
183#define DID_MEM_PERM 20
184#define DID_MEM_PERM_SIZE 21
185#define DID_MEM_CLIB 22
186#define DID_MEM_CLIB_SIZE 23
187#define DID_MEM_OVERHEAD 24
188#define DID_MEM_ALLOCATED 25
189#define DID_MEM_USED 26
190#define DID_MEM_TOTAL_UNUSED 27
191#define DID_MEM_DEFRAG_CALLS 28
192#define DID_MEM_DEFRAG_CALLS_REQ 29
193#define DID_MEM_SLAB_FREE (DID_MEM_DEFRAG_CALLS)
194#define DID_MEM_SLAB_FREE_SIZE (DID_MEM_DEFRAG_CALLS_REQ)
195#define DID_MEM_DEFRAG_REQ_SUCCESS 30
196#define DID_MEM_DEFRAG_BLOCKS_INSPECTED 31
197#define DID_MEM_DEFRAG_BLOCKS_MERGED 32
198#define DID_MEM_DEFRAG_BLOCKS_RESULT 33
199#define DID_MEM_AVL_NODES 34
200#define DID_MEM_EXT_STATISTICS 35
201
202#define DID_MEMORY_MAX 36
203
204/* Indices into the subarrays of DID_MEM_EXT_STATISTICS (if given) */
205
206#define DID_MEM_ES_MAX_ALLOC 0
207#define DID_MEM_ES_CUR_ALLOC 1
208#define DID_MEM_ES_MAX_FREE 2
209#define DID_MEM_ES_CUR_FREE 3
210#define DID_MEM_ES_AVG_XALLOC 4
211#define DID_MEM_ES_AVG_XFREE 5
212#define DID_MEM_ES_FULL_SLABS 6
213#define DID_MEM_ES_FREE_SLABS 7
214#define DID_MEM_ES_TOTAL_SLABS 8
215
216#define DID_MEM_ES_MAX 9
217
218#endif /* LPC_DEBUG_INFO_H_ */