/*
* Bare bones profiler. Compile with:
- *
+ *
* linux : gcc -fPIC -shared -o libmono-profiler-sample.so sample.c `pkg-config --cflags --libs mono-2`
- * mac : gcc sample.c -o mono-profiler-sample.dylib -Dmono_free=free -lz `pkg-config --cflags mono-2` -undefined suppress -flat_namespace
+ * mac : gcc -o mono-profiler-sample.dylib sample.c -lz `pkg-config --cflags mono-2` -undefined suppress -flat_namespace
* linux with a custom prefix (e.g. --prefix=/opt/my-mono-build):
* gcc -fPIC -shared -o libmono-profiler-sample.so sample.c `PKG_CONFIG_PATH=/opt/my-mono-build/lib/pkgconfig/ pkg-config --cflags --libs mono-2`
*
prof->ncalls++;
}
-static void
-sample_method_leave (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *ctx)
-{
-}
-
static MonoProfilerCallInstrumentationFlags
sample_instrumentation_filter (MonoProfiler *prof, MonoMethod *method)
{
- return MONO_PROFILER_CALL_INSTRUMENTATION_PROLOGUE | MONO_PROFILER_CALL_INSTRUMENTATION_EPILOGUE;
+ return MONO_PROFILER_CALL_INSTRUMENTATION_ENTER;
}
/* the entry point */
mono_profiler_set_runtime_shutdown_end_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);
}