Custom prolog / epilog functions for profiling

Is it possible, with Visual Studio compilers, to write 2 functions that are called before calling other functions and after executing the functions? In gcc, you can do this with the __cyg_profile_func_*() functions:

 void __cyg_profile_func_enter(void *func_address, void *call_site ) __attribute__ ((no_instrument_function)); void __cyg_profile_func_exit (void *func_address, void *call_site ) __attribute__ ((no_instrument_function)); 

I need a solution that works for kernel software. I think Microsoft Detours can help, but the free version is only 32-bit and my drivers are pure 64-bit.

I want to generate a call schedule for a specific code.

Thanks.

+4
source share
1 answer
+5
source

Source: https://habr.com/ru/post/1285731/


All Articles