Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'samples')
-rw-r--r--samples/profiler/sample.c18
-rw-r--r--samples/size/size.c8
2 files changed, 16 insertions, 10 deletions
diff --git a/samples/profiler/sample.c b/samples/profiler/sample.c
index 45c46da07d9..75e2f779590 100644
--- a/samples/profiler/sample.c
+++ b/samples/profiler/sample.c
@@ -35,19 +35,25 @@ sample_method_leave (MonoProfiler *prof, MonoMethod *method)
{
}
+static MonoProfilerCallInstrumentationFlags
+sample_instrumentation_filter (MonoProfiler *prof, MonoMethod *method)
+{
+ return MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE | MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE;
+}
+
/* the entry point */
void
-mono_profiler_startup (const char *desc)
+mono_profiler_init (const char *desc)
{
MonoProfiler *prof;
prof = g_new0 (MonoProfiler, 1);
- mono_profiler_install (prof, sample_shutdown);
-
- mono_profiler_install_enter_leave (sample_method_enter, sample_method_leave);
-
- mono_profiler_set_events (MONO_PROFILE_ENTER_LEAVE);
+ MonoProfilerHandle handle = mono_profiler_install (prof);
+ mono_profiler_set_runtime_shutdown_callback (handle, sample_shutdown);
+ mono_profiler_set_call_instrumentation_filter_callback (handle, sample_instrumentation_filter);
+ mono_profiler_set_method_enter_callback (handle, sample_method_enter);
+ mono_profiler_set_method_leave_callback (handle, sample_method_leave);
}
diff --git a/samples/size/size.c b/samples/size/size.c
index c24b417d21f..86ec27dfd6d 100644
--- a/samples/size/size.c
+++ b/samples/size/size.c
@@ -121,7 +121,7 @@ GetMemoryUsage (MonoObject *this)
static int installed = 0;
-void install_icall (MonoProfiler *prof, MonoMethod *method, MonoJitInfo* jinfo, int result)
+void install_icall (MonoProfiler *prof, MonoMethod *method, MonoJitInfo* jinfo)
{
if (installed)
return;
@@ -131,8 +131,8 @@ void install_icall (MonoProfiler *prof, MonoMethod *method, MonoJitInfo* jinfo,
}
void
-mono_profiler_startup (const char *desc)
+mono_profiler_init (const char *desc)
{
- mono_profiler_install_jit_end (install_icall);
- mono_profiler_set_events (MONO_PROFILE_JIT_COMPILATION);
+ MonoProfilerHandle handle = mono_profiler_install (NULL);
+ mono_profiler_set_jit_done_callback (handle, install_icall);
}