@@ -1069,9 +1069,41 @@ mono_profiler_install_jit_end (MonoLegacyProfileJitResult end)
1069
1069
}
1070
1070
}
1071
1071
1072
+
1073
+ static MonoProfilerCallInstrumentationFlags
1074
+ call_instrumentation_filter_callback (MonoProfiler * prof , MonoMethod * method )
1075
+ {
1076
+ return MONO_PROFILER_CALL_INSTRUMENTATION_ENTER | MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE | MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL | MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE ;
1077
+ }
1078
+
1079
+ typedef enum
1080
+ {
1081
+ MONO_PROFILE_NONE = 0 ,
1082
+ MONO_PROFILE_APPDOMAIN_EVENTS = 1 << 0 ,
1083
+ MONO_PROFILE_ASSEMBLY_EVENTS = 1 << 1 ,
1084
+ MONO_PROFILE_MODULE_EVENTS = 1 << 2 ,
1085
+ MONO_PROFILE_CLASS_EVENTS = 1 << 3 ,
1086
+ MONO_PROFILE_JIT_COMPILATION = 1 << 4 ,
1087
+ MONO_PROFILE_INLINING = 1 << 5 ,
1088
+ MONO_PROFILE_EXCEPTIONS = 1 << 6 ,
1089
+ MONO_PROFILE_ALLOCATIONS = 1 << 7 ,
1090
+ MONO_PROFILE_GC = 1 << 8 ,
1091
+ MONO_PROFILE_THREADS = 1 << 9 ,
1092
+ MONO_PROFILE_REMOTING = 1 << 10 ,
1093
+ MONO_PROFILE_TRANSITIONS = 1 << 11 ,
1094
+ MONO_PROFILE_ENTER_LEAVE = 1 << 12 ,
1095
+ MONO_PROFILE_COVERAGE = 1 << 13 ,
1096
+ MONO_PROFILE_INS_COVERAGE = 1 << 14 ,
1097
+ MONO_PROFILE_STATISTICAL = 1 << 15
1098
+ } LegacyMonoProfileFlags ;
1099
+
1072
1100
void
1073
1101
mono_profiler_set_events (int flags )
1074
1102
{
1103
+ if (flags & MONO_PROFILE_ENTER_LEAVE )
1104
+ mono_profiler_set_call_instrumentation_filter_callback (current -> handle , call_instrumentation_filter_callback );
1105
+ else
1106
+ mono_profiler_set_call_instrumentation_filter_callback (current -> handle , NULL );
1075
1107
/* Do nothing. */
1076
1108
}
1077
1109
0 commit comments