Use 32 as the min alignment when running under NACL.
[mono.git] / mono / utils / mono-counters.h
1 #ifndef __MONO_COUNTERS_H__
2 #define __MONO_COUNTERS_H__
3
4 #include <stdio.h>
5
6 enum {
7         MONO_COUNTER_INT,    /* 32 bit int */
8         MONO_COUNTER_UINT,    /* 32 bit uint */
9         MONO_COUNTER_WORD,   /* pointer-sized int */
10         MONO_COUNTER_LONG,   /* 64 bit int */
11         MONO_COUNTER_ULONG,   /* 64 bit uint */
12         MONO_COUNTER_DOUBLE,
13         MONO_COUNTER_STRING, /* char* */
14         MONO_COUNTER_TYPE_MASK = 0xf,
15         MONO_COUNTER_CALLBACK = 128, /* ORed with the other values */
16         MONO_COUNTER_SECTION_MASK = 0xffffff00,
17         /* sections */
18         MONO_COUNTER_JIT      = 1 << 8,
19         MONO_COUNTER_GC       = 1 << 9,
20         MONO_COUNTER_METADATA = 1 << 10,
21         MONO_COUNTER_GENERICS = 1 << 11,
22         MONO_COUNTER_SECURITY = 1 << 12,
23         MONO_COUNTER_LAST_SECTION
24 };
25
26 void mono_counters_enable (int section_mask);
27
28 /* 
29  * register addr as the address of a counter of type type.
30  * It may be a function pointer if MONO_COUNTER_CALLBACK is specified:
31  * the function should return the value and take no arguments.
32  */
33 void mono_counters_register (const char* descr, int type, void *addr);
34
35 /* 
36  * Create a readable dump of the counters for section_mask sections (ORed section values)
37  */
38 void mono_counters_dump (int section_mask, FILE *outfile);
39
40 void mono_counters_cleanup (void);
41
42 #endif /* __MONO_COUNTERS_H__ */
43