title: Tracing all functions in my program
body: <p>Like the title says, I want to trace ALL functions calls in my application (from inside).</p>
  
  <p>I tried using "_penter" but I get either a recursion limit reached error or an access violation when I try to prevent the recursion.</p>
  
  <p>Is there any way to achieve this ?</p>
  
  <p><strong>Update</strong></p>
  
  <p>What I tried:</p>
  
  <pre><code>extern "C"
  {
      void __declspec(naked) _cdecl _penter()
      {
          _asm {
              push    eax
              push    ecx
              push    edx
              mov     ecx, [esp + 0Ch]
              push    ecx
              mov     ecx, offset Context::Instance
              call    Context::addFrame
              pop     edx
              pop     ecx
              pop     eax
              ret
          }
  }
  
  class Context
  {
   public:
      __forceinline void addFrame(const void* addr) throw() {}
  
      static thread_local Context Instance;
  };
  </code></pre>
  
  <p>sadly this still gives a stack overflow due to recursion</p>