Version 2.7.7
[lttng-modules.git] / README.md
CommitLineData
ac2440f2
PP
1LTTng-modules
2=============
3
4_by [Mathieu Desnoyers](mailto:mathieu.desnoyers@efficios.com)_
5
6
7LTTng kernel modules are Linux kernel modules which make
8[LTTng](http://lttng.org/) kernel tracing possible. They include
9essential control modules and many probes which instrument numerous
10interesting parts of Linux. LTTng-modules builds against a vanilla or
11distribution kernel, with no need for additional patches.
12
13Other notable features:
14
15 - Produces [CTF](http://www.efficios.com/ctf)
16 (Common Trace Format) natively.
17 - Tracepoints, function tracer, CPU Performance Monitoring Unit (PMU)
18 counters, kprobes, and kretprobes support.
19 - Have the ability to attach _context_ information to events in the
20 trace (e.g., any PMU counter, PID, PPID, TID, command name, etc).
21 All the extra information fields to be collected with events are
22 optional, specified on a per-tracing-session basis (except for
23 timestamp and event ID, which are mandatory).
24
25
26Building
27--------
28
29To build and install LTTng-modules, you will need to have your kernel
30headers available (or access to your full kernel source tree), and do:
31
32 make
33 sudo make modules_install
34 sudo depmod -a
35
36The above commands will build LTTng-modules against your
37current kernel. If you need to build LTTng-modules against a custom
38kernel, do:
39
40 make KERNELDIR=/path/to/custom/kernel
41 sudo make KERNELDIR=/path/to/custom/kernel modules_install
42 sudo depmod -a kernel_version
43
44
45### Required kernel config options
46
47Make sure your target kernel has the following config options enabled:
48
49 - `CONFIG_MODULES`: loadable module support
50 - `CONFIG_KALLSYMS`: see files in [`wrapper`](wrapper); this is
51 necessary until the few required missing symbols are exported to GPL
52 modules from mainline
53 - `CONFIG_HIGH_RES_TIMERS`: needed for LTTng 2.x clock source
54 - `CONFIG_TRACEPOINTS`: kernel tracepoint instrumentation
55 (enabled as a side-effect of any of the perf/ftrace/blktrace
56 instrumentation features)
57
58
59### Supported (optional) kernel config options
60
61The following kernel configuration options will affect the features
62available from LTTng:
63
64 - `CONFIG_HAVE_SYSCALL_TRACEPOINTS`: system call tracing:
65
66 lttng enable-event -k --syscall
67 lttng enable-event -k -a
68
69 - `CONFIG_PERF_EVENTS`: performance counters:
70
71 lttng add-context -t perf:*
72
73 - `CONFIG_EVENT_TRACING`: needed to allow block layer tracing
74 - `CONFIG_KPROBES`: dynamic probes:
75
76 lttng enable-event -k --probe ...
77
78 - `CONFIG_KRETPROBES`: dynamic function entry/return probes:
79
80 lttng enable-event -k --function ...
81
82 - `CONFIG_KALLSYMS_ALL`: state dump of mapping between block device
83 number and name
84
85
86Using
87-----
88
89Use [LTTng-tools](https://lttng.org/download) to control the tracer.
90The session daemon of LTTng-tools should automatically load the LTTng
91kernel modules when needed. Use [Babeltrace](https://lttng.org/babeltrace)
92to print traces as a human-readable text log.
93
94
95Support
96-------
97
17e9b742
MD
98Linux kernels >= 2.6.36 and < 4.8 are supported by LTTng modules 2.7.
99Upgrade to a newer LTTng modules for more recent kernels.
ac2440f2
PP
100
101
102Notes
103-----
104
105### About perf PMU counters support
106
107Each PMU counter has its zero value set when it is attached to a context with
108add-context. Therefore, it is normal that the same counters attached to both the
109stream context and event context show different values for a given event; what
110matters is that they increment at the same rate.
This page took 0.027098 seconds and 4 git commands to generate.