Description of problem: Attempting to run stap whilst running kernel-xen, rather than kernel [dmalcolm@cassandra stp]$ rpm -q kernel kernel-xen kernel-devel systemtap kernel-2.6.18-8.el5 kernel-xen-2.6.18-1.3002.el5 kernel-xen-2.6.18-8.el5 kernel-devel-2.6.18-8.el5 systemtap-0.5.12-1.el5 [dmalcolm@cassandra stp]$ uname -a Linux cassandra.boston.redhat.com 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:42:21 EST 2007 i686 i686 i386 GNU/Linux [dmalcolm@cassandra stp]$ stap -v ansi_colors.stp Pass 1: parsed user script and 53 library script(s) in 350usr/0sys/441real ms. Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s) in 10usr/0sys/8real ms. Pass 3: translated to C into "/tmp/staphSz9rp/stap_62ee253afbbdc5722f5661662c8f666c_688.c" in 0usr/0sys/1real ms. Module directory /lib/modules/2.6.18-8.el5xen/build check failed: No such file or directory Make sure kernel devel is installed. Pass 4: compiled C into "stap_62ee253afbbdc5722f5661662c8f666c_688.ko" in 0usr/0sys/1real ms. Pass 4: compilation failed. Try again with more '-v' (verbose) options. [dmalcolm@cassandra stp]$ ll /lib/modules/2.6.18-8.el5xen/build lrwxrwxrwx 1 root root 46 Feb 12 14:03 /lib/modules/2.6.18-8.el5xen/build -> ../../../usr/src/kernels/2.6.18-8.el5-xen-i686 [dmalcolm@cassandra stp]$ ls /usr/src/kernels/ 2.6.18-8.el5-i686 It looks like the "module directory check" is failing because /lib/modules/2.6.18-8.el5xen/build is a dangling symlink. Version-Release number of selected component (if applicable): kernel-xen-2.6.18-8.el5 kernel-devel-2.6.18-8.el5 systemtap-0.5.12-1.el5 How reproducible: 100% Steps to Reproduce: 1. boot into kernel-xen, with kernel-devel installed 2. "stap hello-world.stp" Actual results: stap fails, with error message: Module directory /lib/modules/2.6.18-8.el5xen/build check failed: No such file or directory Possibly a xen bug, rather than a systemtap bug? looks like the kernel-xen /lib/modules/2.6.18-8.el5xen/build symlink is incorrect
Indeed, looks like a kernel-xen-devel packaging bug.
Aha: I didn't have kernel-xen-devel installed, only kernel-devel Upon installing kernel-xen-devel it works. So this was user error. (Perhaps the "Make sure kernel devel is installed." error handling could detect xen and suggest installing kernel-xen-devel vs kernel-devel? Or is this a knowledgebase issue?)
We'll tweak the systemtap error message, but this bug should stay open in order to track the packaging of the dangling /build symlink with kernel base packages.
The dangling symlink isn't a bug: [dmalcolm@cassandra ~]$ ll /lib/modules/2.6.18-8.el5xen/build lrwxrwxrwx 1 root root 46 Feb 12 14:03 /lib/modules/2.6.18-8.el5xen/build -> ../../../usr/src/kernels/2.6.18-8.el5-xen-i686 [dmalcolm@cassandra ~]$ rpm -qf /lib/modules/2.6.18-8.el5xen/build kernel-xen-2.6.18-8.el5 [dmalcolm@cassandra ~]$ rpm -qf /usr/src/kernels/2.6.18-8.el5-xen-i686 kernel-xen-devel-2.6.18-8.el5 It was only dangling because I didn't have kernel-xen-devel installed at the time; I only had kernel-devel installed. So I think this was purely user error (on my part), exploring how these two things work together, which a smarter error message/knowledgebase article on "systemtap with xen" could address (is there potential to snoop on xen-specific stats in a dom0/domU with systemtap?)
The dangling symlink is necessary because Fedora builds both i686 and i586 kernels. The symlink contains i586 or i686, which is in the /usr/src/... pathname, while it is not present in the /lib/modules pathnames. Having the symlink part of the kernel-*-devel package would make it possible for the user to accidentally use the i586 kernel-devel package with the i686 kernel, resulting in broken 3rd party modules, etc... This is why the symlink is part of the kernel package.