[referencesource] Import System.Threading.ThreadLocal
[mono.git] / mono / profiler / proflog.h
1 #ifndef __MONO_PROFLOG_H__
2 #define __MONO_PROFLOG_H__
3
4 #define BUF_ID 0x4D504C01
5 #define LOG_HEADER_ID 0x4D505A01
6 #define LOG_VERSION_MAJOR 0
7 #define LOG_VERSION_MINOR 4
8 #define LOG_DATA_VERSION 10
9 /*
10  * Changes in data versions:
11  * version 2: added offsets in heap walk
12  * version 3: added GC roots
13  * version 4: added sample/statistical profiling
14  * version 5: added counters sampling
15  * version 6: added optional backtrace in sampling info
16  * version 8: added TYPE_RUNTIME and JIT helpers/trampolines
17  * version 9: added MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING
18  * version 10: added TYPE_COVERAGE
19  */
20
21 enum {
22         TYPE_ALLOC,
23         TYPE_GC,
24         TYPE_METADATA,
25         TYPE_METHOD,
26         TYPE_EXCEPTION,
27         TYPE_MONITOR,
28         TYPE_HEAP,
29         TYPE_SAMPLE,
30         TYPE_RUNTIME,
31         TYPE_COVERAGE,
32         /* extended type for TYPE_HEAP */
33         TYPE_HEAP_START  = 0 << 4,
34         TYPE_HEAP_END    = 1 << 4,
35         TYPE_HEAP_OBJECT = 2 << 4,
36         TYPE_HEAP_ROOT   = 3 << 4,
37         /* extended type for TYPE_METADATA */
38         TYPE_START_LOAD   = 1 << 4,
39         TYPE_END_LOAD     = 2 << 4,
40         TYPE_START_UNLOAD = 3 << 4,
41         TYPE_END_UNLOAD   = 4 << 4,
42         TYPE_LOAD_ERR     = 1 << 7,
43         TYPE_CLASS     = 1,
44         TYPE_IMAGE     = 2,
45         TYPE_ASSEMBLY  = 3,
46         TYPE_DOMAIN    = 4,
47         TYPE_THREAD    = 5,
48         /* extended type for TYPE_GC */
49         TYPE_GC_EVENT  = 1 << 4,
50         TYPE_GC_RESIZE = 2 << 4,
51         TYPE_GC_MOVE   = 3 << 4,
52         TYPE_GC_HANDLE_CREATED   = 4 << 4,
53         TYPE_GC_HANDLE_DESTROYED = 5 << 4,
54         /* extended type for TYPE_METHOD */
55         TYPE_LEAVE     = 1 << 4,
56         TYPE_ENTER     = 2 << 4,
57         TYPE_EXC_LEAVE = 3 << 4,
58         TYPE_JIT       = 4 << 4,
59         /* extended type for TYPE_EXCEPTION */
60         TYPE_THROW        = 0 << 4,
61         TYPE_CLAUSE       = 1 << 4,
62         TYPE_EXCEPTION_BT = 1 << 7,
63         /* extended type for TYPE_ALLOC */
64         TYPE_ALLOC_BT  = 1 << 4,
65         /* extended type for TYPE_MONITOR */
66         TYPE_MONITOR_BT  = 1 << 7,
67         /* extended type for TYPE_SAMPLE */
68         TYPE_SAMPLE_HIT           = 0 << 4,
69         TYPE_SAMPLE_USYM          = 1 << 4,
70         TYPE_SAMPLE_UBIN          = 2 << 4,
71         TYPE_SAMPLE_COUNTERS_DESC = 3 << 4,
72         TYPE_SAMPLE_COUNTERS      = 4 << 4,
73         /* extended type for TYPE_RUNTIME */
74         TYPE_JITHELPER = 1 << 4,
75         /* extended type for TYPE_COVERAGE */
76         TYPE_COVERAGE_ASSEMBLY = 0 << 4,
77         TYPE_COVERAGE_METHOD   = 1 << 4,
78         TYPE_COVERAGE_STATEMENT = 2 << 4,
79         TYPE_COVERAGE_CLASS = 3 << 4,
80         TYPE_END
81 };
82
83 enum {
84         SAMPLE_CYCLES = 1,
85         SAMPLE_INSTRUCTIONS,
86         SAMPLE_CACHE_MISSES,
87         SAMPLE_CACHE_REFS,
88         SAMPLE_BRANCHES,
89         SAMPLE_BRANCH_MISSES,
90         SAMPLE_LAST
91 };
92
93 #endif /* __MONO_PROFLOG_H__ */