[bcl] Enable tests for the monodroid profile.
[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);
27
28 void mono_profiler_method_enter    (MonoMethod *method);
29 void mono_profiler_method_leave    (MonoMethod *method);
30 void mono_profiler_method_jit      (MonoMethod *method);
31 void mono_profiler_method_end_jit  (MonoMethod *method, MonoJitInfo* jinfo, int result);
32 void mono_profiler_method_free     (MonoMethod *method);
33 void mono_profiler_method_start_invoke (MonoMethod *method);
34 void mono_profiler_method_end_invoke   (MonoMethod *method);
35
36 void mono_profiler_code_transition (MonoMethod *method, int result);
37 void mono_profiler_allocation      (MonoObject *obj);
38 void mono_profiler_monitor_event   (MonoObject *obj, MonoProfilerMonitorEvent event);
39 void mono_profiler_stat_hit        (guchar *ip, void *context);
40 void mono_profiler_stat_call_chain (int call_chain_depth, guchar **ips, void *context);
41 int  mono_profiler_stat_get_call_chain_depth (void);
42 MonoProfilerCallChainStrategy  mono_profiler_stat_get_call_chain_strategy (void);
43 void mono_profiler_thread_start    (gsize tid);
44 void mono_profiler_thread_end      (gsize tid);
45 void mono_profiler_thread_name     (gsize tid, const char *name);
46
47 void mono_profiler_exception_thrown         (MonoObject *exception);
48 void mono_profiler_exception_method_leave   (MonoMethod *method);
49 void mono_profiler_exception_clause_handler (MonoMethod *method, int clause_type, int clause_num);
50
51 void mono_profiler_assembly_event  (MonoAssembly *assembly, int code);
52 void mono_profiler_assembly_loaded (MonoAssembly *assembly, int result);
53
54 void mono_profiler_module_event  (MonoImage *image, int code);
55 void mono_profiler_module_loaded (MonoImage *image, int result);
56
57 void mono_profiler_class_event  (MonoClass *klass, int code);
58 void mono_profiler_class_loaded (MonoClass *klass, int result);
59
60 void mono_profiler_appdomain_event  (MonoDomain *domain, int code);
61 void mono_profiler_appdomain_loaded (MonoDomain *domain, int result);
62 void mono_profiler_appdomain_name   (MonoDomain *domain, const char *name);
63
64 void mono_profiler_context_loaded (MonoAppContext *context);
65 void mono_profiler_context_unloaded (MonoAppContext *context);
66
67 void mono_profiler_iomap (char *report, const char *pathname, const char *new_pathname);
68
69 MonoProfileCoverageInfo* mono_profiler_coverage_alloc (MonoMethod *method, int entries);
70 void                     mono_profiler_coverage_free  (MonoMethod *method);
71
72 void mono_profiler_gc_event       (MonoGCEvent e, int generation);
73 void mono_profiler_gc_heap_resize (gint64 new_size);
74 void mono_profiler_gc_moves       (void **objects, int num);
75 void mono_profiler_gc_handle      (int op, int type, uintptr_t handle, MonoObject *obj);
76 void mono_profiler_gc_roots       (int num, void **objects, int *root_types, uintptr_t *extra_info);
77
78 void mono_profiler_gc_finalize_begin (void);
79 void mono_profiler_gc_finalize_object_begin (MonoObject *obj);
80 void mono_profiler_gc_finalize_object_end (MonoObject *obj);
81 void mono_profiler_gc_finalize_end (void);
82
83 void mono_profiler_code_chunk_new (gpointer chunk, int size);
84 void mono_profiler_code_chunk_destroy (gpointer chunk);
85 void mono_profiler_code_buffer_new (gpointer buffer, int size, MonoProfilerCodeBufferType type, gconstpointer data);
86
87 void mono_profiler_runtime_initialized (void);
88
89 int64_t mono_profiler_get_sampling_rate (void);
90 MonoProfileSamplingMode mono_profiler_get_sampling_mode (void);
91
92 #endif /* __MONO_PROFILER_PRIVATE_H__ */
93