4 [Last updated: 2012-07-17 by David Goulet]
6 This is a brief howto for network streaming feature of lttng 2.0 toolchain.
8 See the README.adoc file for installation procedure or use the various Linux
13 * The "target" is the traced machine (either UST or/and kernel tracer)
15 * The "remote" is the machine that receives the traces over network
16 streaming transport layer.
20 Here are the basic concepts of the new streaming component. We use two network
21 ports for that called _control_ and _data_ respectively defined by default to
24 The control port is where the commands AND metadata data are sent since this
25 stream is considered to be the reliable and priority transport channel. The
26 data port is the stream which transports the tracing raw data.
28 In order to gather traces from the network, the remote machine MUST have a
29 lttng-relayd running on it bound to network interfaces remotely reachable by the
32 [remote] $ lttng-relayd -d
35 [remote] $ lttng-relayd -vvv
36 (foreground with debug output)
38 [remote] $ lttng-relayd -C tcp://0.0.0.0:1234 -D tcp://0.0.0.0:5678
39 (control port set to TCP/1234 and data port to TCP/5678 on all IP addresses)
41 For now, only TCP is supported on IPv4/IPv6.
43 Once done, the following examples shows you how to start streaming from the
44 target machine to the remote host where we just started a lttng relay.
49 Simple and quick network streaming.
51 1) Create a recording session that will be streamed over the network for the
52 specified domain. This session will contain, in our example, syscall events.
54 # lttng create syscall-session
56 2) Enable the consumer to send data over the network for the kernel domain.
58 # lttng enable-consumer --kernel net://<remote_addr>
60 You can also skip this step and directly use the lttng create command like so:
62 # lttng create -U net://<remote_addr> syscall-session
64 3) Set and start the tracing. Nothing new here.
66 # lttng enable-event -a --syscall -k
71 By default on the relay side, the trace will be written to the lttng-traces/
72 directory of the relayd user in:
74 hostname/session-name/kernel/*
76 The -o option of lttng-relayd allows the user to override the default output
79 Just run babeltrace or lttng view -t PATH with the previous path.
84 This example uses all possible options to fine grained control the streaming.
86 1) Again, create a recording session that will be streamed over the network for
89 # lttng create syscall-session
91 2) Set relayd URIs for the recording session and kernel domain.
93 ONLY set the remote relayd URIs (both control and data at the same destination
94 and using default ports) on the consumer but does not enable the consumer to use
95 network streaming yet.
97 # lttng enable-consumer -k -U net://<remote_addr>
99 You can also set both control and data URIs using -C and -D respectively for
102 # lttng enable-consumer -k -C tcp://<remote_addr> -D tcp://<remote_addr>
104 3) Enable the consumer previously setup with the relayd URIs.
106 This enables the previous network destination. From this point on, the consumer
107 is ready to stream once tracing is started.
109 # lttng enable-consumer -k --enable
111 4) Set and start the tracing. Nothing new here.
113 # lttng enable-event -a --syscall -k
115 (wait and get coffee)
118 Again, run babeltrace as mentioned in the previous example on the relayd side.
120 For more information, please read the --help options of each command or the man
121 pages lttng(1) and the lttng-relayd(8)