title: Custom prolog/epilog functions for profiling
body: <p>Is it possible, with Visual Studio compilers, to write 2 functions that get called before calling into other functions and after the functions have executed? In gcc you could do that with <code>__cyg_profile_func_*()</code> functions:</p>
  
  <pre><code>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));
  </code></pre>
  
  <p>I need a solution that works for kernel mode software. I think <a href="http://research.microsoft.com/en-us/projects/detours/" rel="nofollow noreferrer">Microsoft Detours</a> may be of help, but the free edition is 32 bit only and my drivers are pure 64 bit.</p>
  
  <p>I want to generate the <a href="http://www.ibm.com/developerworks/linux/library/l-graphvis/" rel="nofollow noreferrer">call graph</a> for the specific code.</p>
  
  <p>Thanks.</p>