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