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