Commit | Line | Data |
---|---|---|
5e0cbfb0 PP |
1 | --- |
2 | id: proc-lttng-logger-abi | |
86384750 | 3 | since: 2.5 |
5e0cbfb0 PP |
4 | --- |
5 | ||
6 | The `lttng-tracer` Linux kernel module, installed by the LTTng-modules | |
7 | package, creates a special LTTng logger ABI file `/proc/lttng-logger` | |
8 | when loaded. Writing text data to this file generates an LTTng kernel | |
9 | domain event named `lttng_logger`. | |
10 | ||
11 | Unlike other kernel domain events, `lttng_logger` may be enabled by | |
12 | any user, not only root users or members of the tracing group. | |
13 | ||
14 | To use the LTTng logger ABI, simply write a string to | |
15 | `/proc/lttng-logger`: | |
16 | ||
17 | <pre class="term"> | |
18 | echo -n 'Hello, World!' > /proc/lttng-logger | |
19 | </pre> | |
20 | ||
21 | The `msg` field of the `lttng_logger` event contains the recorded | |
22 | message. | |
23 | ||
24 | <div class="tip"> | |
25 | <p> | |
26 | <span class="t">Note:</span>Messages are split in chunks of | |
27 | 1024 bytes. | |
28 | </p> | |
29 | </div> | |
30 | ||
31 | The LTTng logger ABI is a quick and easy way to trace some events from | |
32 | user space through the kernel tracer. However, it is much more basic | |
33 | than LTTng-UST: it's slower (involves system call round-trip to the | |
34 | kernel and only supports logging strings). The LTTng logger ABI is | |
35 | particularly useful for recording logs as LTTng traces from shell | |
36 | scripts, potentially combining them with other Linux kernel/user space | |
37 | events. |