title: Linux run kernel probe systemtap script failed with semantic error: no match"
body: <p>I've got 2 experimental environment: CentOS 6.8 and Ubuntu 16.04  Both run inside Virtualbox VM.</p>
  
  <p>On CentOS I installed</p>
  
  <pre><code>yum install kernel-devel kernel-debug
  </code></pre>
  
  <p>On Ubuntu I installed:</p>
  
  <pre><code>sudo apt-get install linux-headers-$(uname -r)
  sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge
  </code></pre>
  
  <p>On both systems I can run this successfully:</p>
  
  <pre><code>stap -ve 'probe begin { log("hello world") exit() }'
  </code></pre>
  
  <p>I tried this <code>.stp</code> script from <em>systemtap</em> guide:</p>
  
  <pre><code>#!/usr/bin/stap
  probe begin
  {
      log("begin probe")
  }
  probe syscall.open
  {
      printf("%s(%d) open (%s)\n",execname(),pid(),argstr)
  }
  probe timer.ms(4000)#4s later
  {
      exit()
  }
  probe end
  {
      log("end probe")
  }
  </code></pre>
  
  <p><code>chmod +x ...</code> the script and run as <code>root</code> user.  Both systems report errors like:</p>
  
  <pre><code>./test2.stp -v
  Pass 1: parsed user script and 124 library script(s) using 217780virt/45168res/3204shr/42664data kb, in 210usr/20sys/238real ms.
  semantic error: while resolving probe point: identifier 'kernel' at /usr/share/systemtap/tapset/linux/syscalls2.stp:197:24
          source: probe __syscall.open = kernel.function("sys_open").call
                                         ^
  
  semantic error: missing x86_64 kernel/module debuginfo [man warning::debuginfo] under '/lib/modules/2.6.32-642.el6.x86_64/build'
  
  semantic error: while resolving probe point: identifier '__syscall' at :177:47
          source: probe syscall.open = __syscall.compat_open ?, __syscall.open
                                                                ^
  
  semantic error: no match
  
  semantic error: while resolving probe point: identifier 'syscall' at ./test2.stp:6:7
          source: probe syscall.open
                        ^
  
  semantic error: no match
  
  Pass 2: analyzed script: 3 probe(s), 6 function(s), 0 embed(s), 0 global(s) using 230172virt/57516res/5204shr/52952data kb, in 120usr/150sys/270real ms.
  Pass 2: analysis failed.  [man error::pass2]
  </code></pre>
  
  <p>What's this error about?  Is it an installation problem?  Is there a syntax error in my script?</p>
  
  <p>Thanks a lot.</p>