Displaying 4 results from an estimated 4 matches for "__cyg_profile_func_exit".
2017 Jul 13
2
How to add custom instrumentation?
Hi everyone,
I run some functions using ORC JIT, now I need to add custom instrumentation.
I want to add two callbacks to each function: ‘enterFunction' at the beginning and ‘leaveFunction' at the end.
Intuition says that I could ‘just' insert CallInst's to the first and the last basic blocks in the function.
Am I correct? Are there any other/better way to do this? Is there
2017 Jul 13
2
How to add custom instrumentation?
...dan at intel.com> wrote:
>
> The '-finstrument-functions' option may already be sufficient for your needs.
>
> When selected this inserts the following two calls on entry-to and exit-from a function:
>
> __cyg_profile_func_enter(void* this_fn, void* call_site)
> __cyg_profile_func_exit(void* this_fn, void* call_site)
>
> You can then provide a custom implementation of these calls to perform the analysis tasks that you require.
>
> The two parameters are the address of the function into which the instrumentation is inserted, and the address of the call site to the in...
2016 Dec 19
1
Reining in profile instrumentation
...rn k; }
...
};
// In 'source.cpp'
#include "header.h"
...
X anX;
...
int check = anX.getK();
Now the tiny accessor function which is usually trivially eliminated during inlining, is unnecessarily instrumented with the '__cyg_profile_func_enter' and '__cyg_profile_func_exit' calls, as well as the calling function.
Magnify this by the expansion and inlining of many hundreds of such functions, and the overhead becomes very large. And unfortunately, it also hides the true cost of the component that the programmer actually wants to measure. This is why I was wonder...
2016 Dec 13
0
Reining in profile instrumentation
> On Dec 13, 2016, at 3:46 AM, Martin J. O'Riordan via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> When either ‘-pg’ or ‘-finstrument-functions’ is used, the compiler inserts the appropriate profiling hooks. This happens prior to inlining, so the hooks remain in place.
Have you tried compiling with -fprofile-generate? It enables IR-based profiling
instrumentation, which