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 <alexrp@xamarin.com>2017-07-26 01:55:22 +0300
committerAlex Rønne Petersen <alexrp@xamarin.com>2017-08-01 07:15:06 +0300
commitf9ae98ab88f522219cd6be6fd282ef30adbc5365 (patch)
treed875c122d99e38f16f005b6a3a1a2aa9d11a85a5 /msvc/libmono-static.vcxproj
parenta71c1c7196c272486507a96a784e0f0158acac35 (diff)
[profiler] Implement call context introspection for enter/leave events.
When this feature is enabled for a method, the enter/leave event receives an additional argument, a so-called 'call context'. This call context contains enough information about the stack frame of the instrumented method to allow the enter/leave callback to inspect the 'this' reference, method arguments, local variables, and the return value (for non-void methods). This feature enables some interesting scenarios that were not possible with the regular enter/leave events. For example, a profiler could instrument well-known methods in the managed thread pool code to get an idea of how an application is using the thread pool, or it could instrument network-related methods to gather statistics or even log all network traffic. This is implemented by storing a MonoProfilerCallContext on the stack, whose MonoContext field is populated by executing an OP_FILL_PROF_CALL_CTX opcode which stores the stack pointer, frame pointer, and all callee-saved registers to it. For the epilogue, a pointer to the return value (for non-void methods) is also stored in the MonoProfilerCallContext. An address to this context is then passed to mono_profiler_raise_method_enter/leave. Based on debug info, all arguments and locals can then be looked up in the instrumented method's stack frame. For the interpreter, we just store an InterpFrame pointer on the MonoProfilerCallContext and look everything up from that. We don't need debug info in this case. This feature is currently not supported with LLVM (for regular LLVM mode, it will fall back to Mono's JIT, while for LLVM-only mode, it's not available). I also refactored the interpreter code so that enter/leave events are generated not only when interpreter debugging is enabled. Also, the interpreter will only call mono_profiler_get_call_instrumentation_flags () once per method now. Finally, I made the interpreter also generate exception leave events.
Diffstat (limited to 'msvc/libmono-static.vcxproj')
-rw-r--r--msvc/libmono-static.vcxproj1
1 files changed, 1 insertions, 0 deletions
diff --git a/msvc/libmono-static.vcxproj b/msvc/libmono-static.vcxproj
index 70dc4b0554c..b23daec2505 100644
--- a/msvc/libmono-static.vcxproj
+++ b/msvc/libmono-static.vcxproj
@@ -138,6 +138,7 @@
<ClCompile Include="..\mono\mini\type-checking.c" />
<ClCompile Include="..\mono\mini\lldb.c" />
<ClCompile Include="..\mono\mini\interp\interp-stubs.c" />
+ <ClCompile Include="..\mono\mini\mini-profiler.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{CB0D9E92-293C-439C-9AC7-C5F59B6E0772}</ProjectGuid>