title: Printing stack traces
body: <p>I have a very short test file:</p>
  
  <pre><code>let print_backtrace () = try raise Not_found with
      Not_found -&gt; Printexc.print_backtrace stdout;;
  
  let f () = print_backtrace (); Printf.printf "this is to make f non-tail-recursive\n";;
  
  f ();
  </code></pre>
  
  <p>I compile and run:</p>
  
  <pre><code>% ocamlc -g test.ml      
  % OCAMLRUNPARAM=b ./a.out
  Raised at file "test.ml", line 1, characters 35-44
  this is to make f non-tail-recursive
  </code></pre>
  
  <p>Why isn't <code>f</code> listed in the stack trace? How can I write a function that will print a stack trace of the location it's called from?</p>