Merge pull request #1317 from nealef/master
[mono.git] / mono / metadata / profiler-private.h
1
2 #ifndef __MONO_PROFILER_PRIVATE_H__
3 #define __MONO_PROFILER_PRIVATE_H__
4
5 #include <mono/metadata/profiler.h>
6 #include "mono/utils/mono-compiler.h"
7 #include <glib.h>
8
9 extern MonoProfileFlags mono_profiler_events;
10
11 enum {
12         MONO_PROFILE_START_LOAD,
13         MONO_PROFILE_END_LOAD,
14         MONO_PROFILE_START_UNLOAD,
15         MONO_PROFILE_END_UNLOAD
16 };
17
18 typedef struct {
19         int entries;
20         struct {
21                 guchar* cil_code;
22                 int count;
23         } data [1];
24 } MonoProfileCoverageInfo;
25
26 void mono_profiler_shutdown        (void) MONO_INTERNAL;
27
28 void mono_profiler_method_enter    (MonoMethod *method) MONO_INTERNAL;
29 void mono_profiler_method_leave    (MonoMethod *method) MONO_INTERNAL;
30 void mono_profiler_method_jit      (MonoMethod *method) MONO_INTERNAL;
31 void mono_profiler_method_end_jit  (MonoMethod *method, MonoJitInfo* jinfo, int result) MONO_INTERNAL;
32 void mono_profiler_method_free     (MonoMethod *method) MONO_INTERNAL;
33 void mono_profiler_method_start_invoke (MonoMethod *method) MONO_INTERNAL;
34 void mono_profiler_method_end_invoke   (MonoMethod *method) MONO_INTERNAL;
35
36 void mono_profiler_code_transition (MonoMethod *method, int result) MONO_INTERNAL;
37 void mono_profiler_allocation      (MonoObject *obj, MonoClass *klass) MONO_INTERNAL;
38 void mono_profiler_monitor_event   (MonoObject *obj, MonoProfilerMonitorEvent event) MONO_INTERNAL;
39 void mono_profiler_stat_hit        (guchar *ip, void *context) MONO_INTERNAL;
40 void mono_profiler_stat_call_chain (int call_chain_depth, guchar **ips, void *context) MONO_INTERNAL;
41 int  mono_profiler_stat_get_call_chain_depth (void) MONO_INTERNAL;
42 MonoProfilerCallChainStrategy  mono_profiler_stat_get_call_chain_strategy (void) MONO_INTERNAL;
43 void mono_profiler_thread_start    (gsize tid) MONO_INTERNAL;
44 void mono_profiler_thread_end      (gsize tid) MONO_INTERNAL;
45 void mono_profiler_thread_name     (gsize tid, const char *name) MONO_INTERNAL;
46
47 void mono_profiler_exception_thrown         (MonoObject *exception) MONO_INTERNAL;
48 void mono_profiler_exception_method_leave   (MonoMethod *method) MONO_INTERNAL;
49 void mono_profiler_exception_clause_handler (MonoMethod *method, int clause_type, int clause_num) MONO_INTERNAL;
50
51 void mono_profiler_assembly_event  (MonoAssembly *assembly, int code) MONO_INTERNAL;
52 void mono_profiler_assembly_loaded (MonoAssembly *assembly, int result) MONO_INTERNAL;
53
54 void mono_profiler_module_event  (MonoImage *image, int code) MONO_INTERNAL;
55 void mono_profiler_module_loaded (MonoImage *image, int result) MONO_INTERNAL;
56
57 void mono_profiler_class_event  (MonoClass *klass, int code) MONO_INTERNAL;
58 void mono_profiler_class_loaded (MonoClass *klass, int result) MONO_INTERNAL;
59
60 void mono_profiler_appdomain_event  (MonoDomain *domain, int code) MONO_INTERNAL;
61 void mono_profiler_appdomain_loaded (MonoDomain *domain, int result) MONO_INTERNAL;
62
63 void mono_profiler_iomap (char *report, const char *pathname, const char *new_pathname) MONO_INTERNAL;
64
65 MonoProfileCoverageInfo* mono_profiler_coverage_alloc (MonoMethod *method, int entries) MONO_INTERNAL;
66 void                     mono_profiler_coverage_free  (MonoMethod *method) MONO_INTERNAL;
67
68 void mono_profiler_gc_event       (MonoGCEvent e, int generation) MONO_INTERNAL;
69 void mono_profiler_gc_heap_resize (gint64 new_size) MONO_INTERNAL;
70 void mono_profiler_gc_moves       (void **objects, int num) MONO_INTERNAL;
71 void mono_profiler_gc_handle      (int op, int type, uintptr_t handle, MonoObject *obj) MONO_INTERNAL;
72 void mono_profiler_gc_roots       (int num, void **objects, int *root_types, uintptr_t *extra_info) MONO_INTERNAL;
73
74 void mono_profiler_code_chunk_new (gpointer chunk, int size) MONO_INTERNAL;
75 void mono_profiler_code_chunk_destroy (gpointer chunk) MONO_INTERNAL;
76 void mono_profiler_code_buffer_new (gpointer buffer, int size, MonoProfilerCodeBufferType type, void *data) MONO_INTERNAL;
77
78 void mono_profiler_runtime_initialized (void) MONO_INTERNAL;
79
80 int64_t mono_profiler_get_sampling_rate (void) MONO_INTERNAL;
81 MonoProfileSamplingMode mono_profiler_get_sampling_mode (void) MONO_INTERNAL;
82
83 #endif /* __MONO_PROFILER_PRIVATE_H__ */
84