Fix: string length calculation reversed user vs kernel args
[deliverable/lttng-modules.git] / probes / Makefile
1 #
2 # Makefile for the LTT probes.
3 # Only build from the package top-level directory. Never use with make directly.
4
5 ifneq ($(KERNELRELEASE),)
6 ifneq ($(CONFIG_TRACEPOINTS),)
7
8 ccflags-y += -I$(PWD)/probes
9 obj-m += lttng-types.o
10
11 obj-m += lttng-probe-sched.o
12 obj-m += lttng-probe-irq.o
13 obj-m += lttng-probe-timer.o
14 obj-m += lttng-probe-kmem.o
15 obj-m += lttng-probe-module.o
16 obj-m += lttng-probe-power.o
17
18 obj-m += lttng-probe-statedump.o
19
20 ifneq ($(CONFIG_KVM),)
21 obj-m += lttng-probe-kvm.o
22 ifneq ($(CONFIG_X86),)
23 kvm_dep = $(srctree)/virt/kvm/iodev.h
24 ifneq ($(wildcard $(kvm_dep)),)
25 CFLAGS_lttng-probe-kvm-x86.o += -I$(srctree)/virt/kvm
26 CFLAGS_lttng-probe-kvm-x86-mmu.o += -I$(srctree)/virt/kvm
27 obj-m += lttng-probe-kvm-x86.o
28 obj-m += lttng-probe-kvm-x86-mmu.o
29 else
30 $(warning File $(kvm_dep) not found. Probe "kvm" x86-specific is disabled. Use full kernel source tree to enable it.)
31 endif
32 endif
33 endif
34
35 obj-m += $(shell \
36 if [ $(VERSION) -ge 3 \
37 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 33 \) ] ; then \
38 echo "lttng-probe-signal.o" ; fi;)
39
40 ifneq ($(CONFIG_BLOCK),)
41 ifneq ($(CONFIG_EVENT_TRACING),) # need blk_cmd_buf_len
42 obj-m += lttng-probe-block.o
43 endif
44 endif
45
46 ifneq ($(CONFIG_NET),)
47 obj-m += lttng-probe-napi.o
48 obj-m += lttng-probe-skb.o
49 obj-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;)
53 obj-m += $(shell \
54 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
55 echo "lttng-probe-sock.o" ; fi;)
56 obj-m += $(shell \
57 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
58 echo "lttng-probe-udp.o" ; fi;)
59 endif
60
61 ifneq ($(CONFIG_SND_SOC),)
62 obj-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;)
66 endif
67
68 ifneq ($(CONFIG_EXT3_FS),)
69 ext3_dep = $(srctree)/fs/ext3/*.h
70 ext3_dep_check = $(wildcard $(ext3_dep))
71 ext3 = $(shell \
72 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
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;)
80 ifeq ($(ext3),warn)
81 $(warning Files $(ext3_dep) not found. Probe "ext3" is disabled. Use full kernel source tree to enable it.)
82 ext3 =
83 endif
84 obj-m += $(ext3)
85 endif
86
87 ifneq ($(CONFIG_GPIOLIB),)
88 obj-m += $(shell \
89 if [ $(VERSION) -ge 3 ] ; then \
90 echo "lttng-probe-gpio.o" ; fi;)
91 endif
92
93 ifneq ($(CONFIG_JBD2),)
94 obj-m += lttng-probe-jbd2.o
95 endif
96
97 ifneq ($(CONFIG_JBD),)
98 obj-m += $(shell \
99 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
100 echo "lttng-probe-jbd.o" ; fi;)
101 endif
102
103 ifneq ($(CONFIG_REGULATOR),)
104 obj-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;)
108 endif
109
110 ifneq ($(CONFIG_SCSI),)
111 obj-m += $(shell \
112 if [ $(VERSION) -ge 3 \
113 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 35 \) ] ; then \
114 echo "lttng-probe-scsi.o" ; fi;)
115 endif
116
117 vmscan = $(shell \
118 if [ $(VERSION) -ge 3 \
119 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
120 echo "lttng-probe-vmscan.o" ; fi;)
121 ifneq ($(CONFIG_SWAP),)
122 obj-m += $(vmscan)
123 else
124 ifneq ($(CONFIG_CGROUP_MEM_RES_CTLR),)
125 obj-m += $(vmscan)
126 endif
127 endif
128
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
134 ifneq ($(CONFIG_BTRFS_FS),)
135 btrfs_dep = $(srctree)/fs/btrfs/*.h
136 btrfs = $(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;)
140 ifneq ($(btrfs),)
141 ifeq ($(wildcard $(btrfs_dep)),)
142 $(warning Files $(btrfs_dep) not found. Probe "btrfs" is disabled. Use full kernel source tree to enable it.)
143 btrfs =
144 endif
145 endif
146 obj-m += $(btrfs)
147 endif
148
149 obj-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
154 ifneq ($(CONFIG_EXT4_FS),)
155 ext4_dep = $(srctree)/fs/ext4/*.h
156 ext4 = lttng-probe-ext4.o
157 ifeq ($(wildcard $(ext4_dep)),)
158 $(warning Files $(ext4_dep) not found. Probe "ext4" is disabled. Use full kernel source tree to enable it.)
159 ext4 =
160 endif
161 obj-m += $(ext4)
162 endif
163
164 obj-m += $(shell \
165 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 4 ] ; then \
166 echo "lttng-probe-printk.o" ; fi;)
167 ifneq ($(CONFIG_FRAME_WARN),0)
168 CFLAGS_lttng-probe-printk.o += -Wframe-larger-than=2200
169 endif
170
171 obj-m += $(shell \
172 if [ $(VERSION) -ge 4 \
173 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 6 \) \
174 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 5 -a $(SUBLEVEL) -ge 2 \) \
175 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 4 -a $(SUBLEVEL) -ge 9 \) \
176 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -eq 0 -a $(SUBLEVEL) -ge 41 \) ] ; then \
177 echo "lttng-probe-random.o" ; fi;)
178
179 obj-m += $(shell \
180 if [ $(VERSION) -ge 4 \
181 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \
182 echo "lttng-probe-rcu.o" ; fi;)
183
184 ifneq ($(CONFIG_REGMAP),)
185 obj-m += $(shell \
186 if [ $(VERSION) -ge 4 \
187 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \
188 echo "lttng-probe-regmap.o" ; fi;)
189 endif
190
191 ifneq ($(CONFIG_PM_RUNTIME),)
192 obj-m += $(shell \
193 if [ $(VERSION) -ge 4 \
194 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 2 \) ] ; then \
195 echo "lttng-probe-rpm.o" ; fi;)
196 endif
197
198 ifneq ($(CONFIG_SUNRPC),)
199 obj-m += $(shell \
200 if [ $(VERSION) -ge 4 \
201 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 4 \) ] ; then \
202 echo "lttng-probe-sunrpc.o" ; fi;)
203 endif
204
205 ifneq ($(CONFIG_VIDEO_V4L2),)
206 obj-m += $(shell \
207 if [ $(VERSION) -ge 4 \
208 -o \( $(VERSION) -eq 3 -a $(PATCHLEVEL) -ge 14 \) ] ; then \
209 echo "lttng-probe-v4l2.o" ; fi;)
210 endif
211
212 obj-m += lttng-probe-workqueue.o
213
214 ifneq ($(CONFIG_KALLSYMS_ALL),)
215 obj-m += $(shell \
216 if [ $(VERSION) -ge 3 \
217 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \
218 echo "lttng-probe-writeback.o" ; fi;)
219 else
220 $(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.)
221 endif
222
223
224 ifneq ($(CONFIG_KPROBES),)
225 obj-m += lttng-kprobes.o
226 endif
227
228
229 ifneq ($(CONFIG_KRETPROBES),)
230 obj-m += lttng-kretprobes.o
231 endif
232
233 ifneq ($(CONFIG_DYNAMIC_FTRACE),)
234 obj-m += lttng-ftrace.o
235 endif
236
237 endif
238
239 else
240 KERNELDIR ?= /lib/modules/$(shell uname -r)/build
241 PWD := $(shell pwd)
242 CFLAGS = $(EXTCFLAGS)
243
244 default:
245 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
246
247 modules_install:
248 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
249 /sbin/depmod -a
250
251 clean:
252 $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
253
254 endif
This page took 0.035594 seconds and 5 git commands to generate.