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