2fc16eb08749cfdaf1052141b12bdade760df796
[lttng-modules.git] / probes / Kbuild
1 TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
2
3 include $(TOP_LTTNG_MODULES_DIR)/Makefile.ABI.workarounds
4
5 ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)
6
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
13 obj-$(CONFIG_LTTNG) += lttng-probe-statedump.o
14
15 ifneq ($(CONFIG_KVM),)
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
40
41 ifneq ($(CONFIG_X86),)
42 x86_irq_vectors_dep = $(srctree)/arch/x86/include/asm/trace/irq_vectors.h
43
44 ifneq ($(wildcard $(x86_irq_vectors_dep)),)
45 obj-$(CONFIG_LTTNG) += lttng-probe-x86-irq-vectors.o
46 endif # $(wildcard $(x86_irq_vectors_dep))
47
48 x86_exceptions_dep = $(srctree)/arch/x86/include/asm/trace/exceptions.h
49
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
54
55 obj-$(CONFIG_LTTNG) += $(shell \
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;)
59
60 ifneq ($(CONFIG_BLOCK),)
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
66
67 ifneq ($(CONFIG_NET),)
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
83
84 ifneq ($(CONFIG_SND_SOC),)
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
90
91 ifneq ($(CONFIG_EXT3_FS),)
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
109
110 ifneq ($(CONFIG_GPIOLIB),)
111 obj-$(CONFIG_LTTNG) += $(shell \
112 if [ $(VERSION) -ge 3 ] ; then \
113 echo "lttng-probe-gpio.o" ; fi;)
114 endif # CONFIG_GPIOLIB
115
116 ifneq ($(CONFIG_JBD2),)
117 obj-$(CONFIG_LTTNG) += lttng-probe-jbd2.o
118 endif # CONFIG_JBD2
119
120 ifneq ($(CONFIG_JBD),)
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
126
127 ifneq ($(CONFIG_REGULATOR),)
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
133
134 ifneq ($(CONFIG_SCSI),)
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
140
141 obj-$(CONFIG_LTTNG) += $(shell \
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
146 # lock probe does not work, so disabling it for now
147 #ifneq ($(CONFIG_LOCKDEP),)
148 # obj-$(CONFIG_LTTNG) += lttng-probe-lock.o
149 #endif # CONFIG_LOCKDEP
150
151 ifneq ($(CONFIG_BTRFS_FS),)
152 btrfs_dep = $(srctree)/fs/btrfs/*.h
153 btrfs = $(shell \
154 if [ $(VERSION) -ge 3 \
155 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 39 \) ] ; then \
156 echo "lttng-probe-btrfs.o" ; fi;)
157 ifneq ($(btrfs),)
158 ifeq ($(wildcard $(btrfs_dep)),)
159 $(warning Files $(btrfs_dep) not found. Probe "btrfs" is disabled. Use full kernel source tree to enable it.)
160 btrfs =
161 endif # $(wildcard $(btrfs_dep))
162 endif # $(btrfs)
163 obj-$(CONFIG_LTTNG) += $(btrfs)
164 endif # CONFIG_BTRFS_FS
165
166 obj-$(CONFIG_LTTNG) += $(shell \
167 if [ $(VERSION) -ge 3 \
168 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
169 echo "lttng-probe-compaction.o" ; fi;)
170
171 ifneq ($(CONFIG_EXT4_FS),)
172 ext4_dep = $(srctree)/fs/ext4/*.h
173 ext4 = lttng-probe-ext4.o
174 ifeq ($(wildcard $(ext4_dep)),)
175 $(warning Files $(ext4_dep) not found. Probe "ext4" is disabled. Use full kernel source tree to enable it.)
176 ext4 =
177 endif # $(wildcard $(ext4_dep))
178 obj-$(CONFIG_LTTNG) += $(ext4)
179 endif # CONFIG_EXT4_FS
180
181 obj-$(CONFIG_LTTNG) += $(shell \
182 if [ $(VERSION) -ge 4 \
183 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) ] ; then \
184 echo "lttng-probe-printk.o" ; fi;)
185
186 ifneq ($(CONFIG_FRAME_WARN),0)
187 CFLAGS_lttng-probe-printk.o += -Wframe-larger-than=2200
188 endif
189
190 obj-$(CONFIG_LTTNG) += $(shell \
191 if [ $(VERSION) -ge 4 \
192 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 6 \) \
193 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 5 -a $(SUBLEVEL) -ge 2 \) \
194 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 4 -a $(SUBLEVEL) -ge 9 \) \
195 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 0 -a $(SUBLEVEL) -ge 41 \) ] ; then \
196 echo "lttng-probe-random.o" ; fi;)
197
198 obj-$(CONFIG_LTTNG) += $(shell \
199 if [ $(VERSION) -ge 4 \
200 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \
201 echo "lttng-probe-rcu.o" ; fi;)
202
203 ifneq ($(CONFIG_REGMAP),)
204 regmap_dep_4_1 = $(srctree)/drivers/base/regmap/trace.h
205 ifneq ($(wildcard $(regmap_dep_4_1)),)
206 obj-$(CONFIG_LTTNG) += lttng-probe-regmap.o
207 else
208 $(warning File $(regmap_dep_4_1) not found. Probe "regmap" is disabled. Need Linux 4.1+ kernel source tree to enable it.)
209 endif # $(wildcard $(regmap_dep_4_1)),
210 endif # CONFIG_REGMAP
211
212 ifneq ($(CONFIG_PM_RUNTIME),)
213 obj-$(CONFIG_LTTNG) += $(shell \
214 if [ $(VERSION) -ge 4 \
215 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \
216 echo "lttng-probe-rpm.o" ; fi;)
217 endif # CONFIG_PM_RUNTIME
218
219 ifneq ($(CONFIG_SUNRPC),)
220 obj-$(CONFIG_LTTNG) += $(shell \
221 if [ $(VERSION) -ge 4 \
222 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) ] ; then \
223 echo "lttng-probe-sunrpc.o" ; fi;)
224 endif # CONFIG_SUNRPC
225
226 ifneq ($(CONFIG_VIDEO_V4L2),)
227 obj-$(CONFIG_LTTNG) += $(shell \
228 if [ $(VERSION) -ge 4 \
229 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 14 \) ] ; then \
230 echo "lttng-probe-v4l2.o" ; fi;)
231 endif # CONFIG_VIDEO_V4L2
232
233 obj-$(CONFIG_LTTNG) += lttng-probe-workqueue.o
234
235 ifneq ($(CONFIG_KALLSYMS_ALL),)
236 obj-$(CONFIG_LTTNG) += $(shell \
237 if [ $(VERSION) -ge 3 \
238 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
239 echo "lttng-probe-writeback.o" ; fi;)
240 else
241 $(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.)
242 endif # CONFIG_KALLSYMS_ALL
243
244 ifneq ($(CONFIG_KPROBES),)
245 obj-$(CONFIG_LTTNG) += lttng-kprobes.o
246 endif # CONFIG_KPROBES
247
248 ifneq ($(CONFIG_KRETPROBES),)
249 obj-$(CONFIG_LTTNG) += lttng-kretprobes.o
250 endif # CONFIG_KRETPROBES
251
252 ifneq ($(CONFIG_DYNAMIC_FTRACE),)
253 obj-$(CONFIG_LTTNG) += lttng-ftrace.o
254 endif # CONFIG_DYNAMIC_FTRACE
255
256 # vim:syntax=make
This page took 0.034268 seconds and 3 git commands to generate.