title: Instruments Time Profiler: What does <Call stack limit reached> mean? Can I control the limit?
body: <p><img src="https://i.stack.imgur.com/iqQdy.png" alt="Instruments screenshot showing &lt;Call stack limit reached&gt;"></p>
  
  <p>When my program is executing a deeply recursive algorithm, the Time Profiler in Instruments creates what looks like a new entry point function called <code>&lt;Call stack limit reached&gt;</code>.  I guess this means that Time Profiler has some limit when back-tracing the current stack when it samples.</p>
  
  <p>Can I control this limit?  If so, how?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I've tried the <code>Preferences-&gt;DTrace-&gt;Max Backtrace Depth</code> setting but it appears to have no effect.</p>
  
  <p>Here is a short program with deep recursion that gets to the defined depth an spends a while there:</p>
  
  <pre><code>#define RECURSION_DEPTH 200
  
  void recurse( unsigned const depth )
  {
      if( RECURSION_DEPTH == depth ) for( unsigned i = 0; i &lt; 1000000000; ++i );
      else recurse( depth + 1 );
  }
  
  int main()
  {
      recurse( 1 );
      return 0;
  }
  </code></pre>
  
  <p>When I Time Profile this program, I continue to see the <code>&lt;Call stack limit reached&gt;</code> phenomenon even if I set the DTrace preference to a number much greater than 200.</p>