0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Linux用 動的トレーサ " ply"の環境構築

Last updated at Posted at 2023-08-26

plyとは

eBPFをスクリプト形式で扱えるものになります。
軽量なツールのため、組み込みデバイスで活躍しそうです。

現在の環境

uname -a
Linux hoge 5.4.0-156-generic #173-Ubuntu SMP Tue Jul 11 07:25:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"

環境構築

$ sudo apt update
$ sudo apt-get install autoconf
$ sudo apt-get  install libtool

$ git clone https://github.com/iovisor/ply.git

$ cd ply 

$ ./autogen.sh   
$ ./configure
$ make
$ sudo make install

実行確認

$ ply
error: no input
ply - Dynamic tracing utility

Usage:
  ply [options] <ply-text>
  ply [options] <ply-file>

Options:
  -c COMMAND     Run COMMAND in a shell, exit upon completion.
  -d             Enable debug output.
  -e             Exit after compiling.
  -h             Print usage message and exit.
  -k             Keep going in face of trace buffer overruns.
  -S             Show generated BPF.
  -T             Run self-test.
  -v             Print version information.

エラーが出た場合

$ ply
ply: error while loading shared libraries: libply.so.0: cannot open shared object file: No such file or directory

もしこのようなエラーが出た場合、パスを指定すると実行できます。

$ sudo su
# find / -name libply.so.0

/root/ply/src/libply/.libs/libply.so.0
/usr/local/lib/libply.so.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

# find / -name libply.so.0
/home/hoge/ply/src/libply/.libs/libply.so.0
/root/ply/src/libply/.libs/libply.so.0
/usr/local/lib/libply.so.0

最後に

日本語のドキュメントがなかったので、簡単なエラーの対処法とともに、備忘録として載せておきます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?