Fix: missing parenthesis in offset_align_floor
[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
8ccflags-y += -I$(PWD)/probes
40652b65 9obj-m += lttng-types.o
6d61b34d 10
6db3d13b 11obj-m += lttng-probe-sched.o
0d1d4002 12obj-m += lttng-probe-irq.o
e54456f5 13obj-m += lttng-probe-timer.o
b283666f
PW
14obj-m += lttng-probe-kmem.o
15obj-m += lttng-probe-module.o
16obj-m += lttng-probe-power.o
8c468a9b 17
c337ddc2
MD
18obj-m += lttng-probe-statedump.o
19
056f5922 20ifneq ($(CONFIG_KVM),)
0862130a 21obj-m += lttng-probe-kvm.o
b3c40230
MG
22ifneq ($(CONFIG_X86),)
23kvm_dep = $(srctree)/virt/kvm/iodev.h
0862130a
MD
24ifneq ($(wildcard $(kvm_dep)),)
25CFLAGS_lttng-probe-kvm-x86.o += -I$(srctree)/virt/kvm
26CFLAGS_lttng-probe-kvm-x86-mmu.o += -I$(srctree)/virt/kvm
27obj-m += lttng-probe-kvm-x86.o
28obj-m += lttng-probe-kvm-x86-mmu.o
29else
30$(warning File $(kvm_dep) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.)
b3c40230 31endif
b3c40230 32endif
056f5922
MD
33endif
34
3a523f5b
MD
35obj-m += $(shell \
36 if [ $(VERSION) -ge 3 \
7c68b363 37 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 33 \) ] ; then \
3a523f5b
MD
38 echo "lttng-probe-signal.o" ; fi;)
39
c9604bd3
MD
40ifneq ($(CONFIG_BLOCK),)
41ifneq ($(CONFIG_EVENT_TRACING),) # need blk_cmd_buf_len
7c68b363 42obj-m += lttng-probe-block.o
c9604bd3
MD
43endif
44endif
45
b283666f 46ifneq ($(CONFIG_NET),)
b283666f
PW
47obj-m += lttng-probe-napi.o
48obj-m += lttng-probe-skb.o
7c68b363
AG
49obj-m += $(shell \
50 if [ $(VERSION) -ge 3 \
51 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 37 \) ] ; then \
52 echo "lttng-probe-net.o" ; fi;)
b283666f
PW
53obj-m += $(shell \
54 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
55 echo "lttng-probe-sock.o" ; fi;)
56obj-m += $(shell \
57 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
58 echo "lttng-probe-udp.o" ; fi;)
59endif
60
61ifneq ($(CONFIG_SND_SOC),)
62obj-m += $(shell \
63 if [ $(VERSION) -ge 3 \
64 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
65 echo "lttng-probe-asoc.o" ; fi;)
66endif
67
68ifneq ($(CONFIG_EXT3_FS),)
7c68b363
AG
69ext3_dep = $(srctree)/fs/ext3/*.h
70ext3_dep_check = $(wildcard $(ext3_dep))
71ext3 = $(shell \
b283666f 72 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
7c68b363
AG
73 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 4 -a \
74 -z "$(ext3_dep_check)" ] ; then \
75 echo "warn" ; \
76 exit ; \
77 fi; \
78 echo "lttng-probe-ext3.o" ; \
79 fi;)
80ifeq ($(ext3),warn)
81$(warning Files $(ext3_dep) not found. Probe "ext3" is disabled. Use full kernel source tree to enable it.)
82ext3 =
83endif
84obj-m += $(ext3)
b283666f
PW
85endif
86
87ifneq ($(CONFIG_GPIOLIB),)
88obj-m += $(shell \
89 if [ $(VERSION) -ge 3 ] ; then \
90 echo "lttng-probe-gpio.o" ; fi;)
91endif
92
93ifneq ($(CONFIG_JBD2),)
94obj-m += lttng-probe-jbd2.o
95endif
96
97ifneq ($(CONFIG_JBD),)
98obj-m += $(shell \
99 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
100 echo "lttng-probe-jbd.o" ; fi;)
101endif
102
103ifneq ($(CONFIG_REGULATOR),)
104obj-m += $(shell \
105 if [ $(VERSION) -ge 3 \
106 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
107 echo "lttng-probe-regulator.o" ; fi;)
108endif
109
110ifneq ($(CONFIG_SCSI),)
111obj-m += $(shell \
7c68b363
AG
112 if [ $(VERSION) -ge 3 \
113 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 35 \) ] ; then \
b283666f
PW
114 echo "lttng-probe-scsi.o" ; fi;)
115endif
116
117vmscan = $(shell \
7c68b363
AG
118 if [ $(VERSION) -ge 3 \
119 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
b283666f
PW
120 echo "lttng-probe-vmscan.o" ; fi;)
121ifneq ($(CONFIG_SWAP),)
122 obj-m += $(vmscan)
123else
124ifneq ($(CONFIG_CGROUP_MEM_RES_CTLR),)
125 obj-m += $(vmscan)
126endif
127endif
128
7c68b363
AG
129# lock probe does not work, so disabling it for now
130#ifneq ($(CONFIG_LOCKDEP),)
131#obj-m += lttng-probe-lock.o
132#endif
133
b87700e3
AG
134ifneq ($(CONFIG_BTRFS_FS),)
135btrfs_dep = $(srctree)/fs/btrfs/*.h
136btrfs = $(shell \
137 if [ $(VERSION) -ge 3 \
138 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 39 \) ] ; then \
139 echo "lttng-probe-btrfs.o" ; fi;)
140ifneq ($(btrfs),)
141ifeq ($(wildcard $(btrfs_dep)),)
142$(warning Files $(btrfs_dep) not found. Probe "btrfs" is disabled. Use full kernel source tree to enable it.)
143btrfs =
144endif
145endif
146obj-m += $(btrfs)
147endif
148
149obj-m += $(shell \
150 if [ $(VERSION) -ge 3 \
151 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
152 echo "lttng-probe-compaction.o" ; fi;)
153
154ifneq ($(CONFIG_EXT4_FS),)
155ext4_dep = $(srctree)/fs/ext4/*.h
156ext4 = lttng-probe-ext4.o
157ifeq ($(wildcard $(ext4_dep)),)
158$(warning Files $(ext4_dep) not found. Probe "ext4" is disabled. Use full kernel source tree to enable it.)
159ext4 =
160endif
161obj-m += $(ext4)
162endif
163
164obj-m += $(shell \
165 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 4 ] ; then \
166 echo "lttng-probe-printk.o" ; fi;)
167ifneq ($(CONFIG_FRAME_WARN),0)
168CFLAGS_lttng-probe-printk.o += -Wframe-larger-than=2200
169endif
170
171obj-m += $(shell \
172 if [ \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 6 \) \
173 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 5 -a $(SUBLEVEL) -ge 2 \) \
174 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 4 -a $(SUBLEVEL) -ge 9 \) \
175 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 0 -a $(SUBLEVEL) -ge 41 \) ] ; then \
176 echo "lttng-probe-random.o" ; fi;)
177
178obj-m += $(shell \
179 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 2 ] ; then \
180 echo "lttng-probe-rcu.o" ; fi;)
181
182ifneq ($(CONFIG_REGMAP),)
183obj-m += $(shell \
184 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 2 ] ; then \
185 echo "lttng-probe-regmap.o" ; fi;)
186endif
187
188ifneq ($(CONFIG_PM_RUNTIME),)
189obj-m += $(shell \
190 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 2 ] ; then \
191 echo "lttng-probe-rpm.o" ; fi;)
192endif
193
194ifneq ($(CONFIG_SUNRPC),)
195obj-m += $(shell \
196 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 4 ] ; then \
197 echo "lttng-probe-sunrpc.o" ; fi;)
198endif
199
e09a6084
WF
200ifneq ($(CONFIG_VIDEO_V4L2),)
201obj-m += $(shell \
202 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 14 ] ; then \
203 echo "lttng-probe-v4l2.o" ; fi;)
204endif
205
b87700e3
AG
206obj-m += lttng-probe-workqueue.o
207
42d9070d 208ifneq ($(CONFIG_KALLSYMS_ALL),)
b87700e3
AG
209obj-m += $(shell \
210 if [ $(VERSION) -ge 3 \
211 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
212 echo "lttng-probe-writeback.o" ; fi;)
e5429076
MD
213else
214$(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 215endif
b87700e3 216
b283666f 217
acd614cc 218ifneq ($(CONFIG_KPROBES),)
d6d808f3 219obj-m += lttng-kprobes.o
acd614cc 220endif
d6d808f3 221
7371f44c
MD
222
223ifneq ($(CONFIG_KRETPROBES),)
224obj-m += lttng-kretprobes.o
225endif
226
e0a7a7c4
MD
227ifneq ($(CONFIG_DYNAMIC_FTRACE),)
228obj-m += lttng-ftrace.o
229endif
230
6d61b34d
MD
231endif
232
233else
234 KERNELDIR ?= /lib/modules/$(shell uname -r)/build
235 PWD := $(shell pwd)
236 CFLAGS = $(EXTCFLAGS)
237
238default:
239 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
240
241modules_install:
242 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
243 /sbin/depmod -a
244
245clean:
246 $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
247
248endif
This page took 0.040097 seconds and 4 git commands to generate.