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:
authorAlex Rønne Petersen <alpeters@microsoft.com>2017-08-07 23:30:59 +0300
committerAlex Rønne Petersen <alpeters@microsoft.com>2017-08-07 23:47:55 +0300
commita5bc0ce8a0faf81e0a46f9c7d9d7a0913298c057 (patch)
treeacba33efe37d0707964240b65882e62d41c64034 /samples
parentb40ae96a9b9c10f650c21aa5ba5769b992e243e2 (diff)
[profiler] Split method_leave callback into a method_tail_call callback.
With this, profilers can distinguish between the two, and also know what the target method of a tail call is. The call instrumentation flags have been renamed accordingly and a new flag has been added for instrumenting tail calls. I've also added a flag for exceptional leave events, and method_exception_leave is only raised if this flag is given for a method. Also refactored the relevant JIT code a bit so it's easier to follow.
Diffstat (limited to 'samples')
-rw-r--r--samples/profiler/sample.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/samples/profiler/sample.c b/samples/profiler/sample.c
index a5ee4435ea6..a210317e913 100644
--- a/samples/profiler/sample.c
+++ b/samples/profiler/sample.c
@@ -2,9 +2,9 @@
/*
* 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`
*
@@ -35,15 +35,10 @@ sample_method_enter (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallCon
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 */
@@ -56,7 +51,6 @@ mono_profiler_init_sample (const char *desc)
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);
}