[profiler] Avoid instrumenting inlined methods
authorUri Simchoni <uri@vfunction.com>
Mon, 7 Aug 2017 04:39:12 +0000 (07:39 +0300)
committerUri Simchoni <uri@vfunction.com>
Mon, 7 Aug 2017 16:54:45 +0000 (19:54 +0300)
commitb6397061ddd80784e8bb92b431a814cf5c1a9516
treeaf301f47b76d7674316e7dbb665c47bec70d43aa
parent65e92f4cef463ed41475e0f9e35ba38592c76abb
[profiler] Avoid instrumenting inlined methods

An inlined method does not require instrumentation (if it
did, it would not have been inlined). The flags that
control instrumentation options are valid for the caller
method and are not to be consulted.

This patch replaces an assertion with a check and early
return. A method that "wants to be instrumented" does not
get inlined, but a method that "doesn't want to be instrumented"
can get inlined. However, the flags that control instrumention
options have been calculated against the caller method, hence
they should not be consulted at all. The extra check renders
the assertion unnecessary.
mono/mini/mini-profiler.c