LTTng and LTTng project

LTTng and LTTng project:
ref:
      http://en.wikipedia.org/wiki/LTTng
      http://lttng.org/
=================================
1. 是什么
    LTTng (Linux Trace Toolkit Next Generation) is a system software package for tracing the Linux kernel.
   LTTng includes a set of kernel instrumentation points useful for debugging a wide range of bugs, that are
   otherwise extremely challenging. These include, for example, performance problems on parallel systems
   and on real-time systems.

   The LTTng project aims at providing highly efficient tracing tools for Linux.
   Its tracers help tracking down performance issues and debugging problems involving multiple concurrent
    processes and threads. Tracing across multiple systems is also possible.

   Apart from LTTng's kernel tracer and userspace tracer, viewing and analysis tools are part of the project.
  The LTTV viewer permits to analyze and show traces, both in text format and graphically.
2. 基于的原理
  LTTng's performance relies on technology such as Userspace RCU, lockless algorithms, per-cpu data
  structures and cache impact minimization.
3. 安装LTTng and LTTV
     ref: http://lttng.org/tutorial/lttnglttv
   有两种安装方法: PPA(Personal Package Archives),和手动安装。
    3.1 PPA:
    3.2 手动安装
          3.2.1 首先, 确保如下的工具已经安装了
                   wget, bzip2, gzip and tar
          3.2.2 其次,确保如下的包安装了
                  kernel-package quilt
       如果你使用‘make menuconfig'配置内核,那么还要安装 libncurses5-dev, ncurses-dev
       如果你使用'gconfig'配置内核,那么要安装 libgtk2.0-dev libglib2.0-dev libglade2-dev
         3.2.3 为内核打上LTTng补丁并配置内核
下载内核: ftp://mirror.lzu.edu.cn/kernel.org/v2.6
       $wget ftp://mirror.lzu.edu.cn/kernel.org/v2.6/linux-2.6.38.6.tar.bz2
下载LTTng补丁:http://lttng.org/files/lttng/?C=M;O=D,这里你可以看到支持的内核版本以及其补丁。
      $ wget http://lttng.org/files/lttng/patch-2.6.38.6-lttng-0.249.tar.bz2
解压内核:# tar -jxf linux-2.6.38.6.tar.bz2 -C /usr/src
把内核源文件目录改名字为linux和patch-2.6.38.6-lttng-0.249.tar.bz2去掉 patch- 的合成。
 # mv linux-2.6.38.6 linux2.6.38.6-lttng-0.249
 #cd  /usr/src/linux2.6.38.6-lttng-0.249
 #mkdir patches
 # cp -r patch-2.6.38.6-lttng-0.249/* linux2.6.38.6-lttng-0.249/patches/
 # cd /usr/src/linux2.6.38.6-lttng-0.249
 # quilt push -a  // 为内核打补丁
 #cp /boot/你的本机一个配置文件 .config
 或者#make defconfig
 # make menuconfig
   除了你本机的特殊选项外,还要确保如下的选项被合理设置。
    * activate 'prompt for development and/or incomplete code/driver' in general setup
    * activate 'activate makers' in general setup
    * activate Immediate value optimization (optional) // 这一项没有找到?????
# make -j 4
#make modules  -j4

#make modules_install
# make install
# mkinitramfs -o /boot/initrd.img-2.6.38.6 2.6.38.6  //为什么不是下面的形式????
  // $ mkinitramfs -o initrd.img-2.6.xx-lttng-0.x.xx 2.6.xx-lttng-0.x.xx
 // $ sudo cp initrd.img-2.6.xx /boot/initrd.img-2.6.xx-lttng-0.x.xx

下载安装 LTTng 内核模块
#wget http://lttng.org/files/lttng/lttng-modules-0.19.11.tar.bz2
#  cd linux2.6.38.6-lttng-0.249/
# cd /usr/src/linux2.6.38.6-lttng-0.249/modules
解压 lttng-modules-0.19.11.tar.bz2,并把解压后的文件拷贝到 /usr/src/linux2.6.38.6-lttng-0.249/modules .
# make
# make modules_install

下载安装 ltt-control
应该:
#wget http://lttng.org/files/lttng/ltt-control-0.89-05122011.tar.gz
# tar -xf ltt-control-0.89-05122011.tar.gz
NOTE:参看README查看你必须安装的开发库文件。
# aptitude install liblttctl0
#cd ltt-control-0.89-05122011
# ./configure
#make
#make install
#ldconfig

====================
下载安装LTTV (graphical trace viewer)
首先,要安装包libgtk2.0-dev
#apt-get install libgtk2.0-dev
# aptitude install libpopt-dev //我的机器上需要安装
#wget http://lttng.org/files/packages/lttv-0.12.38-21032011.tar.gz
# tar -zxf  lttv-0.12.38-21032011.tar.gz
# cd lttv-0.12.38-21032011
#./configure
#make
#make install
#ldconfig
下面就可以运行 LTTV了
# lttv-gui

你可能感兴趣的:(LTTng and LTTng project)