Instrument x86 page faults
[deliverable/lttng-modules.git] / probes / Makefile
CommitLineData
6d61b34d
MD
1#
2# Makefile for the LTT probes.
df4b4094 3# Only build from the package top-level directory. Never use with make directly.
6d61b34d
MD
4
5ifneq ($(KERNELRELEASE),)
6ifneq ($(CONFIG_TRACEPOINTS),)
7
b37d476e
MD
8KERNELDIR = ${LTTNG_KERNELDIR}
9MAKEFILEDIR = $(shell dirname $(lastword $(MAKEFILE_LIST)))
72e6c528 10
b37d476e 11include $(MAKEFILEDIR)/../Makefile.ABI.workarounds
72e6c528 12
6d61b34d 13ccflags-y += -I$(PWD)/probes
40652b65 14obj-m += lttng-types.o
6d61b34d 15
6db3d13b 16obj-m += lttng-probe-sched.o
0d1d4002 17obj-m += lttng-probe-irq.o
e54456f5 18obj-m += lttng-probe-timer.o
b283666f
PW
19obj-m += lttng-probe-kmem.o
20obj-m += lttng-probe-module.o
21obj-m += lttng-probe-power.o
8c468a9b 22
c337ddc2
MD
23obj-m += lttng-probe-statedump.o
24
056f5922 25ifneq ($(CONFIG_KVM),)
0862130a 26obj-m += lttng-probe-kvm.o
b3c40230 27ifneq ($(CONFIG_X86),)
a3a64dff
CA
28kvm_dep_lapic = $(srctree)/arch/x86/kvm/lapic.h
29ifneq ($(wildcard $(kvm_dep_lapic)),)
1de8b2e4 30kvm_dep = $(srctree)/virt/kvm/iodev.h $(srctree)/include/kvm/iodev.h
0862130a
MD
31ifneq ($(wildcard $(kvm_dep)),)
32CFLAGS_lttng-probe-kvm-x86.o += -I$(srctree)/virt/kvm
33CFLAGS_lttng-probe-kvm-x86-mmu.o += -I$(srctree)/virt/kvm
01ba366e
MD
34obj-m += $(shell \
35 if [ $(VERSION) -ge 3 \
36 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
37 echo "lttng-probe-kvm-x86.o" ; fi;)
38obj-m += $(shell \
39 if [ $(VERSION) -ge 3 \
40 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
41 echo "lttng-probe-kvm-x86-mmu.o" ; fi;)
0862130a
MD
42else
43$(warning File $(kvm_dep) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.)
a3a64dff
CA
44endif
45else
46$(warning File $(kvm_dep_lapic) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.)
b3c40230 47endif
b3c40230 48endif
056f5922
MD
49endif
50
d2507215 51ifneq ($(CONFIG_X86),)
da0f6c58 52
d2507215
MD
53x86_irq_vectors_dep = $(srctree)/arch/x86/include/asm/trace/irq_vectors.h
54ifneq ($(wildcard $(x86_irq_vectors_dep)),)
55obj-m += lttng-probe-x86-irq-vectors.o
56endif
da0f6c58
MD
57
58x86_exceptions_dep = $(srctree)/arch/x86/include/asm/trace/exceptions.h
59ifneq ($(wildcard $(x86_exceptions_dep)),)
60obj-m += lttng-probe-x86-exceptions.o
61endif
62
d2507215
MD
63endif
64
3a523f5b
MD
65obj-m += $(shell \
66 if [ $(VERSION) -ge 3 \
7c68b363 67 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 33 \) ] ; then \
3a523f5b
MD
68 echo "lttng-probe-signal.o" ; fi;)
69
c9604bd3
MD
70ifneq ($(CONFIG_BLOCK),)
71ifneq ($(CONFIG_EVENT_TRACING),) # need blk_cmd_buf_len
7c68b363 72obj-m += lttng-probe-block.o
c9604bd3
MD
73endif
74endif
75
b283666f 76ifneq ($(CONFIG_NET),)
b283666f
PW
77obj-m += lttng-probe-napi.o
78obj-m += lttng-probe-skb.o
7c68b363
AG
79obj-m += $(shell \
80 if [ $(VERSION) -ge 3 \
81 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 37 \) ] ; then \
82 echo "lttng-probe-net.o" ; fi;)
b283666f 83obj-m += $(shell \
96528cca
MJ
84 if [ $(VERSION) -ge 4 \
85 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
b283666f
PW
86 echo "lttng-probe-sock.o" ; fi;)
87obj-m += $(shell \
96528cca
MJ
88 if [ $(VERSION) -ge 4 \
89 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
b283666f
PW
90 echo "lttng-probe-udp.o" ; fi;)
91endif
92
93ifneq ($(CONFIG_SND_SOC),)
94obj-m += $(shell \
95 if [ $(VERSION) -ge 3 \
96 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
97 echo "lttng-probe-asoc.o" ; fi;)
98endif
99
100ifneq ($(CONFIG_EXT3_FS),)
7c68b363
AG
101ext3_dep = $(srctree)/fs/ext3/*.h
102ext3_dep_check = $(wildcard $(ext3_dep))
103ext3 = $(shell \
96528cca
MJ
104 if [ $(VERSION) -ge 4 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
105 if [ \( $(VERSION) -ge 4 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) \) -a \
7c68b363
AG
106 -z "$(ext3_dep_check)" ] ; then \
107 echo "warn" ; \
108 exit ; \
109 fi; \
110 echo "lttng-probe-ext3.o" ; \
111 fi;)
112ifeq ($(ext3),warn)
113$(warning Files $(ext3_dep) not found. Probe "ext3" is disabled. Use full kernel source tree to enable it.)
114ext3 =
115endif
116obj-m += $(ext3)
b283666f
PW
117endif
118
119ifneq ($(CONFIG_GPIOLIB),)
120obj-m += $(shell \
121 if [ $(VERSION) -ge 3 ] ; then \
122 echo "lttng-probe-gpio.o" ; fi;)
123endif
124
125ifneq ($(CONFIG_JBD2),)
126obj-m += lttng-probe-jbd2.o
127endif
128
129ifneq ($(CONFIG_JBD),)
130obj-m += $(shell \
96528cca
MJ
131 if [ $(VERSION) -ge 4 \
132 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 1 \) ] ; then \
b283666f
PW
133 echo "lttng-probe-jbd.o" ; fi;)
134endif
135
136ifneq ($(CONFIG_REGULATOR),)
137obj-m += $(shell \
138 if [ $(VERSION) -ge 3 \
139 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
140 echo "lttng-probe-regulator.o" ; fi;)
141endif
142
143ifneq ($(CONFIG_SCSI),)
144obj-m += $(shell \
7c68b363
AG
145 if [ $(VERSION) -ge 3 \
146 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 35 \) ] ; then \
b283666f
PW
147 echo "lttng-probe-scsi.o" ; fi;)
148endif
149
150vmscan = $(shell \
7c68b363
AG
151 if [ $(VERSION) -ge 3 \
152 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
b283666f
PW
153 echo "lttng-probe-vmscan.o" ; fi;)
154ifneq ($(CONFIG_SWAP),)
155 obj-m += $(vmscan)
156else
157ifneq ($(CONFIG_CGROUP_MEM_RES_CTLR),)
158 obj-m += $(vmscan)
159endif
160endif
161
7c68b363
AG
162# lock probe does not work, so disabling it for now
163#ifneq ($(CONFIG_LOCKDEP),)
164#obj-m += lttng-probe-lock.o
165#endif
166
b87700e3
AG
167ifneq ($(CONFIG_BTRFS_FS),)
168btrfs_dep = $(srctree)/fs/btrfs/*.h
169btrfs = $(shell \
170 if [ $(VERSION) -ge 3 \
171 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 39 \) ] ; then \
172 echo "lttng-probe-btrfs.o" ; fi;)
173ifneq ($(btrfs),)
174ifeq ($(wildcard $(btrfs_dep)),)
175$(warning Files $(btrfs_dep) not found. Probe "btrfs" is disabled. Use full kernel source tree to enable it.)
176btrfs =
177endif
178endif
179obj-m += $(btrfs)
180endif
181
182obj-m += $(shell \
183 if [ $(VERSION) -ge 3 \
184 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
185 echo "lttng-probe-compaction.o" ; fi;)
186
187ifneq ($(CONFIG_EXT4_FS),)
188ext4_dep = $(srctree)/fs/ext4/*.h
189ext4 = lttng-probe-ext4.o
190ifeq ($(wildcard $(ext4_dep)),)
191$(warning Files $(ext4_dep) not found. Probe "ext4" is disabled. Use full kernel source tree to enable it.)
192ext4 =
193endif
194obj-m += $(ext4)
195endif
196
197obj-m += $(shell \
96528cca
MJ
198 if [ $(VERSION) -ge 4 \
199 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) ] ; then \
b87700e3
AG
200 echo "lttng-probe-printk.o" ; fi;)
201ifneq ($(CONFIG_FRAME_WARN),0)
202CFLAGS_lttng-probe-printk.o += -Wframe-larger-than=2200
203endif
204
205obj-m += $(shell \
725528de
MD
206 if [ $(VERSION) -ge 4 \
207 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 6 \) \
b87700e3
AG
208 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 5 -a $(SUBLEVEL) -ge 2 \) \
209 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 4 -a $(SUBLEVEL) -ge 9 \) \
210 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 0 -a $(SUBLEVEL) -ge 41 \) ] ; then \
211 echo "lttng-probe-random.o" ; fi;)
212
213obj-m += $(shell \
725528de
MD
214 if [ $(VERSION) -ge 4 \
215 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \
b87700e3
AG
216 echo "lttng-probe-rcu.o" ; fi;)
217
218ifneq ($(CONFIG_REGMAP),)
2f2b673a 219regmap_dep_4_1 = $(srctree)/drivers/base/regmap/trace.h
2f2b673a 220ifneq ($(wildcard $(regmap_dep_4_1)),)
89a073a2 221obj-m += lttng-probe-regmap.o
17f1865d 222else
89a073a2 223$(warning File $(regmap_dep_4_1) not found. Probe "regmap" is disabled. Need Linux 4.1+ kernel source tree to enable it.)
17f1865d 224endif
b87700e3
AG
225endif
226
227ifneq ($(CONFIG_PM_RUNTIME),)
228obj-m += $(shell \
725528de
MD
229 if [ $(VERSION) -ge 4 \
230 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \
b87700e3
AG
231 echo "lttng-probe-rpm.o" ; fi;)
232endif
233
234ifneq ($(CONFIG_SUNRPC),)
235obj-m += $(shell \
725528de
MD
236 if [ $(VERSION) -ge 4 \
237 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) ] ; then \
b87700e3
AG
238 echo "lttng-probe-sunrpc.o" ; fi;)
239endif
240
e09a6084
WF
241ifneq ($(CONFIG_VIDEO_V4L2),)
242obj-m += $(shell \
725528de
MD
243 if [ $(VERSION) -ge 4 \
244 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 14 \) ] ; then \
e09a6084
WF
245 echo "lttng-probe-v4l2.o" ; fi;)
246endif
247
b87700e3
AG
248obj-m += lttng-probe-workqueue.o
249
42d9070d 250ifneq ($(CONFIG_KALLSYMS_ALL),)
b87700e3
AG
251obj-m += $(shell \
252 if [ $(VERSION) -ge 3 \
253 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
254 echo "lttng-probe-writeback.o" ; fi;)
bf2ba318
MD
255else
256$(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.)
42d9070d 257endif
b87700e3 258
b283666f 259
acd614cc 260ifneq ($(CONFIG_KPROBES),)
d6d808f3 261obj-m += lttng-kprobes.o
acd614cc 262endif
d6d808f3 263
7371f44c
MD
264
265ifneq ($(CONFIG_KRETPROBES),)
266obj-m += lttng-kretprobes.o
267endif
268
e0a7a7c4
MD
269ifneq ($(CONFIG_DYNAMIC_FTRACE),)
270obj-m += lttng-ftrace.o
271endif
272
6d61b34d
MD
273endif
274
89406ecd
MD
275obj-m += lttng-test.o
276
6d61b34d
MD
277else
278 KERNELDIR ?= /lib/modules/$(shell uname -r)/build
279 PWD := $(shell pwd)
280 CFLAGS = $(EXTCFLAGS)
281
282default:
283 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
284
285modules_install:
286 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
287 /sbin/depmod -a
288
289clean:
290 $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
291
292endif
This page took 0.044637 seconds and 5 git commands to generate.