Fix: remove CONFIG_KALLSYMS_ALL warning on clean
[lttng-modules.git] / probes / Kbuild
CommitLineData
b933d85e 1TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/..
72e6c528 2
b933d85e 3include $(TOP_LTTNG_MODULES_DIR)/Makefile.ABI.workarounds
72e6c528 4
b933d85e 5ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)
6d61b34d 6
6ccec973
MJ
7obj-$(CONFIG_LTTNG) += lttng-probe-sched.o
8obj-$(CONFIG_LTTNG) += lttng-probe-irq.o
9obj-$(CONFIG_LTTNG) += lttng-probe-timer.o
10obj-$(CONFIG_LTTNG) += lttng-probe-kmem.o
11obj-$(CONFIG_LTTNG) += lttng-probe-module.o
12obj-$(CONFIG_LTTNG) += lttng-probe-power.o
6ccec973 13obj-$(CONFIG_LTTNG) += lttng-probe-statedump.o
c337ddc2 14
056f5922 15ifneq ($(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
39endif # CONFIG_KVM
056f5922 40
d2507215 41ifneq ($(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))
53endif # CONFIG_X86
d2507215 54
6ccec973 55obj-$(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 60ifneq ($(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
65endif # CONFIG_BLOCK
c9604bd3 66
b283666f 67ifneq ($(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;)
82endif # CONFIG_NET
b283666f
PW
83
84ifneq ($(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;)
89endif # CONFIG_SND_SOC
b283666f
PW
90
91ifneq ($(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)
108endif # CONFIG_EXT3_FS
b283666f
PW
109
110ifneq ($(CONFIG_GPIOLIB),)
808dd6df
MJ
111 obj-$(CONFIG_LTTNG) += $(shell \
112 if [ $(VERSION) -ge 3 ] ; then \
113 echo "lttng-probe-gpio.o" ; fi;)
114endif # CONFIG_GPIOLIB
b283666f
PW
115
116ifneq ($(CONFIG_JBD2),)
808dd6df
MJ
117 obj-$(CONFIG_LTTNG) += lttng-probe-jbd2.o
118endif # CONFIG_JBD2
b283666f
PW
119
120ifneq ($(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;)
125endif # CONFIG_JBD
b283666f
PW
126
127ifneq ($(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;)
132endif # CONFIG_REGULATOR
b283666f
PW
133
134ifneq ($(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;)
139endif # CONFIG_SCSI
b283666f 140
9c8dbd0a 141obj-$(CONFIG_LTTNG) += $(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
7c68b363
AG
146# lock probe does not work, so disabling it for now
147#ifneq ($(CONFIG_LOCKDEP),)
808dd6df
MJ
148# obj-$(CONFIG_LTTNG) += lttng-probe-lock.o
149#endif # CONFIG_LOCKDEP
7c68b363 150
b87700e3 151ifneq ($(CONFIG_BTRFS_FS),)
808dd6df
MJ
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)
164endif # CONFIG_BTRFS_FS
b87700e3 165
6ccec973 166obj-$(CONFIG_LTTNG) += $(shell \
808dd6df
MJ
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;)
b87700e3
AG
170
171ifneq ($(CONFIG_EXT4_FS),)
808dd6df
MJ
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)
179endif # CONFIG_EXT4_FS
b87700e3 180
6ccec973 181obj-$(CONFIG_LTTNG) += $(shell \
808dd6df
MJ
182 if [ $(VERSION) -ge 4 \
183 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) ] ; then \
184 echo "lttng-probe-printk.o" ; fi;)
185
b87700e3 186ifneq ($(CONFIG_FRAME_WARN),0)
808dd6df 187 CFLAGS_lttng-probe-printk.o += -Wframe-larger-than=2200
b87700e3
AG
188endif
189
6ccec973 190obj-$(CONFIG_LTTNG) += $(shell \
808dd6df
MJ
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;)
b87700e3 197
6ccec973 198obj-$(CONFIG_LTTNG) += $(shell \
808dd6df
MJ
199 if [ $(VERSION) -ge 4 \
200 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \
201 echo "lttng-probe-rcu.o" ; fi;)
b87700e3
AG
202
203ifneq ($(CONFIG_REGMAP),)
808dd6df
MJ
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)),
210endif # CONFIG_REGMAP
b87700e3
AG
211
212ifneq ($(CONFIG_PM_RUNTIME),)
808dd6df
MJ
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;)
217endif # CONFIG_PM_RUNTIME
b87700e3
AG
218
219ifneq ($(CONFIG_SUNRPC),)
808dd6df
MJ
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;)
224endif # CONFIG_SUNRPC
b87700e3 225
e09a6084 226ifneq ($(CONFIG_VIDEO_V4L2),)
808dd6df
MJ
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;)
231endif # CONFIG_VIDEO_V4L2
e09a6084 232
6ccec973 233obj-$(CONFIG_LTTNG) += lttng-probe-workqueue.o
b87700e3 234
42d9070d 235ifneq ($(CONFIG_KALLSYMS_ALL),)
808dd6df
MJ
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;)
bf2ba318 240else
58a249a6
MJ
241 ifdef CONFIG_LOCALVERSION # Check if dot-config is included.
242 $(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.)
243 endif
808dd6df 244endif # CONFIG_KALLSYMS_ALL
b283666f 245
acd614cc 246ifneq ($(CONFIG_KPROBES),)
808dd6df
MJ
247 obj-$(CONFIG_LTTNG) += lttng-kprobes.o
248endif # CONFIG_KPROBES
7371f44c
MD
249
250ifneq ($(CONFIG_KRETPROBES),)
808dd6df
MJ
251 obj-$(CONFIG_LTTNG) += lttng-kretprobes.o
252endif # CONFIG_KRETPROBES
7371f44c 253
e0a7a7c4 254ifneq ($(CONFIG_DYNAMIC_FTRACE),)
808dd6df
MJ
255 obj-$(CONFIG_LTTNG) += lttng-ftrace.o
256endif # CONFIG_DYNAMIC_FTRACE
6d61b34d 257
50984b44 258# vim:syntax=make
This page took 0.046084 seconds and 4 git commands to generate.