blob: 94a02fd2c2ef79238956466c37878b9274da1bf4 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001#ifndef LPC_DRIVER_INFO_H_
2#define LPC_DRIVER_INFO_H_
3
4/* Definition of argument values for driver_info()
5 */
6
7#include "configuration.h"
8
9/* Driver Environment */
10#define DI_BOOT_TIME -1
11
12/* LPC Runtime status */
13#define DI_CURRENT_RUNTIME_LIMITS -10
14#define DI_EVAL_NUMBER -11
15
16/* Network configuration */
17#define DI_MUD_PORTS -20
18#define DI_UDP_PORT -21
19
20/* Memory management */
21#define DI_MEMORY_RESERVE_USER -30
22#define DI_MEMORY_RESERVE_MASTER -31
23#define DI_MEMORY_RESERVE_SYSTEM -32
24
25/* Traces */
26#define DI_TRACE_CURRENT -40
27#define DI_TRACE_CURRENT_DEPTH -41
28#define DI_TRACE_CURRENT_AS_STRING -42
29#define DI_TRACE_LAST_ERROR -43
30#define DI_TRACE_LAST_ERROR_AS_STRING -44
31#define DI_TRACE_LAST_UNCAUGHT_ERROR -45
32#define DI_TRACE_LAST_UNCAUGHT_ERROR_AS_STRING -46
33
34/* LPC Runtime statistics */
35#define DI_NUM_FUNCTION_NAME_CALLS -100
36#define DI_NUM_FUNCTION_NAME_CALL_HITS -101
37#define DI_NUM_FUNCTION_NAME_CALL_MISSES -102
38
39#define DI_NUM_OBJECTS_LAST_PROCESSED -103
40
41#define DI_NUM_HEARTBEAT_TOTAL_CYCLES -104
42#define DI_NUM_HEARTBEAT_ACTIVE_CYCLES -105
43#define DI_NUM_HEARTBEATS_LAST_PROCESSED -106
44
45#define DI_NUM_STRING_TABLE_STRINGS_ADDED -110
46#define DI_NUM_STRING_TABLE_STRINGS_REMOVED -111
47#define DI_NUM_STRING_TABLE_LOOKUPS_BY_VALUE -112
48#define DI_NUM_STRING_TABLE_LOOKUPS_BY_INDEX -113
49#define DI_NUM_STRING_TABLE_LOOKUP_STEPS_BY_VALUE -114
50#define DI_NUM_STRING_TABLE_LOOKUP_STEPS_BY_INDEX -115
51#define DI_NUM_STRING_TABLE_HITS_BY_VALUE -116
52#define DI_NUM_STRING_TABLE_HITS_BY_INDEX -117
53#define DI_NUM_STRING_TABLE_COLLISIONS -118
54
55#define DI_NUM_REGEX_LOOKUPS -120
56#define DI_NUM_REGEX_LOOKUP_HITS -121
57#define DI_NUM_REGEX_LOOKUP_MISSES -122
58#define DI_NUM_REGEX_LOOKUP_COLLISIONS -123
59
60/* Network statistics */
61#define DI_NUM_MESSAGES_OUT -200
62#define DI_NUM_PACKETS_OUT -201
63#define DI_NUM_PACKETS_IN -202
64#define DI_SIZE_PACKETS_OUT -203
65#define DI_SIZE_PACKETS_IN -204
66
67/* Load */
68#define DI_LOAD_AVERAGE_COMMANDS -300
69#define DI_LOAD_AVERAGE_LINES -301
70#define DI_LOAD_AVERAGE_PROCESSED_OBJECTS -302
71#define DI_LOAD_AVERAGE_PROCESSED_OBJECTS_RELATIVE -303
72#define DI_LOAD_AVERAGE_PROCESSED_HEARTBEATS_RELATIVE -304
73
74/* Memory use statistics */
75#define DI_NUM_ACTIONS -400
76#define DI_NUM_CALLOUTS -401
77#define DI_NUM_HEARTBEATS -402
78#define DI_NUM_SHADOWS -403
79#define DI_NUM_OBJECTS -404
80#define DI_NUM_OBJECTS_SWAPPED -405
81#define DI_NUM_OBJECTS_IN_LIST -406
82#define DI_NUM_OBJECTS_IN_TABLE -407
83#define DI_NUM_OBJECTS_DESTRUCTED -408
84#define DI_NUM_OBJECTS_NEWLY_DESTRUCTED -409
85#define DI_NUM_OBJECT_TABLE_SLOTS -410
86#define DI_NUM_PROGS -411
87#define DI_NUM_PROGS_SWAPPED -412
88#define DI_NUM_PROGS_UNSWAPPED -413
89#define DI_NUM_ARRAYS -414
90#define DI_NUM_MAPPINGS -415
91#define DI_NUM_MAPPINGS_CLEAN -416
92#define DI_NUM_MAPPINGS_HASH -417
93#define DI_NUM_MAPPINGS_HYBRID -418
94#define DI_NUM_STRUCTS -419
95#define DI_NUM_STRUCT_TYPES -420
96#define DI_NUM_VIRTUAL_STRINGS -421
97#define DI_NUM_STRINGS -422
98#define DI_NUM_STRINGS_TABLED -423
99#define DI_NUM_STRINGS_UNTABLED -424
100#define DI_NUM_STRING_TABLE_SLOTS -425
101#define DI_NUM_STRING_TABLE_SLOTS_USED -426
102#define DI_NUM_REGEX -427
103#define DI_NUM_REGEX_TABLE_SLOTS -428
Zesstra5f7e49b2017-06-18 15:30:41 +0200104#define DI_NUM_LVALUES -429
MG Mud User88f12472016-06-24 23:31:02 +0200105
106#define DI_SIZE_ACTIONS -450
107#define DI_SIZE_CALLOUTS -451
108#define DI_SIZE_HEARTBEATS -452
109#define DI_SIZE_SHADOWS -453
110#define DI_SIZE_OBJECTS -454
111#define DI_SIZE_OBJECTS_SWAPPED -455
112#define DI_SIZE_OBJECT_TABLE -456
113#define DI_SIZE_PROGS -457
114#define DI_SIZE_PROGS_SWAPPED -458
115#define DI_SIZE_PROGS_UNSWAPPED -459
116#define DI_SIZE_ARRAYS -460
117#define DI_SIZE_MAPPINGS -461
118#define DI_SIZE_STRUCTS -462
119#define DI_SIZE_STRUCT_TYPES -463
120#define DI_SIZE_STRINGS -464
121#define DI_SIZE_STRINGS_TABLED -465
122#define DI_SIZE_STRINGS_UNTABLED -466
123#define DI_SIZE_STRING_TABLE -467
124#define DI_SIZE_STRING_OVERHEAD -468
125#define DI_SIZE_REGEX -469
126#define DI_SIZE_BUFFER_FILE -470
127#define DI_SIZE_BUFFER_SWAP -471
128
129/* Memory swapper statistics */
130#define DI_NUM_SWAP_BLOCKS -500
131#define DI_NUM_SWAP_BLOCKS_FREE -501
132#define DI_NUM_SWAP_BLOCKS_REUSE_LOOKUPS -502
133#define DI_NUM_SWAP_BLOCKS_REUSE_LOOKUP_STEPS -503
134#define DI_NUM_SWAP_BLOCKS_FREE_LOOKUPS -505
135#define DI_NUM_SWAP_BLOCKS_FREE_LOOKUP_STEPS -506
136#define DI_SIZE_SWAP_BLOCKS -507
137#define DI_SIZE_SWAP_BLOCKS_FREE -508
138#define DI_SIZE_SWAP_BLOCKS_REUSED -509
139#define DI_SWAP_RECYCLE_PHASE -510
140
141/* Memory allocator statistics */
142#define DI_MEMORY_ALLOCATOR_NAME -600
143
144#define DI_NUM_SYS_ALLOCATED_BLOCKS -610
145#define DI_NUM_LARGE_BLOCKS_ALLOCATED -611
146#define DI_NUM_LARGE_BLOCKS_FREE -612
147#define DI_NUM_LARGE_BLOCKS_WASTE -613
148#define DI_NUM_SMALL_BLOCKS_ALLOCATED -614
149#define DI_NUM_SMALL_BLOCKS_FREE -615
150#define DI_NUM_SMALL_BLOCKS_WASTE -616
151#define DI_NUM_SMALL_BLOCK_CHUNKS -617
152#define DI_NUM_UNMANAGED_BLOCKS -618
153#define DI_NUM_FREE_BLOCKS_AVL_NODES -619
154
155#define DI_SIZE_SYS_ALLOCATED_BLOCKS -630
156#define DI_SIZE_LARGE_BLOCKS_ALLOCATED -631
157#define DI_SIZE_LARGE_BLOCKS_FREE -632
158#define DI_SIZE_LARGE_BLOCKS_WASTE -633
159#define DI_SIZE_LARGE_BLOCK_OVERHEAD -634
160#define DI_SIZE_SMALL_BLOCKS_ALLOCATED -635
161#define DI_SIZE_SMALL_BLOCKS_FREE -636
162#define DI_SIZE_SMALL_BLOCKS_WASTE -637
163#define DI_SIZE_SMALL_BLOCK_OVERHEAD -638
164#define DI_SIZE_SMALL_BLOCK_CHUNKS -639
165#define DI_SIZE_UNMANAGED_BLOCKS -640
166#define DI_SIZE_MEMORY_USED -641
167#define DI_SIZE_MEMORY_UNUSED -642
168#define DI_SIZE_MEMORY_OVERHEAD -643
169
170#define DI_NUM_INCREMENT_SIZE_CALLS -650
171#define DI_NUM_INCREMENT_SIZE_CALL_SUCCESSES -651
172#define DI_SIZE_INCREMENT_SIZE_CALL_DIFFS -652
173#define DI_NUM_REPLACEMENT_MALLOC_CALLS -653
174#define DI_SIZE_REPLACEMENT_MALLOC_CALLS -654
175#define DI_NUM_MEMORY_DEFRAGMENTATION_CALLS_FULL -655
176#define DI_NUM_MEMORY_DEFRAGMENTATION_CALLS_TARGETED -656
177#define DI_NUM_MEMORY_DEFRAGMENTATION_CALL_TARGET_HITS -657
178#define DI_NUM_MEMORY_DEFRAGMENTATION_BLOCKS_INSPECTED -658
179#define DI_NUM_MEMORY_DEFRAGMENTATION_BLOCKS_MERGED -659
180#define DI_NUM_MEMORY_DEFRAGMENTATION_BLOCKS_RESULTING -660
181
182#define DI_MEMORY_EXTENDED_STATISTICS -670
183
184/* Status texts */
185#define DI_STATUS_TEXT_MEMORY -700
186#define DI_STATUS_TEXT_TABLES -701
187#define DI_STATUS_TEXT_SWAP -702
188#define DI_STATUS_TEXT_MALLOC -703
189#define DI_STATUS_TEXT_MALLOC_EXTENDED -704
190
191/* Indices into the subarrays of DI_MEMORY_EXTENDED_STATISTICS (if given) */
192
193#define DIM_ES_MAX_ALLOC 0
194#define DIM_ES_CUR_ALLOC 1
195#define DIM_ES_MAX_FREE 2
196#define DIM_ES_CUR_FREE 3
197#define DIM_ES_AVG_XALLOC 4
198#define DIM_ES_AVG_XFREE 5
199#define DIM_ES_FULL_SLABS 6
200#define DIM_ES_FREE_SLABS 7
201#define DIM_ES_TOTAL_SLABS 8
202
203#define DIM_ES_MAX 9
204
205
206/* Definition of argument values for dump_driver_info()
207 */
208
209#define DDI_OBJECTS 0
210#define DDI_OBJECTS_DESTRUCTED 1
211#define DDI_OPCODES 2
212#define DDI_MEMORY 3
213
214/* Indices into the subarrays resulting from driver_info(DI_TRACE_*)
215 */
216
217#define TRACE_TYPE 0
218#define TRACE_NAME 1
219#define TRACE_PROGRAM 2
220#define TRACE_OBJECT 3
221#define TRACE_LOC 4
222#ifdef __EVAL_COST_TRACE__
223#define TRACE_EVALCOST 5
224
225#define TRACE_MAX 6
226#else
227#define TRACE_MAX 5
228#endif
229
230/* Values for entry TRACE_TYPE */
231
232#define TRACE_TYPE_SYMBOL 0
233#define TRACE_TYPE_SEFUN 1
234#define TRACE_TYPE_EFUN 2
235#define TRACE_TYPE_LAMBDA 3
236#define TRACE_TYPE_LFUN 4
237
238#endif /* LPC_DRIVER_INFO_H_ */