Install systemtap in ubuntu 11.04

Source: Internet
Author: User
Tags systemtap

1. First install systemtap:

Sudo apt-Get install systemtap

2. Install the debug info of Linux kernel

You can download the debug info package from http://ddebs.ubuntu.com/pool/main/l/linux/with kernelmodules. Refer to the release.

Another method is to recompile the kernel. The process is as follows:

(1) apt-Get install linux-source-2.6.38 download kernel source code

(2) go to the source code directory:

CD/usr/src/

Decompress the source package:

Bzip2-D linux-source-2.6.38.tar.bz2

Tar xvf linux-source-2.6.38.tar

(3) go to the source code directory and execute make menuconfig.

/Usr/src/The linux-source-2.6.38/linux-source-2.6.38 # Make menuconfig
Hostcc scripts/kconfig/CONF. o
Hostcc scripts/kconfig/kxgettext. o
* ** Unable to find the ncurses libraries or
* ** Required header files.
* ** 'Make menuconfig' requires the ncurses libraries.
***
* ** Install ncurses (ncurses-devel) and try again.
***
Make [1]: *** [scripts/kconfig/dochecklxdialog] Error 1

This is because the libncurses5-dev package is not installed, run the following command:

Apt-Get install libncurses5-dev

Try make menuconfig again and select the following compilation options (all are selected by default)

Kernel hacking
Kernel debugging
Compile the kernel with debug info

General setup
Kprobes

Run make; Make modules_install; make install

Run CP vmlinux/lib/modules/2.6.38/2.6.38-prep (from the perspective of a tutorial, but it is not necessary to do so)

Restart the system.

(4) install elfutils

Sudo apt-Get install elfutils

(5) run the following command. The correct return value indicates that systemtap is successfully installed.

# STAP-ve 'probe begin {log ("Hello World") Exit ()}'
# STAP-c df-e 'probe syscall. Open {If (target () = PID () log (name. "". argstr )}'

Refer:

Http://blog.chinaunix.net/space.php? Uid = 20589995 & Do = Blog & id = 1621748

Http://linux.chinaunix.net/docs/2006-12-15/3479.shtml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.