Fix: scsi: sd: Atomic write support added in 6.11-rc1
[lttng-modules.git] / README.md
... / ...
CommitLineData
1<!--
2SPDX-FileCopyrightText: 2011-2024 EfficiOS Inc.
3
4SPDX-License-Identifier: CC-BY-SA-4.0
5-->
6
7LTTng-modules
8=============
9
10_by [Mathieu Desnoyers](mailto:mathieu.desnoyers@efficios.com)_
11
12
13LTTng kernel modules are Linux kernel modules which make
14[LTTng](http://lttng.org/) kernel tracing possible. They include
15essential control modules and many probes which instrument numerous
16interesting parts of Linux. LTTng-modules builds against a vanilla or
17distribution kernel, with no need for additional patches.
18
19Other notable features:
20
21 - Produces [CTF](http://www.efficios.com/ctf)
22 (Common Trace Format) natively,
23 - Tracepoints, function tracer, CPU Performance Monitoring Unit (PMU)
24 counters, kprobes, and kretprobes support,
25 - Have the ability to attach _context_ information to events in the
26 trace (e.g., any PMU counter, PID, PPID, TID, command name, etc).
27 All the extra information fields to be collected with events are
28 optional, specified on a per-tracing-session basis (except for
29 timestamp and event ID, which are mandatory).
30
31
32Building
33--------
34
35To build and install LTTng-modules, you will need to have your kernel
36headers available (or access to your full kernel source tree), and do:
37
38 make
39 sudo make modules_install
40 sudo depmod -a
41
42The above commands will build LTTng-modules against your
43current kernel. If you need to build LTTng-modules against a custom
44kernel, do:
45
46 make KERNELDIR=/path/to/custom/kernel
47 sudo make KERNELDIR=/path/to/custom/kernel modules_install
48 sudo depmod -a kernel_version
49
50
51### Kernel built-in support
52
53It is also possible to build these modules as part of a kernel image. Simply
54run the [`scripts/built-in.sh`](scripts/built-in.sh) script with the path to
55your kernel source directory as an argument. It will symlink the
56lttng-modules directory in the kernel sources and add an include in the kernel
57Makefile.
58
59Then configure your kernel as usual and enable the `CONFIG_LTTNG` option.
60
61
62### Required kernel config options
63
64Make sure your target kernel has the following config options enabled:
65
66 - `CONFIG_MODULES`: loadable module support (not strictly required
67 when built into the kernel),
68 - `CONFIG_KALLSYMS`: see files in [`wrapper`](wrapper); this is
69 necessary until the few required missing symbols are exported to GPL
70 modules from mainline,
71 - `CONFIG_HIGH_RES_TIMERS`: needed for LTTng 2.x clock source,
72 - `CONFIG_TRACEPOINTS`: kernel tracepoint instrumentation
73 (enabled as a side-effect of any of the perf/ftrace/blktrace
74 instrumentation features).
75 - `CONFIG_KPROBES` (5.7+): use kallsyms for kernel 5.7 and newer.
76
77
78### Supported (optional) kernel config options
79
80The following kernel configuration options will affect the features
81available from LTTng:
82
83 - `CONFIG_HAVE_SYSCALL_TRACEPOINTS`: system call tracing:
84
85 lttng enable-event -k --syscall
86 lttng enable-event -k -a
87
88 - `CONFIG_PERF_EVENTS`: performance counters:
89
90 lttng add-context -t perf:*
91
92 - `CONFIG_EVENT_TRACING`: needed to allow block layer tracing
93 - `CONFIG_KPROBES`: dynamic probes:
94
95 lttng enable-event -k --probe ...
96
97 - `CONFIG_KRETPROBES`: dynamic function entry/return probes:
98
99 lttng enable-event -k --function ...
100
101 - `CONFIG_KALLSYMS_ALL`: state dump of mapping between block device
102 number and name
103
104### LTTng specific kernel config options
105
106The following kernel configuration options are provided by LTTng:
107
108 - `CONFIG_LTTNG`: Build LTTng (Defaults to 'm').
109 - `CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM`: Enable the experimental bitwise
110 enumerations (Defaults to 'n'). This can be enabled by building with:
111
112 make CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM=y
113
114 - `CONFIG_LTTNG_CLOCK_PLUGIN_TEST`: Build the test clock plugin (Defaults to
115 'm'). This plugin overrides the trace clock and should always be built as a
116 module for testing.
117
118
119Customization/Extension
120-----------------------
121
122The lttng-modules source includes definitions for the actual callback
123functions that will be attached to the kernel tracepoints by lttng.
124The lttng-modules project implements its own macros generating these
125callbacks: the LTTNG_TRACEPOINT_EVENT macro family found in
126instrumentation/events/lttng-module/. In order to show up in a
127lttng-modules trace, a kernel tracepoint must be defined within the
128kernel tree, and also defined within lttng-modules with the
129LTTNG_TRACEPOINT_EVENT macro family. Customizations or extensions must
130be done by modifying instances of these macros within the lttng-modules
131source.
132
133Usage
134-----
135
136Use [LTTng-tools](https://lttng.org/download) to control the tracer.
137The session daemon of LTTng-tools should automatically load the LTTng
138kernel modules when needed. Use [Babeltrace](https://lttng.org/babeltrace)
139to print traces as a human-readable text log.
140
141
142Support
143-------
144
145Linux kernels >= 4.4 are supported.
146
147
148Notes
149-----
150
151### About perf PMU counters support
152
153Each PMU counter has its zero value set when it is attached to a context with
154add-context. Therefore, it is normal that the same counters attached to both the
155stream context and event context show different values for a given event; what
156matters is that they increment at the same rate.
157
158
159Supported versions
160------------------
161
162The LTTng project supports the last two released stable versions
163(e.g. stable-2.13 and stable-2.12).
164
165Fixes are backported from the master branch to the last stable version
166unless those fixes would break the ABI or API. Those fixes may be backported
167to the second-last stable version, depending on complexity and ABI/API
168compatibility.
169
170Security fixes are backported from the master branch to both of the last stable
171version and the the second-last stable version.
172
173New kernel version enablement commits are integrated into the master branch and
174backported to the last stable version.
175
176New features are integrated into the master branch and not backported to the
177last stable branch.
178
179Contacts
180--------
181
182You can contact the maintainers on the following mailing list:
183`lttng-dev@lists.lttng.org`.
184
185IRC channel: [#lttng](irc://irc.oftc.net/lttng) on the OFTC network
186
187Bug tracker: [LTTng-modules bug tracker](https://bugs.lttng.org/projects/lttng-modules)
188
189Code review: [_lttng-modules_ project](https://review.lttng.org/q/project:lttng-modules) on LTTng Review
190
191Continuous integration: [LTTng-modules](https://ci.lttng.org/view/LTTng-modules/) on LTTng's CI
192
193GitHub mirror: [lttng/lttng-modules](https://github.com/lttng/lttng-modules)
194
195Patches are principally submitted and reviewed on [LTTng Review](https://review.lttng.org),
196but may also be submitted to the [mailing list](mailto:lttng-dev@lists.lttng.org)
197with the subject prefix `PATCH lttng-modules` or by pull request on the
198[GitHub mirror](https://github.com/lttng/lttng-modules).
This page took 0.024352 seconds and 5 git commands to generate.