[LTTng学习之旅]------环境搭建

25 篇文章 6 订阅

目录

安装

Build from sourcehttps://lttng.org/docs/v2.13/#doc-building-from-source

libuuid

Popt

libxml2

总结

安装LTTng自己的包


安装

LTTng有 三个包:

LTTng-tools

Libraries and command-line interface to control tracing.

LTTng-modules

Linux kernel modules to instrument and trace the kernel.

LTTng-UST

Libraries and Java/Python packages to instrument and trace user applications.

不需要全装。后面两个看追踪内核还是APP来装就可以。

大多数发行版可能包含LTTng的包,嵌入式设备当然没有那么幸运。我觉得必然是下载源码交叉编译这条路了。

Build from source

To build and install LTTng 2.13 from source:

  1. Using the package manager of your distribution, or from source, install the following dependencies of LTTng-tools and LTTng-UST:

现在就是一个个手动下载源码编译。嗯。。然后试一试。

libuuid

libuuid download | SourceForge.nethttps://sourceforge.net/projects/libuuid/下载/libuuid-1.0.3.tar.gz

执行: ./configure 检查很多环境 然后生成Makefile

执行:make

执行:sudo make install

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

Popt

rpm package manager (rpm5.org)http://rpm5.org/files/popt/

我发现好像在github上有库。。

http://ftp.rpm.org/popt/

Userspace RCU

Userspace RCU (liburcu.org)https://liburcu.org/

git clone git://git.liburcu.org/userspace-rcu.git

Userspace RCU Implementation

by Mathieu Desnoyers and Paul E. McKenney

Building

./bootstrap # skip if using tarball
./configure
make
make install
ldconfig

Hints:

  • Forcing 32-bit build:

    CFLAGS="-m32 -g -O2" ./configure
    
  • Forcing 64-bit build:

    CFLAGS="-m64 -g -O2" ./configure
    
  • Forcing a 32-bit build with 386 backward compatibility:

    CFLAGS="-m32 -g -O2" ./configure --host=i386-pc-linux-gnu
    
  • Forcing a 32-bit build for Sparcv9 (typical for Sparc v9)

    CFLAGS="-m32 -Wa,-Av9a -g -O2" ./configure

libxml2

GNOME / libxml2 · GitLabhttps://gitlab.gnome.org/GNOME/libxml2建议还是下载tarball。使用之前的脚本生成configure真的可能遇到各种依赖问题。

编译源码还是能跳一步是一步。。。

Releases · GNOME / libxml2 · GitLabhttps://gitlab.gnome.org/GNOME/libxml2/-/releases

Build instructions

libxml2 can be built with GNU Autotools, CMake, or several other build systems in platform-specific subdirectories.

Autotools (for POSIX systems like Linux, BSD, macOS)

If you build from a Git tree, you have to install Autotools and start by generating the configuration files with:

./autogen.sh

If you build from a source tarball, extract the archive with:

tar xf libxml2-xxx.tar.gz
cd libxml2-xxx

To see a list of build options:

./configure --help

Also see the INSTALL file for additional instructions. Then you can configure and build the library:

./configure [possible options]
make

Note that by default, no optimization options are used. You have to enable them manually, for example with:

CFLAGS='-O2 -fno-semantic-interposition' ./configure

Now you can run the test suite with:

make check

Please report test failures to the mailing list or bug tracker.

Then you can install the library:

make install

At that point you may have to rerun ldconfig or a similar utility to update your list of installed shared libs.

总结

从源代码安装的步骤:

1、下载tarball。不要从Git拉库,还不如下载tarball。git 拉取一般都不带configure程序。要运行sh文件来生成。这一步容易报错。

2、运行./configure 这个一部会检查环境和生成makefile

3、make

4、make check 如果有的话

5、sudo make install。

在编译中遇到一个找不到Python.h的问题。apt install python-dev解决。不知道到了嵌入式环境怎么搞。。我为什么要自己干这个啊??包给供应商算了。。

安装LTTng自己的包

cd $(mktemp -d) &&
wget https://lttng.org/files/lttng-modules/lttng-modules-latest-2.13.tar.bz2 &&
tar -xf lttng-modules-latest-2.13.tar.bz2 &&
cd lttng-modules-2.13.* &&
make &&
sudo make modules_install &&
sudo depmod -a
cd $(mktemp -d) &&
wget https://lttng.org/files/lttng-ust/lttng-ust-latest-2.13.tar.bz2 &&
tar -xf lttng-ust-latest-2.13.tar.bz2 &&
cd lttng-ust-2.13.* &&
./configure &&
make &&
sudo make install &&
sudo ldconfig
cd $(mktemp -d) &&
wget https://lttng.org/files/lttng-tools/lttng-tools-latest-2.13.tar.bz2 &&
tar -xf lttng-tools-latest-2.13.tar.bz2 &&
cd lttng-tools-2.13.* &&
./configure &&
make &&
sudo make install &&
sudo ldconfig

我是用浏览器把包下载之后解压弄的。因为糟糕的网络环境。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小羊苏C

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值