title: How to avoid a "probe overhead exceeded threshold" error when using system tap?
body: <p>I'm trying to using <code>stap</code> to just print out all the functions that a program calls. I did some research online and found this script (called <code>para-callgraph.stp</code>):</p>
  
  <pre class="lang-sh prettyprint-override"><code>#! /usr/bin/env stap
  
  function trace(entry_p, extra) {
    printf("%s%s%s %s\n",
           thread_indent (entry_p),
           (entry_p&gt;0?"-&gt;":"&lt;-"),
           ppfunc (),
           extra)
  }
  
  probe $1.call   { trace(1, $$parms) }
  probe $1.return { trace(-1, $$return) }
  </code></pre>
  
  <p>Which is intended to be run like this:</p>
  
  <pre class="lang-sh prettyprint-override"><code>sudo stap para-callgraph.stp 'process.function("*")' -c `pwd`/my-program
  </code></pre>
  
  <p>Now when I run this, I run into a problem. Everything works fine at first, but soon <code>systemtap</code> prints this to stderr, and exits:</p>
  
  <pre><code>ERROR: probe overhead exceeded threshold
  WARNING: Number of errors: 1, skipped probes: 0
  WARNING: There were 62469 transport failures.
  WARNING: /usr/bin/staprun exited with status: 1
  Pass 5: run failed.  [man error::pass5]
  Tip: /usr/share/doc/systemtap/README.Debian should help you get started.
  </code></pre>
  
  <p>Doing some research <a href="https://sourceware.org/systemtap/wiki/TipExhaustedResourceErrors" rel="nofollow">online</a> revealed to me that a <code>stap</code> heuristic is being triggered and shutting me off, and that I could turn it off by adding two flags <code>-g</code> and <code>--suppress-time-limits</code>. (This suggestion is backed up by <code>man stap</code> on my system.) However, that solution simply does not work and the command:</p>
  
  <pre><code>sudo stap -g --suppress-time-limits para-callgraph.stp 'process.function("*")' -c `pwd`/core-cpu1
  </code></pre>
  
  <p>Prints a very similar error message, and exits:</p>
  
  <pre><code>ERROR: probe overhead exceeded threshold
  WARNING: Number of errors: 1, skipped probes: 0
  WARNING: There were 67287 transport failures.
  WARNING: /usr/bin/staprun exited with status: 1
  Pass 5: run failed.  [man error::pass5]
  Tip: /usr/share/doc/systemtap/README.Debian should help you get started.
  </code></pre>
  
  <p>Why isn't this flag an appropriate solution to my problem? And can this problem be solved some other way, or is systemtap simply not appropriate for this kind of use-case?</p>
  
  <p>If it matters, I'm running this on a 32-bit Ubuntu VM.</p>
  
  <p>N.B. I'm most interested in why systemtap fails here, not other ways to accomplish the same thing using other software. (Indeed, it turns out for my use case, the above code <em>was</em> an abuse of systemtap.)</p>