The UHF of the film world.


quietearth [General News 10.26.06]

Share on Google+


Rrrrrrrr matey.

Ok well pirate day has been over for a while, but how bout them barnacles in the kernel?


I just got systemtap to compile under ubuntu, which was a much easier task then I thought. First off we need to compile a custom kernel with a couple of things enabled. Follow my post on compiling a custom kernel here. When you get to the part with "make menuconfig" here's the options we need to turn on:
Kernel hacking  --->
    [*] Kernel debugging
        [*]   Compile the kernel with debug info
Instrumentation Support  --->
    [*] Kprobes (EXPERIMENTAL)


Once this is done, install the kernel image and kernel headers package, and make sure to put it at the top of your grub boot list. Reboot and bam, your ready.

So we need to install an extra package:
# apt-get install libglib2.0-dev

Get the systemtap package, I used the latest snapshot 20061021:
ftp://sources.redhat.com/pub/systemtap/snapshots

Then grab the elfutils package, I'm using 0.124.
ftp://sources.redhat.com/pub/systemtap/elfutils

Now gunzip/untar the 2 packages in seperate directories and run configure like such from the systemtap directory:
# ./configure --with-elfutils=/path/to/elfutils/dir
# make
# make install


One last thing, it needs to know where to find the kernel image which has the debug info compiled in. For me this is located at:
/usr/src/linux-source-2.6.15/vmlinux
so we just need to create a symlink for systemtap to find it, your filenames and paths might be different.
# ln -s /usr/src/linux-source-2.6.15/vmlinux /lib/modules/2.6.15.7-ubuntu1custom2/vmlinux

In the systemtap src/examples/small_demos directory are a bunch of example scripts you can run. They worked fine for me. I still don't know much about this program, but at least now I can play with it.

If anyone has any good usage examples or problems please let me know!

Tested under dapper.

Pingbacks

Pingback from http://www.michaeldolan.com/605
on February 27th, 2007 2:55:52 GMT

avatar

Frank Ch. Eigler (5 years ago) Reply

For some more examples, see the wiki page
http://sourceware.org/systemtap/wiki/WarStories

avatar

Anonymous (4 years ago) Reply

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 7.10
Release: 7.10
Codename: gutsy
# apt-cache search systemtap
systemtap - instrumentation system for Linux 2.6


Leave a comment








Related articles