Linux Trace Toolkit next generation is a system software package for correlated tracing of the Linux kernel, applications and libraries (Wikipedia).

LTTng installation on CentOS 7.2

Which package contains “wget” ?

Last login: Thu Mar  3 18:50:40 2016
[root@lttng ~]# yum provides wget
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.quelquesmots.fr
 * extras: centos.mirrors.ovh.net
 * updates: mirror.ibcp.fr
wget-1.14-10.el7_0.1.x86_64 : A utility for retrieving files using the HTTP or FTP protocols
Repo        : base

Install “wget” package :

[root@lttng ~]# yum -y install wget

download LTTng repository definition :

[root@lttng ~]# wget -P /etc/yum.repos.d/ https://packages.efficios.com/repo.files/EfficiOS-RHEL7-x86-64.repo
--2016-03-03 18:57:40--  https://packages.efficios.com/repo.files/EfficiOS-RHEL7-x86-64.repo
Resolving packages.efficios.com (packages.efficios.com)... 52.85.59.254, 52.85.59.203, 52.85.59.21, ...
Connecting to packages.efficios.com (packages.efficios.com)|52.85.59.254|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 208 [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/EfficiOS-RHEL7-x86-64.repo’

100%[=======================================================================================================================================>] 208         --.-K/s   in 0s

2016-03-03 18:57:41 (19.7 MB/s) - ‘/etc/yum.repos.d/EfficiOS-RHEL7-x86-64.repo’ saved [208/208]

Download package signature key :

[root@lttng ~]# rpmkeys --import https://packages.efficios.com/rhel/repo.key

Update “yum” database :

[root@lttng ~]# yum updateinfo
Loaded plugins: fastestmirror
EfficiOS-RHEL7-x86-64                                                                                                                                     |  951 B  00:00:00
EfficiOS-RHEL7-x86-64/primary                                                                                                                             | 7.5 kB  00:00:00
updateinfo summary done

Now, It’s time to install LTTng :

[root@lttng ~]# yum -y install lttng-ust lttng-ust-java lttng-ust-devel lttng-ust-debuginfo kmod-lttng-modules lttng-modules-debuginfo lttng-tools lttng-tools-devel

LTTng is now installed :

[root@lttng ~]# lttng -V
lttng (LTTng Trace Control) 2.7.1 - Herbe à Détourne

Your first trace

We will catch kernel events.

Create a session

[root@lttng ~]# lttng create
Spawning a session daemon
Session auto-20160303-191623 created.
Traces will be written in /root/lttng-traces/auto-20160303-191623

Enable kernel trace :

[root@lttng ~]# lttng enable-event --kernel --all
All Kernel events are enabled in channel channel0

Start the trace :

[root@lttng ~]# lttng start
Tracing started for session auto-20160303-191623

Stop the trace few seconds after :

[root@lttng ~]# lttng stop
Waiting for data availability.
Tracing stopped for session auto-20160303-191623

We got those files :

[root@lttng ~]# tree lttng-traces
lttng-traces
└── auto-20160303-191623
    └── kernel
        ├── channel0_0
        ├── channel0_1
        ├── index
        │   ├── channel0_0.idx
        │   └── channel0_1.idx
        └── metadata

Install Babeltrace to convert those files :

[root@lttng ~]# yum -y install babeltrace

Example to see memory allocations :

[root@lttng ~]# babeltrace lttng-traces/auto-20160303-191623 | grep " kmem_" | more
[19:22:54.080539418] (+?.?????????) lttng kmem_kmalloc: { cpu_id = 0 }, { call_site = 0xFFFFFFFFA042F267, ptr = 0xFFFF88007A53AC00, bytes_req = 708, bytes_alloc = 1024, gfp_flags = 208 }
[19:22:54.080550127] (+0.000010709) lttng kmem_kfree: { cpu_id = 0 }, { call_site = 0xFFFFFFFFA042F33A, ptr = 0xFFFF88007A53AC00 }
[19:22:54.080570545] (+0.000005869) lttng kmem_kmalloc: { cpu_id = 0 }, { call_site = 0xFFFFFFFFA042F267, ptr = 0xFFFF88007A46A400, bytes_req = 271, bytes_alloc = 512, gfp_flags = 208 }
[19:22:54.080575075] (+0.000004530) lttng kmem_kfree: { cpu_id = 0 }, { call_site = 0xFFFFFFFFA042F33A, ptr = 0xFFFF88007A46A400 }
...

 

en.pdf24.org    Send article as PDF   

Leave a Reply

Your email address will not be published. Required fields are marked *


*