Remove "etc."
[lttng-docs.git] / contents / understanding-lttng / plumbing / lttng-sessiond.md
CommitLineData
5e0cbfb0
PP
1---
2id: lttng-sessiond
3---
4
5At the heart of LTTng's plumbing is the _session daemon_, often called
6by its command name, `lttng-sessiond`.
7
8The session daemon is responsible for managing tracing sessions and
9what they logically contain (channel properties, enabled/disabled
ba3b1994
PP
10events, and the rest). By communicating locally with instrumented
11applications (using LTTng-UST) and with the LTTng Linux kernel modules
5e0cbfb0
PP
12(LTTng-modules), it oversees all tracing activities.
13
14One of the many things that `lttng-sessiond` does is to keep
15track of the available event types. User space applications and
16libraries actively connect and register to the session daemon when they
17start. By contrast, `lttng-sessiond` seeks out and loads the appropriate
18LTTng kernel modules as part of its own initialization. Kernel event
19types are _pulled_ by `lttng-sessiond`, whereas user space event types
20are _pushed_ to it by the various user space tracepoint providers.
21
22Using a specific inter-process communication protocol with Linux kernel
23and user space tracers, the session daemon can send channel information
24so that they are initialized, enable/disable specific probes based on
25enabled/disabled events by the user, send event filters information to
26LTTng tracers so that filtering actually happens at the tracer site,
ba3b1994 27start/stop tracing a specific application or the Linux kernel, and more.
5e0cbfb0
PP
28
29The session daemon is not useful without some user controlling it,
30because it's only a sophisticated control interchange and thus
31doesn't make any decision on its own. `lttng-sessiond` opens a local
32socket for controlling it, albeit the preferred way to control it is
33using `liblttng-ctl`, an installed C library hiding the communication
34protocol behind an easy-to-use API. The `lttng` tool makes use of
35`liblttng-ctl` to implement a user-friendly command line interface.
36
37`lttng-sessiond` does not receive any trace data from instrumented
38applications; the _consumer daemons_ are the programs responsible for
39collecting trace data using shared ring buffers. However, the session
40daemon is the one that must spawn a consumer daemon and establish
41a control communication with it.
42
43Session daemons run on a per-user basis. Knowing this, multiple
44instances of `lttng-sessiond` may run simultaneously, each belonging
45to a different user and each operating independently of the others.
46Only `root`'s session daemon, however, may control LTTng kernel modules
4d46e8c0 47(that is, the kernel tracer). With that in mind, if a user has no root
5e0cbfb0
PP
48access on the target system, he cannot trace the system's kernel, but
49should still be able to trace its own instrumented applications.
50
51It has to be noted that, although only `root`'s session daemon may
52control the kernel tracer, the `lttng-sessiond` command has a `--group`
53option which may be used to specify the name of a special user group
54allowed to communicate with `root`'s session daemon and thus record
55kernel traces. By default, this group is named `tracing`.
56
57If not done yet, the `lttng` tool, by default, automatically starts a
58session daemon. `lttng-sessiond` may also be started manually:
59
60<pre class="term">
61lttng-sessiond
62</pre>
63
47bfcb75 64This starts the session daemon in foreground. Use
5e0cbfb0
PP
65
66<pre class="term">
67lttng-sessiond --daemonize
68</pre>
69
70to start it as a true daemon.
71
72To kill the current user's session daemon, `pkill` may be used:
73
74<pre class="term">
75pkill lttng-sessiond
76</pre>
77
47bfcb75 78The default `SIGTERM` signal terminates it cleanly.
5e0cbfb0
PP
79
80Several other options are available and described in
81<a href="/man/8/lttng-sessiond" class="ext"><code>lttng-sessiond</code>'s manpage</a>
82or by running `lttng-sessiond --help`.
This page took 0.025147 seconds and 4 git commands to generate.