【LTTng】LTTng通过网络发送Trace数据

将Trace数据通过TCP发送走而不是保存在目标板上。

如果虚拟机作为上位机,需要网卡配置成桥接模式。

在上位机上打开 LTTng relay daemon:

lttng-relayd

在目标板上开启record session 的时候,指定远程url:

lttng create my-session --set-url=net://remote-system

具体的:

Create a network streaming mode recording session:

lttng [GENERAL OPTIONS] create [SESSION] [--shm-path=DIR]

      (--set-url=URL | --ctrl-url=URL --data-url=URL)

URL format

The argument of the --set-url=URL, --ctrl-url=URL, and --data-url=URL options is an URL.

There are two available URL formats.

Local format

file://TRACEDIR

The file:// protocol targets the local file system: you may only use such an URL with the --set-url option when you create the recording session in local or snapshot mode (see the “Recording session modes” section above).

TRACEDIR

Absolute path to the directory containing the trace data on the local file system.

Network format

NETPROTO://(HOST | IPADDR)[:CTRLPORT[:DATAPORT]][/TRACEDIR]

This format is only available when you create the recording session in network streaming, snapshot (--snapshot), or live (--live) mode (see the “Recording session modes” section above).

NETPROTO

Network protocol, amongst:

net

TCP over IPv4.

The default values of CTRLPORT and DATAPORT are respectively 5342 and 5343.

net6

TCP over IPv6.

The default values of CTRLPORT and DATAPORT are respectively 5342 and 5343.

tcp

Same as the net protocol.

You may only use this with the --ctrl-url and --data-url options together.

tcp6

Same as the net6 protocol.

You can only be use this with the --ctrl-url and --data-url options together.

(HOST | IPADDR)

Hostname or IP address.

IPv6 address must be enclosed in square brackets ([ and ]); see RFC 2732.

CTRLPORT

Control TCP port.

DATAPORT

Data TCP port.

TRACEDIR

Path of the directory containing the trace data on the remote file system.

This path is relative to the base output directory of the LTTng relay daemon (see the --output option of lttng-relayd(8)).

EXAMPLES

Example:Create a normal mode recording session with a generated name.

$

lttng create

Example:Create a normal mode recording session with a custom name.

$

lttng create my-session

Example:Create a normal mode recording session with a specific output directory.

See the --output option.

$

lttng create --output=/path/to/traces

Example:Create a network streaming mode recording session.

See the “Output directory” section of lttng-relayd(8) to understand where the relay daemon to connect to (10.0.0.242) writes the received traces.

See the --set-url option.

$

lttng create --set-url=net://10.0.0.242/inv4

Example:Create a snapshot mode recording session with a default snapshot output.

See the --snapshot option.

$

lttng create --snapshot

Example:Create a snapshot mode recording session with a custom snapshot output.

See the --snapshot and --set-url options.

$

lttng create --snapshot \

--set-url=tcp://192.168.1.102:1234:5678/my-snapshots

Example:Create a snapshot mode recording session with no snapshot output.

See the --snapshot and --no-output options.

$

lttng create --snapshot --no-output

Example:Create an LTTng live mode recording session with a default relay daemon URL.

See the --live option.

$

lttng create --live

Example:Create an LTTng live mode recording session with a custom live timer period and relay daemon URL.

See the --live and --set-url options.

$

lttng create --live=250000 \

--set-url=tcp://relayd34:4885:4886

Example:Create a normal mode recording session with a custom directory containing the ring buffer shared memory files.

See the --shm-path option.

$

lttng create my-session --shm-path=/mnt/nvram2/lttng

这里备注一下,如果没进行配置,这里的TRACEDIR实际上是相对于$LTTNG_HOME/lttng-traces内的地址。一般就是在/home/lttng-traces下面了。

Output directory

The relay daemon uses different output path patterns depending on:

  • Its configuration.

    See the “Daemon configuration” section above.

  • The recording session configuration of the connected peer.

  • The LTTng session daemon (see lttng-sessiond(8)) version of the connected peer.

Consider the following variables:

BASE

Base output directory: $LTTNG_HOME/lttng-traces ($LTTNG_HOME defaults to $HOME) or the argument of the --output option.

HOSTNAME

Hostname of the connected peer.

SESSION

Recording session name.

DATETIME

Unique recording session date/time.

TRACEDIR

Custom trace directory path (TRACEDIR part of the argument of the --set-url option of the lttng-create(1) command, if any).

SESSIONDV

The version of the LTTng session daemon of the connected peer.

The relay daemon output path patterns are:

With the --group-output-by-host option (hostname grouping)

Without a custom trace directory

BASE/HOSTNAME/SESSION-DATETIME

With a custom trace directory

BASE/HOSTNAME/TRACEDIR

With the --group-output-by-session option (recording session grouping)

Without a custom trace directory

SESSIONDV is at least 2.4

BASE/SESSION/HOSTNAME-DATETIME

Otherwise

Defaults to the hostname grouping pattern:

BASE/HOSTNAME/SESSION-DATETIME

With a custom trace directory

SESSIONDV is at least 2.4

BASE/SESSION/HOSTNAME-DATETIME/TRACEDIR

Otherwise

Defaults to the hostname grouping pattern:

BASE/HOSTNAME/TRACEDIR

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

小羊苏C

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

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

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

打赏作者

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

抵扣说明:

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

余额充值