Commit | Line | Data |
---|---|---|
9f36eaed MJ |
1 | # SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) |
2 | ||
b933d85e | 3 | TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/.. |
72e6c528 | 4 | |
751494f9 | 5 | include $(TOP_LTTNG_MODULES_DIR)/Kbuild.common |
72e6c528 | 6 | |
b933d85e | 7 | ccflags-y += -I$(TOP_LTTNG_MODULES_DIR) |
6d61b34d | 8 | |
6ccec973 MJ |
9 | obj-$(CONFIG_LTTNG) += lttng-probe-sched.o |
10 | obj-$(CONFIG_LTTNG) += lttng-probe-irq.o | |
11 | obj-$(CONFIG_LTTNG) += lttng-probe-timer.o | |
12 | obj-$(CONFIG_LTTNG) += lttng-probe-kmem.o | |
13 | obj-$(CONFIG_LTTNG) += lttng-probe-module.o | |
14 | obj-$(CONFIG_LTTNG) += lttng-probe-power.o | |
6ccec973 | 15 | obj-$(CONFIG_LTTNG) += lttng-probe-statedump.o |
c337ddc2 | 16 | |
3568fb65 MJ |
17 | ifneq ($(CONFIG_NET_9P),) |
18 | obj-$(CONFIG_LTTNG) += $(shell \ | |
19 | if [ $(VERSION) -ge 4 \ | |
20 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 10 \) ] ; then \ | |
21 | echo "lttng-probe-9p.o" ; fi;) | |
22 | endif # CONFIG_NET_9P | |
23 | ||
a918229e MD |
24 | i2c_dep = $(srctree)/include/trace/events/i2c.h |
25 | ifneq ($(wildcard $(i2c_dep)),) | |
26 | obj-$(CONFIG_LTTNG) += lttng-probe-i2c.o | |
27 | endif | |
28 | ||
056f5922 | 29 | ifneq ($(CONFIG_KVM),) |
808dd6df MJ |
30 | obj-$(CONFIG_LTTNG) += lttng-probe-kvm.o |
31 | ifneq ($(CONFIG_X86),) | |
32 | kvm_dep_lapic = $(srctree)/arch/x86/kvm/lapic.h | |
33 | ifneq ($(wildcard $(kvm_dep_lapic)),) | |
34 | kvm_dep = $(srctree)/virt/kvm/iodev.h $(srctree)/include/kvm/iodev.h | |
35 | ifneq ($(wildcard $(kvm_dep)),) | |
36 | CFLAGS_lttng-probe-kvm-x86.o += -I$(srctree)/virt/kvm | |
37 | CFLAGS_lttng-probe-kvm-x86-mmu.o += -I$(srctree)/virt/kvm | |
12ce29c7 MJ |
38 | obj-$(CONFIG_LTTNG) += lttng-probe-kvm-x86.o |
39 | obj-$(CONFIG_LTTNG) += lttng-probe-kvm-x86-mmu.o | |
808dd6df MJ |
40 | else |
41 | $(warning File $(kvm_dep) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.) | |
42 | endif # $(wildcard $(kvm_dep)) | |
43 | else | |
44 | $(warning File $(kvm_dep_lapic) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.) | |
45 | endif # $(wildcard $(kvm_dep_lapic)) | |
46 | endif # CONFIG_X86 | |
47 | endif # CONFIG_KVM | |
056f5922 | 48 | |
d2507215 | 49 | ifneq ($(CONFIG_X86),) |
808dd6df | 50 | x86_irq_vectors_dep = $(srctree)/arch/x86/include/asm/trace/irq_vectors.h |
da0f6c58 | 51 | |
808dd6df MJ |
52 | ifneq ($(wildcard $(x86_irq_vectors_dep)),) |
53 | obj-$(CONFIG_LTTNG) += lttng-probe-x86-irq-vectors.o | |
54 | endif # $(wildcard $(x86_irq_vectors_dep)) | |
da0f6c58 | 55 | |
808dd6df | 56 | x86_exceptions_dep = $(srctree)/arch/x86/include/asm/trace/exceptions.h |
da0f6c58 | 57 | |
808dd6df MJ |
58 | ifneq ($(wildcard $(x86_exceptions_dep)),) |
59 | obj-$(CONFIG_LTTNG) += lttng-probe-x86-exceptions.o | |
60 | endif # $(wildcard $(x86_exceptions_dep)) | |
61 | endif # CONFIG_X86 | |
d2507215 | 62 | |
12ce29c7 | 63 | obj-$(CONFIG_LTTNG) += lttng-probe-signal.o |
3a523f5b | 64 | |
c9604bd3 | 65 | ifneq ($(CONFIG_BLOCK),) |
808dd6df MJ |
66 | # need blk_cmd_buf_len |
67 | ifneq ($(CONFIG_EVENT_TRACING),) | |
68 | obj-$(CONFIG_LTTNG) += lttng-probe-block.o | |
69 | endif # CONFIG_EVENT_TRACING | |
70 | endif # CONFIG_BLOCK | |
c9604bd3 | 71 | |
b283666f | 72 | ifneq ($(CONFIG_NET),) |
808dd6df MJ |
73 | obj-$(CONFIG_LTTNG) += lttng-probe-napi.o |
74 | obj-$(CONFIG_LTTNG) += lttng-probe-skb.o | |
12ce29c7 | 75 | obj-$(CONFIG_LTTNG) += lttng-probe-net.o |
808dd6df MJ |
76 | obj-$(CONFIG_LTTNG) += $(shell \ |
77 | if [ $(VERSION) -ge 4 \ | |
78 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \ | |
79 | echo "lttng-probe-sock.o" ; fi;) | |
80 | obj-$(CONFIG_LTTNG) += $(shell \ | |
81 | if [ $(VERSION) -ge 4 \ | |
82 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \ | |
83 | echo "lttng-probe-udp.o" ; fi;) | |
84 | endif # CONFIG_NET | |
b283666f PW |
85 | |
86 | ifneq ($(CONFIG_SND_SOC),) | |
12ce29c7 | 87 | obj-$(CONFIG_LTTNG) += lttng-probe-asoc.o |
808dd6df | 88 | endif # CONFIG_SND_SOC |
b283666f PW |
89 | |
90 | ifneq ($(CONFIG_EXT3_FS),) | |
808dd6df MJ |
91 | ext3_dep = $(srctree)/fs/ext3/*.h |
92 | ext3_dep_check = $(wildcard $(ext3_dep)) | |
93 | ext3 = $(shell \ | |
bde63753 MJ |
94 | if [ $(VERSION) -lt 4 -o \( $(VERSION) -eq 4 -a $(PATCHLEVEL) -lt 3 \) ] ; then \ |
95 | if [ $(VERSION) -ge 4 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \ | |
96 | if [ \( $(VERSION) -ge 4 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) \) -a \ | |
97 | -z "$(ext3_dep_check)" ] ; then \ | |
98 | echo "warn" ; \ | |
99 | exit ; \ | |
100 | fi; \ | |
101 | echo "lttng-probe-ext3.o" ; \ | |
808dd6df | 102 | fi; \ |
808dd6df MJ |
103 | fi;) |
104 | ifeq ($(ext3),warn) | |
105 | $(warning Files $(ext3_dep) not found. Probe "ext3" is disabled. Use full kernel source tree to enable it.) | |
106 | ext3 = | |
107 | endif # $(ext3),warn | |
108 | obj-$(CONFIG_LTTNG) += $(ext3) | |
109 | endif # CONFIG_EXT3_FS | |
b283666f PW |
110 | |
111 | ifneq ($(CONFIG_GPIOLIB),) | |
808dd6df MJ |
112 | obj-$(CONFIG_LTTNG) += $(shell \ |
113 | if [ $(VERSION) -ge 3 ] ; then \ | |
114 | echo "lttng-probe-gpio.o" ; fi;) | |
115 | endif # CONFIG_GPIOLIB | |
b283666f PW |
116 | |
117 | ifneq ($(CONFIG_JBD2),) | |
808dd6df MJ |
118 | obj-$(CONFIG_LTTNG) += lttng-probe-jbd2.o |
119 | endif # CONFIG_JBD2 | |
b283666f PW |
120 | |
121 | ifneq ($(CONFIG_JBD),) | |
808dd6df MJ |
122 | obj-$(CONFIG_LTTNG) += $(shell \ |
123 | if [ $(VERSION) -ge 4 \ | |
124 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \ | |
125 | echo "lttng-probe-jbd.o" ; fi;) | |
126 | endif # CONFIG_JBD | |
b283666f PW |
127 | |
128 | ifneq ($(CONFIG_REGULATOR),) | |
12ce29c7 | 129 | obj-$(CONFIG_LTTNG) += lttng-probe-regulator.o |
808dd6df | 130 | endif # CONFIG_REGULATOR |
b283666f PW |
131 | |
132 | ifneq ($(CONFIG_SCSI),) | |
12ce29c7 | 133 | obj-$(CONFIG_LTTNG) += lttng-probe-scsi.o |
808dd6df | 134 | endif # CONFIG_SCSI |
b283666f | 135 | |
12ce29c7 | 136 | obj-$(CONFIG_LTTNG) += lttng-probe-vmscan.o |
808dd6df | 137 | |
7c68b363 AG |
138 | # lock probe does not work, so disabling it for now |
139 | #ifneq ($(CONFIG_LOCKDEP),) | |
808dd6df MJ |
140 | # obj-$(CONFIG_LTTNG) += lttng-probe-lock.o |
141 | #endif # CONFIG_LOCKDEP | |
7c68b363 | 142 | |
b87700e3 | 143 | ifneq ($(CONFIG_BTRFS_FS),) |
808dd6df | 144 | btrfs_dep = $(srctree)/fs/btrfs/*.h |
12ce29c7 MJ |
145 | ifneq ($(wildcard $(btrfs_dep)),) |
146 | obj-$(CONFIG_LTTNG) += lttng-probe-btrfs.o | |
147 | else | |
148 | $(warning Files $(btrfs_dep) not found. Probe "btrfs" is disabled. Use full kernel source tree to enable it.) | |
149 | endif # $(wildcard $(btrfs_dep)) | |
808dd6df | 150 | endif # CONFIG_BTRFS_FS |
b87700e3 | 151 | |
12ce29c7 | 152 | obj-$(CONFIG_LTTNG) += lttng-probe-compaction.o |
b87700e3 AG |
153 | |
154 | ifneq ($(CONFIG_EXT4_FS),) | |
808dd6df | 155 | ext4_dep = $(srctree)/fs/ext4/*.h |
12ce29c7 MJ |
156 | ifneq ($(wildcard $(ext4_dep)),) |
157 | obj-$(CONFIG_LTTNG) += lttng-probe-ext4.o | |
158 | else | |
808dd6df | 159 | $(warning Files $(ext4_dep) not found. Probe "ext4" is disabled. Use full kernel source tree to enable it.) |
808dd6df | 160 | endif # $(wildcard $(ext4_dep)) |
808dd6df | 161 | endif # CONFIG_EXT4_FS |
b87700e3 | 162 | |
6ccec973 | 163 | obj-$(CONFIG_LTTNG) += $(shell \ |
808dd6df MJ |
164 | if [ $(VERSION) -ge 4 \ |
165 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) ] ; then \ | |
166 | echo "lttng-probe-printk.o" ; fi;) | |
167 | ||
b87700e3 | 168 | ifneq ($(CONFIG_FRAME_WARN),0) |
808dd6df | 169 | CFLAGS_lttng-probe-printk.o += -Wframe-larger-than=2200 |
b87700e3 AG |
170 | endif |
171 | ||
6ccec973 | 172 | obj-$(CONFIG_LTTNG) += $(shell \ |
808dd6df MJ |
173 | if [ $(VERSION) -ge 4 \ |
174 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 6 \) \ | |
175 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 5 -a $(SUBLEVEL) -ge 2 \) \ | |
176 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 4 -a $(SUBLEVEL) -ge 9 \) \ | |
177 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 0 -a $(SUBLEVEL) -ge 41 \) ] ; then \ | |
178 | echo "lttng-probe-random.o" ; fi;) | |
b87700e3 | 179 | |
6ccec973 | 180 | obj-$(CONFIG_LTTNG) += $(shell \ |
808dd6df MJ |
181 | if [ $(VERSION) -ge 4 \ |
182 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \ | |
183 | echo "lttng-probe-rcu.o" ; fi;) | |
b87700e3 AG |
184 | |
185 | ifneq ($(CONFIG_REGMAP),) | |
808dd6df MJ |
186 | regmap_dep_4_1 = $(srctree)/drivers/base/regmap/trace.h |
187 | ifneq ($(wildcard $(regmap_dep_4_1)),) | |
188 | obj-$(CONFIG_LTTNG) += lttng-probe-regmap.o | |
189 | else | |
190 | $(warning File $(regmap_dep_4_1) not found. Probe "regmap" is disabled. Need Linux 4.1+ kernel source tree to enable it.) | |
191 | endif # $(wildcard $(regmap_dep_4_1)), | |
192 | endif # CONFIG_REGMAP | |
b87700e3 AG |
193 | |
194 | ifneq ($(CONFIG_PM_RUNTIME),) | |
808dd6df MJ |
195 | obj-$(CONFIG_LTTNG) += $(shell \ |
196 | if [ $(VERSION) -ge 4 \ | |
197 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \ | |
198 | echo "lttng-probe-rpm.o" ; fi;) | |
199 | endif # CONFIG_PM_RUNTIME | |
b87700e3 AG |
200 | |
201 | ifneq ($(CONFIG_SUNRPC),) | |
808dd6df MJ |
202 | obj-$(CONFIG_LTTNG) += $(shell \ |
203 | if [ $(VERSION) -ge 4 \ | |
204 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) ] ; then \ | |
205 | echo "lttng-probe-sunrpc.o" ; fi;) | |
206 | endif # CONFIG_SUNRPC | |
b87700e3 | 207 | |
e09a6084 | 208 | ifneq ($(CONFIG_VIDEO_V4L2),) |
808dd6df MJ |
209 | obj-$(CONFIG_LTTNG) += $(shell \ |
210 | if [ $(VERSION) -ge 4 \ | |
211 | -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 14 \) ] ; then \ | |
212 | echo "lttng-probe-v4l2.o" ; fi;) | |
213 | endif # CONFIG_VIDEO_V4L2 | |
e09a6084 | 214 | |
6ccec973 | 215 | obj-$(CONFIG_LTTNG) += lttng-probe-workqueue.o |
b87700e3 | 216 | |
42d9070d | 217 | ifneq ($(CONFIG_KALLSYMS_ALL),) |
12ce29c7 | 218 | obj-$(CONFIG_LTTNG) += lttng-probe-writeback.o |
bf2ba318 | 219 | else |
b4955a1a MJ |
220 | ifdef CONFIG_LOCALVERSION # Check if dot-config is included. |
221 | $(warning CONFIG_KALLSYMS_ALL is disabled, therefore probe "writeback" is disabled. Rebuild your kernel with this configuration option enabled in order to trace this subsystem.) | |
222 | endif | |
808dd6df | 223 | endif # CONFIG_KALLSYMS_ALL |
b283666f | 224 | |
acd614cc | 225 | ifneq ($(CONFIG_KPROBES),) |
808dd6df MJ |
226 | obj-$(CONFIG_LTTNG) += lttng-kprobes.o |
227 | endif # CONFIG_KPROBES | |
7371f44c | 228 | |
e33fc900 FD |
229 | ifneq ($(CONFIG_UPROBES),) |
230 | obj-$(CONFIG_LTTNG) += lttng-uprobes.o | |
231 | endif # CONFIG_UPROBES | |
232 | ||
7371f44c | 233 | ifneq ($(CONFIG_KRETPROBES),) |
808dd6df MJ |
234 | obj-$(CONFIG_LTTNG) += lttng-kretprobes.o |
235 | endif # CONFIG_KRETPROBES | |
7371f44c | 236 | |
e0a7a7c4 | 237 | ifneq ($(CONFIG_DYNAMIC_FTRACE),) |
f61d99f9 MJ |
238 | ifeq ($(have_ftrace_header),yes) |
239 | obj-$(CONFIG_LTTNG) += lttng-ftrace.o | |
240 | else | |
5d849667 | 241 | $(warning Files $(ftrace_dep) not found. Probe "ftrace" is disabled. Use full kernel source tree to enable it.) |
f61d99f9 | 242 | endif |
808dd6df | 243 | endif # CONFIG_DYNAMIC_FTRACE |
6d61b34d | 244 | |
0bcebe87 MJ |
245 | ifneq ($(CONFIG_PREEMPTIRQ_EVENTS),) |
246 | obj-$(CONFIG_LTTNG) += lttng-probe-preemptirq.o | |
247 | endif # CONFIG_PREEMPTIRQ_EVENTS | |
248 | ||
50984b44 | 249 | # vim:syntax=make |